I think it's document.add(). Fields are pushed onto the front, rather than added to the end.
Ah, ok.... DocumentFieldList/DocumentFieldEnumeration are the culprits.
This is certainly a bug. With things going in reverse order as they are now, a PhraseQuery for "brown quick" matches this document:
doc.add(Field.Keyword("contents", "quick"));
doc.add(Field.Keyword("contents", "brown"));There is merit to what Boris said about phrase queries not matching across, but if that effect is desired the position increments can be adjusted somehow (but how could someone do this? a stateful analyzer?)
I don't personally see why you would index text in chunks like this rather than aggregating it all into a Reader or String, so certainly this is an uncommon usage pattern.
Erik
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
