lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brian Hurt <bhur...@gmail.com>
Subject The logic of QueryParser
Date Mon, 13 Dec 2010 19:10:03 GMT
I just encountered an unexpected behavior in query parser.  So, if you pass
in a query that is multiple terms, like "cat hat", the query that is
returned uses an or between the two term searches, instead of an and.  That
is, the query will return all documents with the given field containing
either "cat" or "hat".  Now, I know about phrase queries, using "\"cat
hat\"", and I know about +, "+cat +hat".  So there are ways to work around
the problem- the behavior was just unintuitive for me and several others.  I
was just wondering what the logic was for defaulting to or instead of and.

I have googled the mailing list archives and didn't find anything.  But if
this has been discussed to death, please just point me to the threads in the
archive. rather than stirring up some old flame war.  Or just tell me what
to google for (the terms I've tried haven't yielded anything useful).
Thanks.

Brian

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message