Set and validate the boolean query max clause count
Allow the user to change the default value of the boolean query max clause count ( 1024 ).
Then use this value ( default or not ) to check the boolean queries and the terms query ( implemented as boolean queries ).
Not sure I want to expose this setting, really... There isn't a good 1-1 mapping between the settings we would expose and how they would be implemented.
For example, if we expose this as a backend setting, and two Lucene backends have a different value, we would be in trouble because the max clause count is set through a global, static variable. So we just cannot have two different values for two backends.
Same goes with Elasticsearch: https://www.elastic.co/guide/en/elasticsearch/reference/current/search-settings.html. it’s a global setting that affects all indexes in the cluster. Not just indexes for one Hibernate Search backend. Not even just indexes for all Hibernate search backends: it could affect other indexes in the cluster that are not managed by Hibernate Search.
Really, I think this setting would be better addressed by some documentation showing people how they can change it, rather than exposing something in Hibernate Search that will not quite work as expected.