You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by lu...@jakarta.apache.org on 2004/11/24 23:55:37 UTC

[Jakarta Lucene Wiki] Updated: SearchNumericalFields

   Date: 2004-11-24T14:55:36
   Editor: HossMan <ho...@fucit.org>
   Wiki: Jakarta Lucene Wiki
   Page: SearchNumericalFields
   URL: http://wiki.apache.org/jakarta-lucene/SearchNumericalFields

   no comment

Change Log:

------------------------------------------------------------------------------
@@ -22,6 +22,12 @@
 
        doc.add(Field.Keyword("id", Number''''''Utils.pad(i)));
 
+ == Consider Using a Filter ==
+
+ Building a Query that for a number (or a range of numbers) is just like building a Query for a word -- it involves scoring based on the frequency of that word (or number) in the index which isn't usually what people want.  So you may want to consider "Filtering" using the RangeFilter class instead.  It can be a lot more efficient then using the RangeQuery class because it can skip all of the score related issues.
+
+ http://nagoya.apache.org/eyebrowse/BrowseList?listName=lucene-user@jakarta.apache.org&by=thread&from=943115
+
  == Create a custom QueryParser subclass: ==
 
   public class Custom''''''Query''''''Parser extends Query''''''Parser {
@@ -52,7 +58,7 @@
 
   Note: Only the "id" field is treated special, but your logic may vary.
 
-  == Use the custom QueryParser ==
+  === Use the custom QueryParser ===
 
      Custom``Query''''''Parser parser =
          new Custom''''''Query``Parser("field", analyzer);
@@ -63,7 +69,7 @@
                             query.toString("field"));
 
 
-  == For decimals ==
+ == For decimals ==
 
   You can use a multiplier to make sure you don't have decimals if they cause problems.(comment by sv)
 
@@ -121,7 +127,7 @@
  }
  }}}
  
- === Handling larger numbers ===
+ == Handling larger numbers ==
  
  The code for a class for handling all possible long values is here. http://www.mail-archive.com/lucene-dev@jakarta.apache.org/msg04790.html
  

---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-dev-help@jakarta.apache.org