apache / apache/lucene

TaxonomyFacetSumIntAssociations overflows, unpredicted results [LUCENE-5533]

Open
#6,596 4 comments 0 reactions 0 assignees View on GitHub
affects-version:4.7 legacy-jira-priority:Major module:facet type:bug
Dominant language
Java
Stars
3.6k
Forks
1.4k
Avg merge
2d 11h
Merged PRs (30d)
88

Description

`TaxonomyFacetSumIntAssociations` extends `IntTaxonomyFacets` which uses a `int[]` to store values. If you sum a lot of integers in the IntAssociatoins, the `int` will overflow.

The easiest fix seems to change the `value[]` to `long`?

---
Migrated from [LUCENE-5533](https://issues.apache.org/jira/browse/LUCENE-5533) by Rob Audenaerde

Contributor guide

Open the contributing guide

Research direction

Start with TaxonomyFacetSumIntAssociations and its IntTaxonomyFacets superclass to trace how association sums are stored and accumulated. Confirm the overflow case and identify the affected behavior and tests; done means large integer association sums produce correct results without overflow.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
search
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.