Uploaded image for project: 'Service Packs and Hot Fixes'
  1. Service Packs and Hot Fixes
  2. MNT-11190

MaxBooleanClauses is not taken into account for MultiPhraseQuery

    Details

      Description

      Description

      When searching for multiple phrases in a single query, Solr expands wildcards without taking into account the maxBooleanClause parameter.
      Those queries consume a large amount of memory in Solr leading the instance to become unresponsive or even to get OutOfMemory.
      Furthermore those queries are taking a long time to execute and increase a lot the load on Solr.

      Steps to reproduce
      1- Start Alfresco server
      2- Import 100 000 documents with the word "test" in their name (eg: test1, test2, ...)
      3- Log with into Share
      4- Fill the Quick search with: * te* * (pay attention to use spaces as they are really important to reproduce)
      5- Take a heapdump while search is executed in Solr
      6- Open the heap and check the number of Term in the MultiPhraseQuery objects within BooleanClause.

      Expected Behaviour
      There is no more than 10000 terms (default solr.maxBooleanClauses) for each BooleanClause.

      BooleanQuery$TooManyClauses should be output .

      Observed Behaviour
      There is more than 10000 terms for MultiPhraseQuery inside BooleanClause.
      BooleanQuery$TooManyClauses is not output and he huge amount of memory is necessary to run those queries.

      Analysis to date
      It is necessary to be able to limit the number of Terms for MultiPhraseQuery as it is the case for simple phrase queries in order to limit the memory used by Solr to reply to these queries.
      If multiple complex MultiPhraseQuery are executed simultaneously against the same instance of Solr the instance become unresponsive and OutOfMemory eventually happen.

      Issue was first observed on the heapdump of the customer and reproduced on my dev environment with a vanilla 4.1.4 and Solr.

        Attachments

          Issue Links

            Structure

              Activity

                People

                • Assignee:
                  closedbugs Closed Bugs (Inactive)
                  Reporter:
                  croux Corentin Roux [X] (Inactive)
                • Votes:
                  1 Vote for this issue
                  Watchers:
                  9 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:

                    Time Tracking

                    Estimated:
                    Original Estimate - Not Specified
                    Not Specified
                    Remaining:
                    Remaining Estimate - 0 minutes
                    0m
                    Logged:
                    Time Spent - 2 days
                    2d

                      Structure Helper Panel