lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rafael Almeida" <almeida...@gmail.com>
Subject Re: Fields with the same name
Date Wed, 15 Oct 2008 18:32:45 GMT
On Wed, Oct 15, 2008 at 4:22 PM, Erick Erickson <erickerickson@gmail.com> wrote:
> Yes, in terms of what you probably mean, but your first
> example would index one token "bar1bar2". But if you
> changed your first example to (note space): they would
> be entirely equivalent.
>
>   doc.add(new Field("foo",
>                             "bar1 bar2",
>                             Field.Store.YES,
>                             Field.Index.ANALYZED));
>
>
> One note: The rather technical difference between the two methods
> is that multiple calls to index the same field add PositionIncrementGap
> to the first token of calls 2-n. This defaults to 1, so it doesn't change
> anything unless you change it in your analyzer. Don't worry about it
> yet <G>...
>

So the WhiteSpaceAnalyzer, for instance, would treat bar1 and bar2 as
two different tokens, making either a search for bar1 or bar2 a hit?

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