lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Hostetter <hossman_luc...@fucit.org>
Subject RE: query parsing
Date Thu, 23 Mar 2006 23:14:07 GMT
: Any suggestions on what to do then, as the following query exhibits the same behavior
:
: (+cat) (-dog)
:
: Due to the implied AND. Removing the parenthesis allows it to work. It
: doesn't seem that adding parenthesis in this case should cause the query
: to fail???

Adding parens causes QueryParserto make a BooleanQuery.

: Doesn't it suggest that there is a bug in the BooleanQuery scorer is not
: handling the case of a REQUIRED clause that is a BooleanQuery, that
: consists of a single prohibited boolean clause?

not a bug really ... that's just the way it workse.  a query must
positively select something -- it can't be purely negative, the least of
the reasons for this being that without something positive about the
query there is not way to determine the score.

One thing you can do is write a subclass of QueryParser that can proxy to
it's superclass for the hard work, but if it sees that the there is a
boolean query with only prohibited clauses, it can add a MatchAllDocs
query to make it usable.



-Hoss


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


Mime
View raw message