Fuzzy search result ranking [LUCENE-2256]
- Dominant language
- Java
- Stars
- 3.6k
- Forks
- 1.4k
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 88
Description
When a search term is expanded into a set of alternatives (using Fuzzy, Range, Prefix or Wildcard queries), the user really wants documents that have any one of the alternatives (ideally the exact one typed). She is not asking for the document that contains the maximum number of different alternatives, but that is how the scoring works.
The problem is that the SHOULD directive doesn't implement an OR between alternatives but an AND/OR.
frederick\~ alderwood\~ expands to something like:
(frederick frederich^0.9 fredereck^0.9) (alderwood elderwood^0.9 underwood^0.8)
A document containing frederick, frederich and fredereck would score more highly than one with the exact search terms, frederick and alderwood, yet it only satisfies one of the user's two query terms.
The problem is not the same as issue 329 but is caused by the scores for all of the expanded terms being summed. What is required is the maximum score for any of the alternatives for each term, summed across all terms.
---
Migrated from [LUCENE-2256](https://issues.apache.org/jira/browse/LUCENE-2256) by Mike Cawson
Environment:
```
all
```
Contributor guide
Research direction
Start by reproducing the frederick~ alderwood~ example and inspect how Fuzzy, Range, Prefix, and Wildcard queries score expanded alternatives. Compare documents matching multiple alternatives with documents matching the exact terms. Done means the best alternative score is used for each query term, with those per-term scores summed across the terms.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- search
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100