lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Hatcher <>
Date Wed, 01 Dec 2004 19:43:41 GMT
On Dec 1, 2004, at 2:21 PM, petite_abeille wrote:
> On Dec 01, 2004, at 20:06, Erik Hatcher wrote:
>> I also extensively use multiple fields of the same name.
> Odd... on the other hand... perhaps this is "une affaire de gout"...

There are some places I use this for convenience, and another where it 
seems the best way to do it.  Here's an example that I'm actively 
working on.  I'm parsing XML files.  There are dates embedded in the 
data and the requirement is for year range queries.  The original data 
looks like this, believe it or not:  "1837-56" or "1846-9", or 
"1824-1911", or simply "1856".  I wrote a routine to extract a String[] 
of years.  In the first example it would be 1837, 1838, 1839... and so 

I index as:
       for (int i=0; i < years.length; i++) {
   		doc.add(Field.Keyword("year", years[i]));

Sure, I could put it all together as a space separated String and use 
the WhitespaceAnalyzer, but why not do it this way?  What other 
suggestions do you have for doing this?


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message