lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Hatcher <>
Subject Re: Newbie Questions
Date Tue, 26 Aug 2003 19:47:16 GMT
On Tuesday, August 26, 2003, at 02:51  PM, Mark Woon wrote:
> Ah, I've been testing out something similar to the latter.  I've been 
> adding multiple values on the same key.  Won't this have the same 
> effect?  I've been assuming that if I do
> doc.add(Field.Keyword("content", "value1");
> doc.add(Field.Keyword("content", "value2");
> And did a search on the "content" field for either value, I'd get a 
> hit, and it seems to work.  This way, I figure I'd be able to 
> differentiate between values that I want tokenized and values that I 
> don't.
> Is there a difference between this and building a StringBuffer 
> containing all the values and storing that as a single field-value?

There is a big difference between using Field.Text and Field.Keyword, 
yes.  It all depends on how you want things tokenized (or not).  
Field.Keyword does not tokenize (via the Analyzer), but Field.Text does.


View raw message