[ 
https://issues.apache.org/jira/browse/SOLR-7756?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Varun Thacker updated SOLR-7756:
--------------------------------
    Attachment: SOLR-7756.patch

Updated patch:

bq. What makes you change the following code to be executed for every term, 
accidental?

Reverted this change.

In {{ExactStatsCache#mergeToGlobalStats}} we insert the terms n times ( n 
number of shards ). Now when a shard doesn't have a term  {{List<Object> terms 
= nl.getAll(TERMS_KEY)}} will return empty and not null since 
{{NamedList#getAll}} works like that. Thus depending on the order in which the 
shards get hit, if the last shard had no terms the {{terms}} key was 
overwritten with blank causing distributed idf to not get calculated correctly. 
Fixed this in the patch by changing the condition appropriately.

Minor refactoring

All tests pass now.

> NPE in ExactStatsCache when a term doesn't exist on a shard
> -----------------------------------------------------------
>
>                 Key: SOLR-7756
>                 URL: https://issues.apache.org/jira/browse/SOLR-7756
>             Project: Solr
>          Issue Type: Bug
>            Reporter: Varun Thacker
>             Fix For: 5.3
>
>         Attachments: SOLR-7756.patch, SOLR-7756.patch, SOLR-7756.patch
>
>
> If a term doesn't exist on a shard {{ExactStatsCache#getPerShardTermStats}} 
> throws an NullPointerException. 
> Attaching a test and a patch shortly.



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