In our project I save search strings, generated with query.toString in the database and I reconstruct the Query at runtime.
I would appreciate if the new QueryParser will pass the following assert:
Query query = QueryParser.parse(queryString, analyzer); Query query2 = QueryParser.parse(query.toString(), analyzer); assertEquals(query.toString(), query2.toString());
I think this might be a usefull test case ....
I agree that this is a nice ideal, but it is unrealistic in the general sense. A custom analyzer could easily break this. I suspect there are other cases where this would break even with a plain SimpleAnalyzer.
Ok.
The question how to handle BooleanQueries, that contain prohibited terms
only, is a question on it's own.
In my fix I choose to silently drop these queries. Basically because it's
effectivly dropped during querying anyway.
Silently drop as in you removed them entirely from the resultant Query?
That'd be easy enough to add - but is that what we want to happen? Community, thoughts?
In my oppinion is better to throw a RuntimeException, something like ...
throw new ParseException("The query must contain at least one allowed term. Full prohibited term queries are not allowed");
Ok, I think this could be done.
Erik
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]