Uploaded image for project: 'Jackrabbit Oak'
  1. Jackrabbit Oak
  2. OAK-2438

Evaluate support for must(must_not(x)) query with Lucene

    XMLWordPrintableJSON

Details

    • Task
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 1.1.6
    • lucene
    • None

    Description

      As part of OAK-2434 fix we are changing following logic

      @Override
                  public boolean visit(FullTextAnd and) {
                      BooleanQuery q = new BooleanQuery();
                      for (FullTextExpression e : and.list) {
                          Query x = getFullTextQuery(e, analyzer, reader);
                          // Lucene can't deal with "must(must_not(x))"
                          if (x instanceof BooleanQuery) {
                              BooleanQuery bq = (BooleanQuery) x;
                              for (BooleanClause c : bq.clauses()) {
                                  q.add(c);
                              }
                          } else {
                              q.add(x, MUST);
                          }
                      }
                      result.set(q);
                      return true;
                  }
      

      With a logic where the query is always added to BooleanQuery without unwrapping. This might affect logic related to comment // Lucene can't deal with "must(must_not)". Currently there is no testcase to check that condition and we are not sure how this change would affect such a check.

      So need to add a testcase to document the behaviour for such cases

      Attachments

        Issue Links

          Activity

            People

              chetanm Chetan Mehrotra
              chetanm Chetan Mehrotra
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: