apache / apache/lucene

Setting position and offset gaps in IndexableField [LUCENE-5073]

Open
#6,137 0 comments 0 reactions 0 assignees View on GitHub
legacy-jira-priority:Trivial type:enhancement
Dominant language
Java
Stars
3.6k
Forks
1.4k
Avg merge
2d 11h
Merged PRs (30d)
88

Description

I often find it to be quite the hassle to go via Analyzer in order to add offset/position gaps when adding data the the same field name.

This patch introduce IndexableField#positionIncrementGap and #offsetGap, which at index time is added to the value gathered from the correlating Analyzer#methods.

No tests in here, yet, but first a question: am I missing something important in the design of Lucene here? Why is this not already a feature?

---
Migrated from [LUCENE-5073](https://issues.apache.org/jira/browse/LUCENE-5073) by Karl Wettin
Attachments: [LUCENE-5073.patch](https://apache.github.io/lucene-jira-archive/attachments/LUCENE-5073/LUCENE-5073.patch)

Contributor guide

Open the contributing guide

Research direction

Start with the IndexableField and Analyzer APIs referenced in the issue, then review the attached LUCENE-5073.patch. Resolve whether field-level positionIncrementGap and offsetGap fit Lucene's indexing design; done means the design is agreed and the resulting behavior has regression tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
search
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.