> Things are a little more complicated than you describe, but basically this
> is not a bad approach. For the query "+A B" where "A" is a stop word, the
> parser would effectively do something like:
>
> BooleanQuery query = new BooleanQuery();
> query.add(analyze("A"), true, false);
> query.add(analyze("B"), false, false);
>
> The analyze(String) method would run the string through the analyzer and
> turn it into a TermQuery or a PhraseQuery, depending on how many terms came
> out.
>
> But if the term disappears (as is the case for stop words) then what should
> analyze(String) do? Maybe it can throw an exception, which the parser can
> handle, so that the above pseudo code turns into:
analyze() could return null there, and have query.add() check for null,
and not add anything. Or analyze() could return some sort of NullQuery
object, which query.add would know to ignure.
Or you could give up on doing it inline, and say
Query q = analyze(something);
if (q != null) query.add(q, ...)
> That looks feasable. Anyone want to take on re-writing the query parser?
I'll take a stab.
_______________________________________________
Lucene-dev mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/lucene-dev