figuring out reason for maxClauseCount is set to 1024 error

后端 未结 5 1641
萌比男神i
萌比男神i 2021-02-18 15:35

I\'ve two sets of search indexes. TestIndex (used in our test environment) and ProdIndex(used in PRODUCTION environment). Lucene search query: +date:[20090410184806 TO 200910071

5条回答
  •  后悔当初
    2021-02-18 16:06

    I had this same issue in C# code running with the Sitecore web content management system. I used Randy's answer above, but was not able to use the System get and set property functionality. Instead I retrieved the current count, incremented it, and set it back. Worked great!

    catch (BooleanQuery.TooManyClauses e)
    {
        // Increment the number of boolean queries allowed.
        // The default is 1024.
        var currMaxClause = BooleanQuery.GetMaxClauseCount();
        var newMaxClause = currMaxClause + 1024;
        BooleanQuery.SetMaxClauseCount(newMaxClause);
        retry = true;
    }
    

提交回复
热议问题