lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Erick Erickson" <erickerick...@gmail.com>
Subject Re: Fields with the same name
Date Wed, 15 Oct 2008 19:22:30 GMT
Yes, assuming as I pointed out that your input string had
whitespace between "bar1" and "bar2" in your first example...

Erick

On Wed, Oct 15, 2008 at 2:32 PM, Rafael Almeida <almeidaraf@gmail.com>wrote:

> 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
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message