lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From uschind...@apache.org
Subject svn commit: r815195 - in /lucene/java/trunk/src/java/org/apache/lucene: document/NumericField.java search/NumericRangeQuery.java
Date Tue, 15 Sep 2009 07:28:27 GMT
Author: uschindler
Date: Tue Sep 15 07:28:27 2009
New Revision: 815195

URL: http://svn.apache.org/viewvc?rev=815195&view=rev
Log:
LUCENE-1872: Javadocs updates of Numeric*

Modified:
    lucene/java/trunk/src/java/org/apache/lucene/document/NumericField.java
    lucene/java/trunk/src/java/org/apache/lucene/search/NumericRangeQuery.java

Modified: lucene/java/trunk/src/java/org/apache/lucene/document/NumericField.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/document/NumericField.java?rev=815195&r1=815194&r2=815195&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/document/NumericField.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/document/NumericField.java Tue Sep 15 07:28:27
2009
@@ -107,6 +107,10 @@
  * like to change the value.  Note that you must also
  * specify a congruent value when creating {@link
  * NumericRangeQuery} or {@link NumericRangeFilter}.
+ * For low cardinality fields larger precision steps are good.
+ * If the cardinality is < 100, it is fair
+ * to use {@link Integer#MAX_VALUE}, which produces one
+ * term per value.
  *
  * <p>For more information on the internals of numeric trie
  * indexing, including the <a

Modified: lucene/java/trunk/src/java/org/apache/lucene/search/NumericRangeQuery.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/search/NumericRangeQuery.java?rev=815195&r1=815194&r2=815195&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/search/NumericRangeQuery.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/search/NumericRangeQuery.java Tue Sep 15
07:28:27 2009
@@ -133,11 +133,15 @@
  *  <li>The default for all data types is <b>4</b>, which is used, when
no <code>precisionStep</code> is given.
  *  <li>Ideal value in most cases for <em>64 bit</em> data types <em>(long,
double)</em> is <b>6</b> or <b>8</b>.
  *  <li>Ideal value in most cases for <em>32 bit</em> data types <em>(int,
float)</em> is <b>4</b>.
+ *  <li>For low cardinality fields larger precision steps are good. If the cardinality
is &lt; 100, it is
+ *  fair to use {@link Integer#MAX_VALUE} (see below).
  *  <li>Steps <b>&ge;64</b> for <em>long/double</em> and
<b>&ge;32</b> for <em>int/float</em> produces one token
  *  per value in the index and querying is as slow as a conventional {@link TermRangeQuery}.
But it can be used
  *  to produce fields, that are solely used for sorting (in this case simply use {@link Integer#MAX_VALUE}
as
  *  <code>precisionStep</code>). Using {@link NumericField NumericFields} for
sorting
  *  is ideal, because building the field cache is much faster than with text-only numbers.
+ *  These fields have one term per value and therefore also work with term enumeration for
building distinct lists
+ *  (e.g. facets / preselected values to search for).
  *  Sorting is also possible with range query optimized fields using one of the above <code>precisionSteps</code>.
  * </ul>
  *



Mime
View raw message