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

Yonik Seeley edited comment on SOLR-7689 at 6/16/15 2:37 PM:
-------------------------------------------------------------

This would definitely be a bug if we actually do use a rewritten query for any 
caches.  SolrIndexSearcher certainly didn't do that in the past, but it's 
possible that a bug was introduced somewhere along the way.

Is this because some other code passes SolrIndexSearcher a rewritten query, or 
do you think there's a bug internal to SolrIndexSearcher?

edit: I reviewed SolrIndexSearcher, and nothing jumps out at me as incorrect.
We should not clone the queries in general though (in SolrIndexSearcher) - 
that's a lot of overhead and the wrong fix.  If there's a bad-egg query 
somewhere that is not effectively immutable (i.e. using it in a search can 
change it) then that's what should be fixed.



was (Author: [email protected]):
This would definitely be a bug if we actually do use a rewritten query for any 
caches.  SolrIndexSearcher certainly didn't do that in the past, but it's 
possible that a bug was introduced somewhere along the way.

Is this because some other code passes SolrIndexSearcher a rewritten query, or 
do you think there's a bug internal to SolrIndexSearcher?




> QueryResultKey saved in cache uses the query after rewrite which causes 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
>
> 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]

Reply via email to