You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Yonik Seeley (JIRA)" <ji...@apache.org> on 2015/06/16 19:51:01 UTC

[jira] [Commented] (SOLR-7689) ReRankQuery rewrite method can change the QueryResultKey causing cache misses.

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

Yonik Seeley commented on SOLR-7689:
------------------------------------

Hmmm, the patch makes rewrite on ReRankQuery do nothing.
Are the internal queries rewritten at some point (some queries require that).

The normal pattern of rewrite is to rewrite your child queries and if any of them changed, create a new parent query with those child queries.

> ReRankQuery rewrite method can change the QueryResultKey causing cache misses.
> ------------------------------------------------------------------------------
>
>                 Key: SOLR-7689
>                 URL: https://issues.apache.org/jira/browse/SOLR-7689
>             Project: Solr
>          Issue Type: Bug
>          Components: search, SearchComponents - other
>            Reporter: Emad Nashed
>            Assignee: Joel Bernstein
>         Attachments: SOLR-7689.patch
>
>
> In SolrIndexSearcher class, the key used to lookup results in queryResultCache uses the original query. 
> However later in createNormalizedWeight the query gets re-written, and then saved in the queryResultCache after it's re-written. 
> This causes cache misses for the same query, and un-necessary inserts in the queryResultCache.
> I can reproduce this using a re-ranking query that is using a main query as a dismax query, the dismax Query could be re-written into a TermQuery, which makes sense, but will cause cache misses.
> I tested a quick solution by just using q.clone()  when it comes to build QueryResultKey, and it works fine, but not sure if that is the best way of doing it.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org