[ 
https://issues.apache.org/jira/browse/SOLR-12532?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Brad Sumersford updated SOLR-12532:
-----------------------------------
    Description: 
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.
h4. Conditions
 - Slop provided in query string (ex: ~2")
 - WordDelimiterGraphFilterFactory with query time preserveOriginal and 
generateWordParts
 - query string includes a term that contains a word delimiter

h4. Example

Field: wdf_partspreserve 
 – WordDelimiterGraphFilterFactory 
 ---- preserveOriginal="1"
 ---- generateWordParts="1"

Data: you just can't
 Search: wdf_partspreserve:"you can't"~2 -> 0 Results
h4. Cause

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.

  was:
Note: This only impacts specific settings for the 
WordDelimiterGraphFilterFactory 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.

h4. Conditions

- Slop provided in query string (ex: ~2")
- WordDelimiterGraphFilterFactory with query time preserveOriginal and 
generateWordParts
- query string includes a term that contains a word delimiter 

h4. Example

Field: wdf_partspreserve 
--  WordDelimiterGraphFilterFactory 
---- preserveOriginal="1"
---- generateWordParts="1"  

Data: you just can't
Search: wdf_partspreserve:"you can't"~2 -> 0 Results

h4. Cause

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.


> Slop specified in query string is not preserved for certain phrase searches
> ---------------------------------------------------------------------------
>
>                 Key: SOLR-12532
>                 URL: https://issues.apache.org/jira/browse/SOLR-12532
>             Project: Solr
>          Issue Type: Bug
>      Security Level: Public(Default Security Level. Issues are Public) 
>          Components: query parsers
>    Affects Versions: 7.4
>            Reporter: Brad Sumersford
>            Priority: Major
>         Attachments: SOLR-12532.patch
>
>
> 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.
> h4. Conditions
>  - Slop provided in query string (ex: ~2")
>  - WordDelimiterGraphFilterFactory with query time preserveOriginal and 
> generateWordParts
>  - query string includes a term that contains a word delimiter
> h4. Example
> Field: wdf_partspreserve 
>  – WordDelimiterGraphFilterFactory 
>  ---- preserveOriginal="1"
>  ---- generateWordParts="1"
> Data: you just can't
>  Search: wdf_partspreserve:"you can't"~2 -> 0 Results
> h4. Cause
> 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.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to