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

add spanquery support for all multitermqueries

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.1, 4.0-ALPHA
    • Component/s: core/search
    • Labels:
      None
    • Lucene Fields:
      New, Patch Available

      Description

      I set fix version: 4.0, but possibly we could do this for 3.x too

      Currently, we have a special SpanRegexQuery in contrib, and issues like LUCENE-522 open for SpanFuzzyQuery.
      The SpanRegexQuery in contrib is a little messy additionally.

      For any arbitrary MultiTermQueries to work as a SpanQuery, there are only 3 requirements:

      1. The un-rewritten query must extend SpanQuery so it can be included in Span clauses
      2. The rewritten query should be SpanOrQuery instead of BooleanQuery
      3. The rewritten term clauses should be SpanTermQueries.

      Instead of having logic like this for each query, i suggest adding two rewrite methods:

      • ScoringSpanBoolean rewrite
      • TopTermsSpanBoolean rewrite

      as a start i wrote these up, and added a SpanMultiTermQueryWrapper that can be used to wrap any multitermquery this way.
      there are a few kinks, but I think the MTQ policeman can probably help get through them.

        Attachments

        1. LUCENE-2754.patch
          24 kB
          Robert Muir
        2. LUCENE-2754.patch
          15 kB
          Robert Muir

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                rcmuir Robert Muir
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: