: No, sorry, I'm still confused. It ought to be a term queries?

: > > System.out.println(new QueryParser("f", new Analyzer() {
: > >   public TokenStream tokenStream(String string, Reader reader) {
: > >     return new NGramTokenFilter(new StandardTokenizer(reader), 2, 5);
: > >   }
: > > }).parse("hello world"));

query parser does one pass looking for operators, it sees two pieces of 
input: "hello" and "world" it hands each individually to your analyzer.  

for each word, your analyzer produces multiple tokens -- which are not at 
the same position (they have non zero positionIncrimentGap)  QueryParser 
sees the multiple tokens at consecutive positions, and constructs a phrase 
query (per word).  if there was at least one token with a 
positionIncriment of 0, it would have created a MultiPhraseQuery (per 
word), if all had 0 positionIncriments, it would have constructed a 
BooleanQuery (per word) containing TermQueries.





-Hoss


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to