apache / apache/lucene

expose position information in SegmentReader, add method getPosition(term) [LUCENE-2543]

Open
#3,617 4 comments 0 reactions 0 assignees View on GitHub
affects-version:3.0.2 legacy-jira-fix-version:4.9 legacy-jira-fix-version:6.0 legacy-jira-priority:Major module:core/search type:enhancement
Dominant language
Java
Stars
3.6k
Forks
1.4k
Avg merge
2d 11h
Merged PRs (30d)
88

Description

add public long getPosition(Term) to SegmentReader.
Also, update the impl of getPosition in TermInfosReader (called by new method) to use enumerator.scanTo() to avoid creating many intermediate Term objects.

---
Migrated from [LUCENE-2543](https://issues.apache.org/jira/browse/LUCENE-2543) by Woody Anderson, updated May 09 2016
Attachments: [LUCENE-2543.patch](https://apache.github.io/lucene-jira-archive/attachments/LUCENE-2543/LUCENE-2543.patch)

Contributor guide

Open the contributing guide

Research direction

Start by reading SegmentReader and the existing getPosition implementation in TermInfosReader, then trace how its enumerator currently locates terms. Done means exposing public long getPosition(Term) on SegmentReader and updating TermInfosReader to use enumerator.scanTo() without creating many intermediate Term objects.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
search
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.