Sitecore Max Lucene Query Clause Count

Xing Liu • 4/14/2016

If you have encountered this following error: 

Exception: Sitecore.ContentSearch.Linq.Lucene.Exceptions.TooManyClausesException.  

It’s probably because your lucene query exceeded the max clause count setting. You can adjust this setting from the Lucene default config file:

App_Config\Include\Sitecore.ContentSearch.Lucene.DefaultIndexConfiguration

The default max count is 4096 in Sitecore 8.1.  You can adjust it based on your query size.

<setting name="ContentSearch.LuceneQueryClauseCount" value="4096" />

However, be cautious about using this setting since it might slow down the system performance after increasing the clause count.

Xing Liu

Xing Liu is a Sitecore MVP with expertise in all aspects of ASP.NET and SQL Server development across a variety of industries including Government, Banking, Healthcare and Energy. He provides technical thought leadership and consulting to SymSoft and client development teams. Xing has deep expertise in using Sitecore Helix in an Agile delivery model to streamline the construction of complex Sitecore websites, portals and their associated authoring environments. Xing is also a globally recognized photographer with an Instagram following approaching 100,000.

Explore topics:

Other Blog Posts from Xing Liu