You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Christopher Condit <co...@sdsc.edu> on 2011/02/15 01:54:23 UTC

Phrase query with boolean matches

I'm trying to use the QueryParser in 3.0.2 to make "foo and bar" (with
the quotes) return documents with the exact phrase "foo and bar". When I
run it through the QueryParser (with a StandardAnalyzer) I end up with
"foo ? bar", which doesn't match the documents in the index. I know that
"and" is a stop word, but I'm curious why it's translated into ? instead
of a * during this parsing (or just left along because it's a phrase
query)...
Can I escape boolean keywords somehow?

Here's a runnable example: http://www.pastie.org/1564773

Thanks,
-Chris

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org