Lucene - Core
  1. Lucene - Core
  2. LUCENE-538

Using WildcardQuery with MultiSearcher, and Boolean MUST_NOT clause

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.9
    • Fix Version/s: 3.1
    • Component/s: core/search
    • Labels:
      None
    • Environment:

      Ubuntu Linux, java version 1.5.0_04

      Description

      We are searching across multiple indices using a MultiSearcher. There seems to be a problem when we use a WildcardQuery to exclude documents from the result set. I attach a set of unit tests illustrating the problem.

      In these tests, we have two indices. Each index contains a set of documents with fields for 'title', 'section' and 'index'. The final aim is to do a keyword search, across both indices, on the title field and be able to exclude documents from certain sections (and their subsections) using a
      WildcardQuery on the section field.

      e.g. return documents from both indices which have the string 'xyzpqr' in their title but which do not lie
      in the news section or its subsections (section = /news/*).

      The first unit test (testExcludeSectionsWildCard) fails trying to do this.
      If we relax any of the constraints made above, tests pass:

      • Don't use WildcardQuery, but pass in the news section and it's child section to exclude explicitly (testExcludeSectionsExplicit)</li>
      • Exclude results from just one section, not it's children too i.e. don't use WildcardQuery(testExcludeSingleSection)</li>
      • Do use WildcardQuery, and exclude a section and its children, but just use one index thereby using the simple
        IndexReader and IndexSearcher objects (testExcludeSectionsOneIndex).
      • Try the boolean MUST clause rather than MUST_NOT using the WildcardQuery i.e. only include results from the /news/ section
        and its children.

        Issue Links

          Activity

          Helen Warren created issue -
          Helen Warren made changes -
          Field Original Value New Value
          Attachment TestMultiSearchWildCard.java [ 12324916 ]
          Michael Busch made changes -
          Priority Major [ 3 ] Minor [ 4 ]
          Mark Miller made changes -
          Link This issue is duplicated by LUCENE-1300 [ LUCENE-1300 ]
          Robert Muir made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Fix Version/s 3.1 [ 12314822 ]
          Resolution Fixed [ 1 ]
          Mark Thomas made changes -
          Workflow jira [ 12353310 ] Default workflow, editable Closed status [ 12564025 ]
          Mark Thomas made changes -
          Workflow Default workflow, editable Closed status [ 12564025 ] jira [ 12585497 ]
          Grant Ingersoll made changes -
          Status Resolved [ 5 ] Closed [ 6 ]

            People

            • Assignee:
              Unassigned
              Reporter:
              Helen Warren
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development