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

Add QueryBuilder support for explicitly building SpanNearQuery and/or inOrder=true

    Details

    • Type: New Feature
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: core/queryparser
    • Labels:
      None
    • Lucene Fields:
      New

      Description

      QueryBuilder has historically built phrases according to the semantics of (Multi)PhraseQuery (which incorporates the concept of order, but allows for negative offsets in calculating slop/edit distance).

      LUCENE-8531 corrected a bug that substituted SpanNearQuery (inOrder=true) implementation for graph phrase queries despite the fact thatĀ for slop > 0 the semantics of SpanNearQuery (inOrder=[true|false]) differ from the semantics of (Multi)PhraseQuery.

      Inspired by (but not related to) LUCENE-8531, this issue considers the likelihood that there are some common use cases for which SpanNearQuery semantics may be preferable to the semantics of PhraseQuery. The distinction between the two is clearer for the inOrder=true case of SpanNearQuery, which disallows negative offsets in calculating slop/edit distance.

      The logic for building SpanNearQuery is already present in QueryBuilder; perhaps QueryBuilder could expose that logic so that it can be leveraged in cases that explicitly desire SpanNearQuery (and associated semantics).

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              mgibney Michael Gibney
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated: