apache / apache/lucene

Loosen up DirectSpellChecker's minPrefix requirements [LUCENE-4500]

Open
#5,566 3 comments 0 reactions 0 assignees View on GitHub
affects-version:4.0 legacy-jira-priority:Minor type:enhancement
Dominant language
Java
Stars
3.6k
Forks
1.4k
Avg merge
2d 11h
Merged PRs (30d)
88

Description

DirectSpellChecker currently mandates a minPrefix of 1 when editDistance=2. This prohibits a query of "nusglasses" from matching the indexed "sunglasses" term.

Granted, there can be performance issues with using a minPrefix of 0, but it's a risk that a user should be allowed to take if needed.

---
Migrated from [LUCENE-4500](https://issues.apache.org/jira/browse/LUCENE-4500) by Erik Hatcher (@erikhatcher), updated Feb 28 2019

Contributor guide

Open the contributing guide

Research direction

Start by reading DirectSpellChecker and tracing how minPrefix is validated when editDistance is 2. Reproduce the "nusglasses" query against the indexed "sunglasses" term, then verify that minPrefix 0 is accepted while the existing matching behavior and performance safeguards remain intact.

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
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.