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 <[EMAIL PROTECTED]>wrote: > On Wed, Oct 15, 2008 at 4:22 PM, Erick Erickson <[EMAIL PROTECTED]> > 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: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > >