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

Varun Thacker updated SOLR-8089:
--------------------------------
    Attachment: SOLR-8089.patch

Patch with a test case of EDismax . The tests are failing for queries with 
enablePositionIncrements=false

For the following two failing queries here is how the positions are getting put

q="the sky is blue"
sky at pos=0
blue at pos=1

q="sky blue"
sky at pos=0
blue at pos=1

The relevant code from QueryBuilder#analyzePhrase

{code}
while (stream.incrementToken()) {
      if (enablePositionIncrements) {
        position += posIncrAtt.getPositionIncrement();
      } else {
        position += 1;
      }
      builder.add(new Term(field, termAtt.getBytesRef()), position);
    }
{code}

So I can see why they are not matching the document. 

What am I missing here ? 

> Support query parsers being able to set enablePositionIncrements
> ----------------------------------------------------------------
>
>                 Key: SOLR-8089
>                 URL: https://issues.apache.org/jira/browse/SOLR-8089
>             Project: Solr
>          Issue Type: Bug
>            Reporter: Varun Thacker
>         Attachments: SOLR-8089.patch
>
>
> In 5.0 LUCENE-4963 disallowed setting enablePositionIncrements=false on any 
> token filter. The idea being no filter should change the token stream in a 
> way that could mess up preceding or following analysis components
> So if a user wants to be able to have PhraseQueries that match across 
> stopwords they cannot unless the parser is configured to not take position 
> increments into account when generating phrase queries .
> This is documented in the "Token Position Increments" section here : 
> https://lucene.apache.org/core/5_3_0/core/org/apache/lucene/analysis/package-summary.html



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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

Reply via email to