apache / solr-operator

Official Kubernetes operator for Apache Solr
https://solr.apache.org/operator
Apache License 2.0
243 stars 111 forks source link

Update the default solr.xml to include maxBooleanClauses #526

Closed coolstim closed 2 months ago

coolstim commented 1 year ago

The default solr.xml does not contain a default entry for maxBooleanClauses. This prevents the value to be set via javaOpts and forces uses to implement a custom config map with a custom solr.xml; Adding <int name="maxBooleanClauses">${solr.max.booleanClauses:1024}</int> to the const DefaultSolrXML would not change the default values but would allow a simple override via the javaOpts

basically the change is solr_util.go

const DefaultSolrXML = `<?xml version="1.0" encoding="UTF-8" ?>
<solr>
  %s
  <int name="maxBooleanClauses">${solr.max.booleanClauses:1024}</int>
  <solrcloud>
    <str name="host">${host:}</str>
    <int name="hostPort">${hostPort:80}</int>
    <str name="hostContext">${hostContext:solr}</str>
    <bool name="genericCoreNodeNames">${genericCoreNodeNames:true}</bool>
    <int name="zkClientTimeout">${zkClientTimeout:30000}</int>
    <int name="distribUpdateSoTimeout">${distribUpdateSoTimeout:600000}</int>
    <int name="distribUpdateConnTimeout">${distribUpdateConnTimeout:60000}</int>
    <str name="zkCredentialsProvider">${zkCredentialsProvider:org.apache.solr.common.cloud.DefaultZkCredentialsProvider}</str>
    <str name="zkACLProvider">${zkACLProvider:org.apache.solr.common.cloud.DefaultZkACLProvider}</str>
  </solrcloud>
  <shardHandlerFactory name="shardHandlerFactory"
    class="HttpShardHandlerFactory">
    <int name="socketTimeout">${socketTimeout:600000}</int>
    <int name="connTimeout">${connTimeout:60000}</int>
  </shardHandlerFactory>
  %s
</solr>
`
janhoy commented 1 year ago

Probably a future version of the operator won't need to maintain a default solr.xml, if it can require a minimum solr version of 9.0. Since Solr v9.0 Solr will use a built-in default if no solr.xml is present in SOLR_HOME.

HoustonPutman commented 1 year ago

The Solr Operator currently supports Solr 7.7 (and 8.0), which do not have this option unfortunately, so we cannot add it by default.

We will soon release the next version of the Solr Operator and then we can increase the minimum version of Solr to 8.x (for some version of x), and this can be included in the next release. I'll get the ball rolling on this.

Since Solr v9.0 Solr will use a built-in default if no solr.xml is present in SOLR_HOME.

I am unbelievably excited for this when we have Solr 9.0 as a minimum version.

coolstim commented 2 months ago

issue is solved in https://github.com/apache/solr-operator/issues/630