[
https://issues.apache.org/jira/browse/SOLR-7689?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14589897#comment-14589897
]
Yonik Seeley commented on SOLR-7689:
------------------------------------
ReRankQuery looks like a normal query type to me (i.e. it can be produced by a
QParser from a user request, and can be used as a cache key, etc). This also
means that a single ReRankQuery object can be used concurrently on different
indexes (autowarming is one way this can happen).
So caching both "rewrittenQuery" and "boostedPriority" which depend on specific
requests / indexes is problematic. As a general rule, queries shouldn't change
themselves during execution.
Is there a reason we can't use the normal pattern of returning a new main query
in rewrite if any of the child queries were changed by a rewrite?
> 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, 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]