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

Alessandro Benedetti edited comment on SOLR-7759 at 1/27/17 4:28 PM:
---------------------------------------------------------------------

After a bit of investigations ( and a manual run) , I ended up with this little 
modifications :
*1) First we send the global stats :*
org/apache/solr/handler/component/QueryComponent.java:1295
...
StatsCache statsCache = rb.req.getCore().getStatsCache();
statsCache.sendGlobalStats(rb, sreq);
sreq.purpose = ShardRequest.PURPOSE_GET_FIELDS;
rb.addRequest(this, sreq);

*2) processing the request, we collect the Global Stats and we use them for 
debugging*

org/apache/solr/handler/component/QueryComponent.java:318
...
if ((purpose & ShardRequest.PURPOSE_SET_TERM_STATS) != 0 || (purpose & 
ShardRequest.PURPOSE_GET_DEBUG) != 0) {
      // retrieve from request and update local cache
      statsCache.receiveGlobalStats(req);
    }
    req.getContext().put(SolrIndexSearcher.STATS_SOURCE, statsCache.get(req));

Does this make sense ?
If you agree I can take a look to the tests ( if is covered) and then 
contribute the patch !


was (Author: alessandro.benedetti):
After a bit of investigations ( and a manual run) , I ended up with this little 
modifications :
1) First we send the global stats :
org/apache/solr/handler/component/QueryComponent.java:1295
...
StatsCache statsCache = rb.req.getCore().getStatsCache();
statsCache.sendGlobalStats(rb, sreq);
sreq.purpose = ShardRequest.PURPOSE_GET_FIELDS;
rb.addRequest(this, sreq);

2) processing the request, we collect the Global Stats and we use them for 
debugging

org/apache/solr/handler/component/QueryComponent.java:318
...
if ((purpose & ShardRequest.PURPOSE_SET_TERM_STATS) != 0 || (purpose & 
ShardRequest.PURPOSE_GET_DEBUG) != 0) {
      // retrieve from request and update local cache
      statsCache.receiveGlobalStats(req);
    }
    req.getContext().put(SolrIndexSearcher.STATS_SOURCE, statsCache.get(req));

Does this make sense ?
If you agree I can take a look to the tests ( if is covered) and then 
contribute the patch !

> DebugComponent's explain should be implemented as a distributed query
> ---------------------------------------------------------------------
>
>                 Key: SOLR-7759
>                 URL: https://issues.apache.org/jira/browse/SOLR-7759
>             Project: Solr
>          Issue Type: Bug
>            Reporter: Varun Thacker
>
> Currently when we use debugQuery to see the explanation of the matched 
> documents, the query fired to get the statistics for the matched documents is 
> not a distributed query.
> This is a problem when using distributed idf. The actual documents are being 
> scored using the global stats and not per shard stats , but the explain will 
> show us the score by taking into account the stats from the shard where the 
> document belongs to.
> We should try to implement the explain query as a distributed request so that 
> the scores match the actual document scores.



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

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

Reply via email to