lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Hostetter <>
Subject Re: too many parentheses confuse Lucene
Date Tue, 05 Dec 2006 22:42:15 GMT

: works fine. From the user's point-of-view, both queries should return the
: same result set. One solution I see is to add a MatchAllDocsQuery clause
: to all prohibited clauses in QueryParser's getBooleanQuery() method. Is
: that a valid solution? I tried with some simple cases and it seems to
: work. Any other ideas to solve or work around this issue?

if i understand your implimentation suggestion correctly, that will cause
some very unexpected results when people pass "(a -b) c" to
QueryParser.parse .... but as far as the general idea you are proposing,
i'm very leary of leting QueryParser make any asusmptions about what a
user means when they specify a query ... I've acctually got some code in
production that users QueryParser to parse query fragments fro ma config
file, which are then combined with other Queries ... if QueryParser all of
the sudden decided that...
	(-apple -orange)
...should be parsed the same as...
	(*:* -apple -orange) my code that combines the Query i get from QueryParser with other
Queryies from other parts of my code base will unexpected match all

Once upon a time the notion that QueryParser should throw an
ParseException when it detected a query that was syntacticly valid but
structurally unusable was discussed ... and ultimately rejected for the
same reason: QueryParser should make any assumptions about how the Queries
it parses are going to be used.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message