Ivan Saric created SOLR-18677:
---------------------------------

             Summary: IGainTermsQParserPlugin adds a null duplicate docFreq 
entry for every featured term
                 Key: SOLR-18677
                 URL: https://issues.apache.org/jira/browse/SOLR-18677
             Project: Solr
          Issue Type: Bug
          Components: search
            Reporter: Ivan Saric


{{IGainTermsQParserPlugin}} builds the {{docFreq}} section in two passes: it 
first adds every term's document frequency to {{topFreq}}, then, for each 
featured term, adds {{allFreq.get(term)}} under the same key. {{allFreq}} is 
created but never populated, so every featured term gets a second entry with a 
{{null}} value.

Since {{docFreq}} is a {{NamedList}}, the default {{json.nl=flat}} rendering 
shows both entries; with {{json.nl=map}} or any last-wins JSON parser the 
featured term's frequency reads as {{null}}. Found while reviewing SOLR-18612 
(PR #5365), where {{docFreq}} is deliberately left as a {{NamedList}} because 
of this.

Fix: drop the second pass (the first pass already recorded the frequency of 
every term, featured ones included) and remove the unused {{allFreq}}, with a 
JSON test that checks a featured term's {{docFreq}} value. {{{!igain}}} has no 
functional test in solr/core today; it is exercised through the streaming 
{{features}} expression.



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to