apache / apache/lucene

FuzzyQuery - fuzzy terms and misspellings are ranked higher than exact matches [LUCENE-2557]

Open
#3,631 24 comments 0 reactions 0 assignees View on GitHub
affects-version:3.0.2 legacy-jira-priority:Major module:core/query/scoring type:bug
Dominant language
Java
Stars
3.6k
Forks
1.4k
Avg merge
2d 11h
Merged PRs (30d)
88

Description

The FuzzyQuery often causes misspellings to be ranked higher than the exact match, which seems to be an undesirable property generally.

For example, in an index of surnames, if I search using a FuzzyQuery for "smith", the misspellings such as "smiith", or "smiht" would appear near the top of the search results ahead of documents that match "smith".

---
Migrated from [LUCENE-2557](https://issues.apache.org/jira/browse/LUCENE-2557) by Jingkei Ly, 1 vote, updated Mar 09 2012
Attachments: [idf-scoring-test-case.patch](https://apache.github.io/lucene-jira-archive/attachments/LUCENE-2557/idf-scoring-test-case.patch), [LUCENE-2557.patch](https://apache.github.io/lucene-jira-archive/attachments/LUCENE-2557/LUCENE-2557.patch)

Contributor guide

Open the contributing guide

Research direction

Start at the FuzzyQuery entry point and review the attached idf-scoring-test-case.patch and LUCENE-2557.patch to understand the reported ranking behavior. Confirm the result with the surname example described in the issue; done means exact matches rank above fuzzy misspellings without breaking fuzzy matching.

Written by the indexing model from the issue text.

Assessment

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