Search code examples
solrlucenesolr-query-syntax

Exception as Org.apache.lucene.search.BooleanQuery$TooManyClauses: maxClauseCount is set to XXXX


I'm getting exception like below -

ERROR [http-bio-8085-exec-28] org.apache.solr.core.SolrCore - org.apache.lucene.search.BooleanQuery$TooManyClauses: maxClauseCount is set to 1024 at org.apache.lucene.search.BooleanQuery.add(BooleanQuery.java:136) at org.apache.lucene.search.BooleanQuery.add(BooleanQuery.java:127) at org.apache.lucene.search.ScoringRewrite$1.addClause(ScoringRewrite.java:51) at org.apache.lucene.search.ScoringRewrite$1.addClause(ScoringRewrite.java:55)

As per my understanding, This exception comes at QueryTime (when query clauses crosses it's limit here in this case 1024) but can this come at Indexing time ?

I've got this in logs, and not sure which process (indexing / Querying) this is occurring in ?

Thanks. Dev


Solution

  • Generally, there is no query involved in indexing new data, so you shouldn't see this when adding a document.

    However, when updating or deleting documents, they may be retrieved with a query (using deleteDocuments(Query query), for example). It would be unusual for a deletion or update query to be complex enough to generate 1024 clauses, but it could happen.

    Much more likely that it is the result of a search query, though.