lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Taylor <paul_t...@fastmail.fm>
Subject How do you properly use NumericField
Date Fri, 09 Oct 2009 19:26:14 GMT
Hi

I currently use NumberTools.longToString() to add integer fields to an 
index and allow range searching, then when searching I then preprocess 
the query (using regular expressions) and convert integer fields to 
NumberTools.longToString  before it is parsed by the QueryParser, then 
when I return the results I use NumberTools.stringToLong(), so my 
implementation is flaky. Now I'm using Lucene 2.9 I thought Id use 
NumericField and hoped I could remove the preprocessing instead but I'm 
really not clear what I do on the indexing and searching side. I've even 
just bought the MEAP version of Lucene Action 2nd Edition and it doesn't 
even get a mention (nor does NumberTools for that matter it just 
mentions padding numbers with zeroes).

So please anyone got a simple example of how to add a numeric field to 
an index, and what has to be done on the search side, assuming receiving 
a text string that gets parsed by the QueryParser

thanks Paul



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


Mime
View raw message