Classic query parser should allow autoGeneratePhraseQueries=true when splitOnWhitespace=false [LUCENE-7799]
- Dominant language
- Java
- Stars
- 3.6k
- Forks
- 1.4k
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 88
Description
#8584 disabled the option combination `splitOnWhitespace=false`/`autoGeneratePhraseQueries=true` because of how `autoGeneratePhraseQueries=true` is handled: a query chunk is treated as if it were literally quoted. When `splitOnWhitespace=false`, a query chunk can be multiple whitespace-separated words, and auto-quoting multiple terms will produce inappropriate phrase queries.
I have an idea about how to fix this: `autoGeneratePhraseQueries=true` is supposed to cause phrase queries to be constructed when multiple analyzed terms result from a single query word, e.g. when WordDelimiter(Graph)Filter splits words up. Maybe this could be re-implemented in terms of offsets, since all terms from the same original term share the same offsets.
---
Migrated from [LUCENE-7799](https://issues.apache.org/jira/browse/LUCENE-7799) by Steven Rowe (@sarowe), 1 vote, updated Apr 24 2017
Contributor guide
Research direction
Start by locating the Classic query parser handling of splitOnWhitespace and autoGeneratePhraseQueries, then review the change from #8584 and the offset behavior described here. Determine how terms from one original query word should form phrase queries without treating multiple whitespace-separated words as a phrase. Done means the option combination works correctly and existing parser behavior remains intact.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- backend, search
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100