Rethink Fields.size() returning -1 [LUCENE-4319]
- Dominant language
- Java
- Stars
- 3.6k
- Forks
- 1.4k
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 88
Description
Fields.size() is allowed to return -1, if size of iterator is unknown. But for all codecs, we know this size and also Fields implements Iterable (see also discussion on LUCENE-4315).
We should think about enfocing it to be defined.
Some things to do:
- Maybe automatically make Fields.size() base class iterate, if not reimplemented (risky!).
- MultiFields.size() must implement it
---
Migrated from [LUCENE-4319](https://issues.apache.org/jira/browse/LUCENE-4319) by Uwe Schindler (@uschindler)
Linked issues:
- #5383
Contributor guide
Research direction
Start by reading the Fields and MultiFields APIs, then review the discussion on LUCENE-4315 and the linked issue #5383. Determine whether Fields.size() should be enforced or computed by a base implementation, and ensure MultiFields.size() follows the decided behavior across codecs.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- search
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100