apache / apache/lucene

don't allow Analyzer.offsetGap/posIncGap to be negative [LUCENE-4141]

Open
#5,213 1 comment 0 reactions 0 assignees View on GitHub
affects-version:4.0-ALPHA legacy-jira-priority:Major type:bug
Dominant language
Java
Stars
3.6k
Forks
1.4k
Avg merge
2d 11h
Merged PRs (30d)
88

Description

unrelated but i thought about this looking at #5211: we should check this doesnt make a corrupt index but instead that IW throws a reasonable exception.

---
Migrated from [LUCENE-4141](https://issues.apache.org/jira/browse/LUCENE-4141) by Robert Muir (@rmuir), updated Jun 13 2012
Attachments: [LUCENE-4141_test.patch](https://apache.github.io/lucene-jira-archive/attachments/LUCENE-4141/LUCENE-4141_test.patch)

Contributor guide

Open the contributing guide

Research direction

Open the attached LUCENE-4141_test.patch and trace Analyzer.offsetGap and posIncGap into IW. Confirm that negative values are rejected with a reasonable exception rather than producing a corrupt index, then run the affected test coverage.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
search
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 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.