[
https://issues.apache.org/jira/browse/SOLR-7689?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14589548#comment-14589548
]
Joel Bernstein commented on SOLR-7689:
--------------------------------------
The test cases are showing that the rerank is occurring with this patch.
The SolrIndexSearcher never calls rewrite on the query. So it sees the query as
the RankQuery wrapper, and will use the ReRankCollector. The search method
inside of the parent Lucene IndexSearcher calls rewrite on the RankQuery which
return the mainQuery. the IndexSearch.rewrite() will then call rewrite on the
mainQuery. There is a loop logic in the IndexSearcher.rewrite() method that
loops over the query until all the rewrites have completed.
If you can provide a failing test case for your example I'll take a look at it.
> 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: 7689.patch, SOLR-7689.patch, 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: [email protected]
For additional commands, e-mail: [email protected]