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

[jira] [Comment Edited] (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=14589107#comment-14589107 ] 

Emad Nashed edited comment on SOLR-7689 at 6/17/15 12:50 AM:
-------------------------------------------------------------

Thanks a lot for giving this issue your attention. The query I am trying looks basically like this (after omitting some unimportant stuff)

{noformat}
q={!dismax qf=$sqf pf=$spf v=$sq}
rq={!rerank reRankQuery=$rqq reRankDocs=1000 reRankWeight=2}
rrq=_val_:"recip(ms(NOW/DAY+1DAY,DateUpdated),3.16e-11,1.4,1)"
sq="test"
{noformat}

I tried the patch, although it fixes the caching issue, but now the Re-Ranking doesn't happen anymore. This is basically because when rewrite is called, ReRanking query will just return the inner dismax query and just hide itself from the searcher. I'll propose another patch shortly. I'd propose that rewrite method on ReRankQuery would clone itself (if the mainQuery has changed) and return the new instance. Sorry for the delay, I just live on the other side of the earth, and there is a big time difference.
Cheers
 


was (Author: enashed):
Thanks a lot for giving this issue your attention. The query I am trying looks basically like this (after omitting some unimportant stuff)
q={!dismax qf=$sqf pf=$spf v=$sq}
rq={!rerank reRankQuery=$rqq reRankDocs=1000 reRankWeight=2}
rrq=_val_:"recip(ms(NOW/DAY+1DAY,DateUpdated),3.16e-11,1.4,1)"
sq="test"

I tried the patch, although it fixes the caching issue, but now the Re-Ranking doesn't happen anymore. This is basically because when rewrite is called, ReRanking query will just return the inner dismax query and just hide itself from the searcher. I'll propose another patch shortly. I'd propose that rewrite method on ReRankQuery would clone itself (if the mainQuery has changed) and return the new instance. Sorry for the delay, I just live on the other side of the earth, and there is a big time difference.
Cheers
 

> 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
>
>
> 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