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

Robert Muir commented on LUCENE-4728:
-------------------------------------

{quote}
the reason why I didn't do that is that this query simply stops flattening if 
it doesn't know the query so if we turn this around we need to make sure that 
we don't end up in an endless loop rewriting all the time.
{quote}

I don't see the problem, we only need to rewrite it until it 'stops', just like 
indexsearcher does:
{noformat}
    Query query = original;
    for (Query rewrittenQuery = query.rewrite(reader); rewrittenQuery != query;
         rewrittenQuery = query.rewrite(reader)) {
      query = rewrittenQuery;
    }
{noformat}

{quote}
I don't think this is a bottle neck of any sort 
{quote}

I do think its a bottleneck, in that if we only did this simple thing, then 
highlighters wouldnt have to have hard dependencies on every concrete query we 
add. They would also work with custom queries that users make that rewrite to 
graphs of core queries (this one is a perfect example!)

There isn't a need for the highlighting module to depend on the queries module 
when it can do this with the abstract API already in core.
                
> Allow CommonTermsQuery to be highlighted
> ----------------------------------------
>
>                 Key: LUCENE-4728
>                 URL: https://issues.apache.org/jira/browse/LUCENE-4728
>             Project: Lucene - Core
>          Issue Type: Improvement
>          Components: modules/highlighter
>    Affects Versions: 4.1
>            Reporter: Simon Willnauer
>            Assignee: Simon Willnauer
>             Fix For: 4.2, 5.0
>
>         Attachments: LUCENE-4728.patch
>
>
> Add support for CommonTermsQuery to all highlighter impls. 
> This might add a dependency (query-jar) to the highlighter so we might think 
> about adding it to core?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
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]

Reply via email to