lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Hatcher <e...@ehatchersolutions.com>
Subject Re: Indexing multiple instances of the same field for each document
Date Sat, 28 Feb 2004 03:28:10 GMT
On Feb 27, 2004, at 6:17 PM, Doug Cutting wrote:
> 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: lucene-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-user-help@jakarta.apache.org


Mime
View raw message