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 keywords in one field?
Date Tue, 31 May 2005 09:22:58 GMT

On May 31, 2005, at 4:06 AM, Paul Libbrecht wrote:

>
> Le 30 mai 05, à 22:13, Doug Hughes a écrit :
>
>> Ok, so more than one keyword can be stored in a keyword field.   
>> Interesting!
>>
>
> Yes, yes, yes!! You can do:
>
> doc.add("link","xx");
> doc.add("link","yy");

Well, that's not quite correct API, but your point is accurate :)

> and matches will match any of them!
> I found this in the book and not in the javadoc and I'd recommed  
> adding it in the javadoc of the add method, it's a non-obvious  
> goodness which suits all forms of scalability!

Fields are made up of terms.  A Field.Keyword makes a single term for  
a field.  Adding multiple fields with the same name works even if its  
not Field.Keyword - it simply adds the term(s) to the field.

Good point about documentation - it would be worth noting this  
explicitly.

     Erik


---------------------------------------------------------------------
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