> Making parseQuery overridable is trickier because that method is an 
> entrypoint 
> to both QueryParser and MultiFieldQueryParser and is called directly from 
> python whereas the extension hooks (declared protected in java) such as 
> getBooleanQuery() are not called directly from python except via the 'super' 
> object passed to the python extension. It might be feasible to override 
> parseQuery but would require some naming trickery that I'd rather avoid if 
> you 
> can get the same effect somehow otherwise.
> What does your parseQuery() override actually do ?

It's basically an after-method that examines the resulting query, and
if all the boolean clauses are MUST_NOT clauses, adds a SHOULD clause.
I do this in an overridden method because I have a couple of further
subclasses of this subclass of MultiFieldQueryParser.  I could package
this code as a static method and just call it after calling parseQuery
to postprocess the query.

Thanks for the help.

Bill
_______________________________________________
pylucene-dev mailing list
[email protected]
http://lists.osafoundation.org/mailman/listinfo/pylucene-dev

Reply via email to