[
https://issues.apache.org/jira/browse/LUCENE-3041?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Chris Male updated LUCENE-3041:
-------------------------------
Attachment: LUCENE-3041.patch
A much larger patch that implements full query AST walking.
The problem with having the QueryProcessor fully external to Query#rewrite, is
that composite Querys would need to expose their children. This is a little
messy and could be hard with more exotic user-made Querys.
So this patch basically expands Query#rewrite to include the QueryProcessor.
Composite queries can then pass their children to the processor during their
rewrite.
For backwards compat, and simplicity, I've created a SimpleQueryProcessor which
directly calls rewrite. This means casual users do not need to concern
themselves with processing.
Overtime we can expose the QueryProcessor API through IndexSearcher and other
situations.
> Support Query Visting / Walking
> -------------------------------
>
> Key: LUCENE-3041
> URL: https://issues.apache.org/jira/browse/LUCENE-3041
> Project: Lucene - Java
> Issue Type: Improvement
> Components: Search
> Reporter: Chris Male
> Priority: Minor
> Attachments: LUCENE-3041.patch, LUCENE-3041.patch, LUCENE-3041.patch
>
>
> Out of the discussion in LUCENE-2868, it could be useful to add a generic
> Query Visitor / Walker that could be used for more advanced rewriting,
> optimizations or anything that requires state to be stored as each Query is
> visited.
> We could keep the interface very simple:
> {code}
> public interface QueryVisitor {
> Query visit(Query query);
> }
> {code}
> and then use a reflection based visitor like Earwin suggested, which would
> allow implementators to provide visit methods for just Querys that they are
> interested in.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]