all postings enums must explicitly declare what they need up-front. [LUCENE-2929]
- Dominant language
- Java
- Stars
- 3.6k
- Forks
- 1.4k
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 88
Description
Currently, the DocsEnum api assumes you **might** consumes freqs at any time.
Additionally the DocsAndPositionsEnum api assumes you **might** consume a payload at any time.
High level things such as queries know what kinds of data they need from the index up-front,
and the current APIs are limiting to codecs (other than Standard, which has these intertwined).
So, we either need DocsAndFreqsEnum, DocsPositionsAndPayloadsEnum, or at least booleans
in the methods that create these to specify whether you want freqs or payloads.
we did this for freqs in the bulkpostings API, which is good, but these DocsEnum apis
are also new in 4.0 and there's no reason to introduce non-performant APIs.
additionally when/if we add payloads to the bulkpostings API, we should make sure we keep
the same trend and require you to specify you want payloads or not up-front.
---
Migrated from [LUCENE-2929](https://issues.apache.org/jira/browse/LUCENE-2929) by Robert Muir (@rmuir), updated May 09 2016
Attachments: [LUCENE-2929.patch](https://apache.github.io/lucene-jira-archive/attachments/LUCENE-2929/LUCENE-2929.patch) (versions: 3)
Linked issues:
- #5302
Contributor guide
Research direction
Start by reading the LUCENE-2929.patch attachment and linked issue #5302, then inspect the DocsEnum, DocsAndPositionsEnum, and bulkpostings APIs discussed here. Compare how freqs and payloads are requested today; done means the postings APIs declare those needs up front without retaining the current limitation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- search
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100