Affects Version/s: 7.4
Fix Version/s: None
Component/s: query parsers
Note: This only impacts specific settings for the WordDelimiterGraphFilter as detailed below.
When a phrase search is parsed by the SolrQueryParser, and the phrase search results in a graph token stream, the resulting SpanNearQuery created does not have the slop correctly set.
- Slop provided in query string (ex: ~2")
- WordDelimiterGraphFilterFactory with query time preserveOriginal and generateWordParts
- query string includes a term that contains a word delimiter
Data: you just can't
Search: wdf_partspreserve:"you can't"~2 -> 0 Results
The slop supplied by the query string is applied in SolrQueryParserBase#getFieldQuery which will set the slop only for PhraseQuery and MultiPhaseQuery. Since "can't" will be broken down into multiple tokens analyzeGraphPhrase will be triggered when the Query is being constructed which will return a SpanNearQuery instead of a (Multi)PhraseQuery.