[
https://issues.apache.org/jira/browse/SOLR-6541?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14148145#comment-14148145
]
Tomás Fernández Löbbe commented on SOLR-6541:
---------------------------------------------
bq. Looking at the comments in SOLR-6452, this seems to have been very
deliberate...
"facetMissingNum" is called for every doc with a missing value. The original
patch was doing:
{code}
Map<String, Integer> missingStats;
...
int termOrd = topLevelSortedValues.getOrd(docID)
String term = topLevelSortedValues.lookupOrd(termOrd).utf8ToString()
missingStat.put(term, theMissingValue)
{code}
The optimization was: Make the map ordinal->count instead of termString->count,
and do the "lookupOrd" only once per term (with missing>0) in
{{accumulateMissing()}}
We can remove the map. I'll take a look
> Enhancement for SOLR-6452 StatsComponent "missing" stat won't work with
> docValues=true and indexed=false
> --------------------------------------------------------------------------------------------------------
>
> Key: SOLR-6541
> URL: https://issues.apache.org/jira/browse/SOLR-6541
> Project: Solr
> Issue Type: Improvement
> Affects Versions: 4.10, Trunk
> Reporter: Vitaliy Zhovtyuk
> Priority: Minor
> Fix For: 5.0, Trunk
>
> Attachments: SOLR-6541.patch
>
>
> This issue is refactoring of solution provided in SOLR-6452 StatsComponent
> "missing" stat won't work with docValues=true and indexed=false.
> I think the following points need to be addressed:
> 1. Accumulate methods should not return stats specific numbers (it is
> generic). Attached solution with container class. Also made them private
> scoped.
> Returning just missing fields from accumulate methods does not allow you to
> extend it with additional counts field, therefore i propose to leave void.
> 2. Reduced visibility of fields in FieldFacetStats.
> 3. Methods FieldFacetStats#accumulateMissing and
> FieldFacetStats#accumulateTermNum does not throw any IO exception
> 4. We don't need intermediate maps to accumulate missing counts. Method
> org.apache.solr.handler.component.FieldFacetStats#facetMissingNum
> can be changed to work directly on StatsValues structure and removed
> org.apache.solr.handler.component.FieldFacetStats#accumulateMissing.
> We don't need to have it in 2 phases.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]