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 has 5 years of experience with developing web solutions using ASP.NET and SQL Server. For the past 3 years, he has been actively engaged in website development projects using Sitecore CMS. He enjoys creating web solutions for clients using Sitecore CMS and, using its flexibility, provides cohesive and integrated solutions. Xing is a Sitecore Technology MVP, 2016.

Explore topics:

Other Blog Posts from Xing Liu