lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Simon Willnauer (JIRA)" <>
Subject [jira] [Commented] (LUCENE-3041) Support Query Visting / Walking
Date Tue, 26 Apr 2011 15:39:03 GMT


Simon Willnauer commented on LUCENE-3041:

I don't quite follow you. Currently DispatchingQueryProcessor caches InvocationDispatchers
by concrete impl type. So we only create a new InvocationDispatcher when we have a new implementation
(which means InvocationDispatchers are shared between segments, searches, everything). In
that regard DispatchingQueryProcessor#dispatcherByClass should be a ConcurrentHashMap. But
otherwise, I think we're okay?

my bad.. I didn't look close enough :) Yet, I was proposing something like what you did though
:) the problem here could be that it is static but for now ConcurrentHashMap would do.

bq.Any thoughts on how to avoid that?

hmm, I think we should try to dispatch first. If there is not specialized method to dispatch
we should rewrite and continue.

I still wonder how this would walk down the query tree so I am happily waiting for the next

> Support Query Visting / Walking
> -------------------------------
>                 Key: LUCENE-3041
>                 URL:
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: Search
>            Reporter: Chris Male
>            Priority: Minor
>         Attachments: 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:

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

View raw message