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 on.
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?
Erik
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
