Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-15429

Solr implications of LUCENE-8811 changes to how (solr.xml's) maxBooleanClauses is now used by IndexSearcher

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Task
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 9.0
    • None
    • None

    Description

      Background Info

      LUCENE-8811 Modified Lucene 9.x to expanded the usage of BooleanQuery.maxClauseCount (now moved to IndexSearcher.maxClauseCount)

      Now, in addition to being a limit on the number of individual clauses that can be specified when creating single BooleanQuery (either explicitly or during Query.rewrite()) it is also used by a QueryVisitor (after Query.rewrite() to enforce a limit on the total number of clauses in a nested query structure.

      In other words, the following psuedo code will work in lucene 8, but fail in lucene 9...

      x = new BooleanQuery()
      y = new BooleanQuery()
      for (int i = 0; i < BooleanQuery.maxClauseCount - 1; i++) {
        x.addClause(new TermQuery("fx:" + i))
        y.addClause(new TermQuery("fy:" + i))
      }
      BooleanQuery wrapper = new BooleanQuery(x, y)
      searcher.search(wrapper)
      
      (Current) Impacts on Solr users

      The solr.xml maxBooleanClauses setting is what currently controls how this value is configured. If unset, it defaults to the lucene default (unchanged in 9.x) of 1024 – but the solr.xml files shipped with all versions of Solr since 8.1 have specified a value of "\${solr.max.booleanClauses:1024}" (see SOLR-13336)

      The direct impacts of LUCENE-8811 on Solr users (as of the current solr.git/main branch) is that queries which worked fine in 8.x may start throwing TooManyClauses() exceptions in 9.x, even with existing (built by 8.x) indexes, depending on how complex and deeply nested the query structures are.

      This jira is being created as a focal point for assess/discussion what changes we want to make to Solr code and/or documentation regarding maxBooleanClauses in Solr 9.0.

       

      Attachments

        Issue Links

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            hossman Chris M. Hostetter
            hossman Chris M. Hostetter
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment