Uploaded image for project: 'Lucene - Core'
  1. Lucene - Core
  2. LUCENE-8531

QueryBuilder hard-codes inOrder=true for generated sloppy span near queries

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 7.6, 8.0
    • core/queryparser
    • None
    • New

    Description

      QueryBuilder.analyzeGraphPhrase() generates SpanNearQuery-s with passed-in phraseSlop, but hard-codes inOrder ctor param as true.

      Before multi-term synonym support and graph token streams introduced the possibility of generating SpanNearQuery-s, QueryBuilder generated (Multi)PhraseQuery-s, which always interpret slop as allowing reordering edits.  Solr's eDismax query parser generates phrase queries when its pf/pf2/pf3 params are specified, and when multi-term synonyms are used with a graph-aware synonym filter, SpanNearQuery-s are generated that require clauses to be in order; unlike with (Multi)PhraseQuery-s, reordering edits are not allowed, so this is a kind of regression.  See SOLR-12243 for edismax pf/pf2/pf3 context.  (Note that the patch on SOLR-12243 also addresses another problem that blocks eDismax from generating queries at all under the above-described circumstances.)

      I propose adding a new analyzeGraphPhrase() method that allows configuration of inOrder, which would allow eDismax to specify inOrder=false.  The existing analyzeGraphPhrase() method would remain with its hard-coded inOrder=true, so existing client behavior would remain unchanged.

      Attachments

        1. LUCENE-8531.patch
          4 kB
          Jim Ferenczi

        Issue Links

          Activity

            People

              sarowe Steven Rowe
              sarowe Steven Rowe
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: