You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by Jack Krupansky <ja...@basetechnology.com> on 2012/06/15 17:54:50 UTC

Doc error in example solrconfig: maxBooleanClauses is based on first not last core loaded

The example solrconfig.xml has this comment for the maxBooleanClauses element:

“If multiple solrconfig.xml files disagree on this property, the value at any given moment will be based on the last SolrCore to be initialized.”

When in fact the code actually initializes this property on the FIRST (initial) core load (SolrCore constructor) and IGNORES the setting on future core loads.

This also means that if you want to change the value, it is not sufficient to unload/reload all cores, but you need to shutdown Solr itself. This should also be noted in the comment in solrconfig.xml.

Also, the comment should clarify that this property is set for the first/initial core load even if the element is not present in that initial solrconfig.xml. In the latter case, the Lucene BooleanQuery.maxClauseCount default value, which also happens to be 1024, is used.

Further, the code simply has a log.debug for subsequent core loads that have a different value for the limit. I think this should be a warning, if not an error. I warning should be good enough for now.

I would suggest that the warning paragraph in the comment be changed to:

“This option actually modifies a global Lucene property that will affect all SolrCores for a Solr instance.
  It will be initialized based on the solrconfig.xml setting for the initial code load of a given Solr instance.
  If this property is not present in that initial code load, it will be initialized to the Lucene default value of 1024.
  This property will be ignored on all subsequent core loads and reloads, including a reload of the initial core.
  To effect a change in this property it is not sufficient to shut down or reload all cores, but rather Solr itself
  must be shutdown and restarted.”

(Let me know if I need to file this as a Jira as opposed to a committer simply editing the comment in example solrconfig.xml (and changing that log.debug to log.warn).)

-- Jack Krupansky