Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.4, 2.9
    • Fix Version/s: 2.4, 2.9
    • Component/s: core/search
    • Labels:
      None
    • Lucene Fields:
      New

      Description

      PhraseQuery.toString() is overly simplistic, in that it doesn't correctly show phrases with gaps or overlapping terms. This may be misleading when presenting phrase queries built using complex analyzers and filters.

      1. phraseQuery.patch
        3 kB
        Andrzej Bialecki

        Activity

        Hide
        Andrzej Bialecki added a comment -

        This patch improves toString(), and adds a unit test.

        Gaps are represented as "?" and overlapping terms are separated by a vertial bar sign. Example:

        • Query string:
          "hi this is a test"
        • Parsed using StopFilter:
          "hi ? ? ? test"
        • Added term "hello" at position 1:
          "hi hello ? ? test"
        • Added term "hello" at position 0:
          "hi|hello ? ? ? test"
        Show
        Andrzej Bialecki added a comment - This patch improves toString(), and adds a unit test. Gaps are represented as "?" and overlapping terms are separated by a vertial bar sign. Example: Query string: "hi this is a test" Parsed using StopFilter: "hi ? ? ? test" Added term "hello" at position 1: "hi hello ? ? test" Added term "hello" at position 0: "hi|hello ? ? ? test"
        Hide
        Michael McCandless added a comment -

        I think this is a good improvement and the patch is minor. I plan to commit to 2.4 & 2.9. Thanks Andrzej!

        Show
        Michael McCandless added a comment - I think this is a good improvement and the patch is minor. I plan to commit to 2.4 & 2.9. Thanks Andrzej!
        Hide
        Michael McCandless added a comment -

        Committed revision 697469 (trunk) and 697470 (2.4). Thanks Andrzej!

        Show
        Michael McCandless added a comment - Committed revision 697469 (trunk) and 697470 (2.4). Thanks Andrzej!

          People

          • Assignee:
            Michael McCandless
            Reporter:
            Andrzej Bialecki
          • Votes:
            1 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development