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

Failed to match when create PhraseQuery with terms analyzed from long query text

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Not A Bug
    • Affects Version/s: 8.4
    • Fix Version/s: None
    • Component/s: core/search
    • Labels:
      None
    • Lucene Fields:
      New

      Description

      When i use a long text (which is euqual to doc's StringField at indexing time) to build a PhraseQuery, i cannot match the document. But BooleanQuery with MUST/AND mode successes.

       

      long query text is a address string: "申长路988弄虹桥万科中心地下停车场LG2层2179-2184车位(锡虹路入,LG1层开到底下LG2)"

      test case is attached.

      logs:

       

      15:46:11.940 [main] INFO test.LongTextFieldSearchTest - indexed terms: 开, 层, 心, 弄, 万, 停车场, 地下, 科, 虹桥, 底下, 锡, 入, 2184, 中, 路, 到, 1, 2, 申, 2179, 车位, 988, 虹, lg, 长
      15:46:11.956 [main] INFO test.LongTextFieldSearchTest - terms: 申, 长, 路, 988, 弄, 虹桥, 万, 科, 中, 心, 地下, 停车场, lg, 2, 层, 2179, 2184, 车位, 锡, 虹, 路, 入, lg, 1, 层, 开, 到, 底下, lg, 2
      15:46:11.962 [main] INFO test.LongTextFieldSearchTest - query: +(+address:申 +address:长 +address:路 +address:988 +address:弄 +address:虹桥 +address:万 +address:科 +address:中 +address:心 +address:地下 +address:停车场 +address:lg +address:2 +address:层 +address:2179 +address:2184 +address:车位 +address:锡 +address:虹 +address:路 +address:入 +address:lg +address:1 +address:层 +address:开 +address:到 +address:底下 +address:lg +address:2)
      15:46:11.988 [main] INFO test.LongTextFieldSearchTest - results.totalHits.value=1
      15:46:12.181 [main] INFO test.LongTextFieldSearchTest - indexed terms: 开, 层, 心, 弄, 万, 停车场, 地下, 科, 虹桥, 底下, 锡, 入, 2184, 中, 路, 到, 1, 2, 申, 2179, 车位, 988, 虹, lg, 长
      15:46:12.185 [main] INFO test.LongTextFieldSearchTest - terms: 申, 长, 路, 988, 弄, 虹桥, 万, 科, 中, 心, 地下, 停车场, lg, 2, 层, 2179, 2184, 车位, 锡, 虹, 路, 入, lg, 1, 层, 开, 到, 底下, lg, 2
      15:46:12.188 [main] INFO test.LongTextFieldSearchTest - query: +address:"申 长 路 988 弄 虹桥 万 科 中 心 地下 停车场 lg 2 层 2179 2184 车位 锡 虹 路 入 lg 1 层 开 到 底下 lg 2"~2
      15:46:12.210 [main] INFO test.LongTextFieldSearchTest - results.totalHits.value=0
      15:46:12.214 [main] INFO test.LongTextFieldSearchTest - no matching phrase

        Attachments

        1. LongTextFieldSearchTest.java
          7 kB
          Chen Zhixiang

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              chenzx Chen Zhixiang
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: