[ 
https://issues.apache.org/jira/browse/LUCENE-3041?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13023526#comment-13023526
 ] 

Simon Willnauer commented on LUCENE-3041:
-----------------------------------------

I like the simple interface but the name is somewhat misleading here I think. 
Either we make this a 'real' visitor pattern and add accept methods to Query 
which I don't think is necessary or we should make the name specific for the 
task. Since this is really for walking the Query 'AST' during the rewrite 
process we should make this very clean in the IF name. QueryRewriter or 
something like that would make more sense and it would justify the Query return 
value, no?

> 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
>
> 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: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org

Reply via email to