Apache Solr open-source search software
SOLR-13971: Revert changes to the default configset. * clarified these are Java system properties * trivial dead code change; Boolean.getBoolean returns a primitive
David Smiley6a72b81ed308
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txtindex 687b526726d..66d6ebb88e4 100644--- a/solr/CHANGES.txt+++ b/solr/CHANGES.txt@@ -228,10 +228,9 @@ Jetty 9.4.19.v20190610Upgrade Notes-----------------------* Velocity response writer is no longer available to be used through the _default configset. In order- to use it, you would need to manually add it to your configset. Also, the initialization parameters+* Velocity: The initialization parameters"params.resource.loader.enabled" and "solr.resource.loader.enabled" have been removed and replaced by- startup parameters "velocity.resourceloader.params.enabled" and "velocity.resourceloader.solr.enabled"+ Java system properties "velocity.resourceloader.params.enabled" and "velocity.resourceloader.solr.enabled"respectively (both turned off by default). Please see SOLR-13971 for more details.Bug Fixes@@ -239,8 +238,8 @@ Bug Fixes* SOLR-13963: JavaBinCodec has concurrent modification of CharArr resulting in corrupt internode updates (Colvin Cowie, noble)-* SOLR-13971: Velocity response writer's resource loading now possible only through startup parameters. Also, removed velocity- response writer from _default configset. (Ishan Chattopadhyaya)+* SOLR-13971: Velocity response writer's resource loading now possible only through startup parameters.+ (Ishan Chattopadhyaya, David Smiley)================== 8.3.0 ==================diff --git a/solr/contrib/velocity/src/java/org/apache/solr/response/VelocityResponseWriter.java b/solr/contrib/velocity/src/java/org/apache/solr/response/VelocityResponseWriter.javaindex 75fcd689cf1..b3f022ad48b 100644--- a/solr/contrib/velocity/src/java/org/apache/solr/response/VelocityResponseWriter.java+++ b/solr/contrib/velocity/src/java/org/apache/solr/response/VelocityResponseWriter.java@@ -108,12 +108,10 @@ public class VelocityResponseWriter implements QueryResponseWriter, SolrCoreAwar}// params resource loader: off by default- Boolean prle = Boolean.getBoolean(PARAMS_RESOURCE_LOADER_ENABLED);- paramsResourceLoaderEnabled = (null == prle ? false : prle);+ paramsResourceLoaderEnabled = Boolean.getBoolean(PARAMS_RESOURCE_LOADER_ENABLED);// solr resource loader: off by default- Boolean srle = Boolean.getBoolean(SOLR_RESOURCE_LOADER_ENABLED);- solrResourceLoaderEnabled = (null == srle ? false : srle);+ solrResourceLoaderEnabled = Boolean.getBoolean(SOLR_RESOURCE_LOADER_ENABLED);initPropertiesFileName = (String) args.get(PROPERTIES_FILE);diff --git a/solr/core/src/test-files/solr/configsets/_default/conf/solrconfig.xml b/solr/core/src/test-files/solr/configsets/_default/conf/solrconfig.xmlindex 4fccb3a16f8..db562a2e98b 100644--- a/solr/core/src/test-files/solr/configsets/_default/conf/solrconfig.xml+++ b/solr/core/src/test-files/solr/configsets/_default/conf/solrconfig.xml@@ -81,6 +81,8 @@<lib dir="${solr.install.dir:../../../..}/contrib/langid/lib/" regex=".*\.jar" /><lib dir="${solr.install.dir:../../../..}/dist/" regex="solr-langid-\d.*\.jar" />+ <lib dir="${solr.install.dir:../../../..}/contrib/velocity/lib" regex=".*\.jar" />+ <lib dir="${solr.install.dir:../../../..}/dist/" regex="solr-velocity-\d.*\.jar" /><lib dir="${solr.install.dir:../../../..}/dist/" regex="solr-ltr-\d.*\.jar" /><!-- an exact 'path' can be used instead of a 'dir' to specify a@@ -778,7 +780,7 @@(SearchHandler) can be registered multiple times with differentnames (and different init parameters)-->- <requestHandler name="/browse" class="solr.SearchHandler" useParams="query,facets,browse">+ <requestHandler name="/browse" class="solr.SearchHandler" useParams="query,facets,velocity,browse"><lst name="defaults"><str name="echoParams">explicit</str></lst>@@ -1290,6 +1292,15 @@</queryResponseWriter>-->+ <!--+ Custom response writers can be declared as needed...+ -->+ <queryResponseWriter name="velocity" class="solr.VelocityResponseWriter" startup="lazy">+ <str name="template.base.dir">${velocity.template.base.dir:}</str>+ <str name="solr.resource.loader.enabled">${velocity.solr.resource.loader.enabled:true}</str>+ <str name="params.resource.loader.enabled">${velocity.params.resource.loader.enabled:false}</str>+ </queryResponseWriter>+<!-- XSLT response writer transforms the XML output by any xslt file foundin Solr's conf/xslt directory. Changes to xslt files are checked forevery xsltCacheLifetimeSeconds.diff --git a/solr/server/solr/configsets/_default/conf/solrconfig.xml b/solr/server/solr/configsets/_default/conf/solrconfig.xmlindex 4fccb3a16f8..db562a2e98b 100644--- a/solr/server/solr/configsets/_default/conf/solrconfig.xml+++ b/solr/server/solr/configsets/_default/conf/solrconfig.xml@@ -81,6 +81,8 @@<lib dir="${solr.install.dir:../../../..}/contrib/langid/lib/" regex=".*\.jar" /><lib dir="${solr.install.dir:../../../..}/dist/" regex="solr-langid-\d.*\.jar" />+ <lib dir="${solr.install.dir:../../../..}/contrib/velocity/lib" regex=".*\.jar" />+ <lib dir="${solr.install.dir:../../../..}/dist/" regex="solr-velocity-\d.*\.jar" /><lib dir="${solr.install.dir:../../../..}/dist/" regex="solr-ltr-\d.*\.jar" /><!-- an exact 'path' can be used instead of a 'dir' to specify a@@ -778,7 +780,7 @@(SearchHandler) can be registered multiple times with differentnames (and different init parameters)-->- <requestHandler name="/browse" class="solr.SearchHandler" useParams="query,facets,browse">+ <requestHandler name="/browse" class="solr.SearchHandler" useParams="query,facets,velocity,browse"><lst name="defaults"><str name="echoParams">explicit</str></lst>@@ -1290,6 +1292,15 @@</queryResponseWriter>-->+ <!--+ Custom response writers can be declared as needed...+ -->+ <queryResponseWriter name="velocity" class="solr.VelocityResponseWriter" startup="lazy">+ <str name="template.base.dir">${velocity.template.base.dir:}</str>+ <str name="solr.resource.loader.enabled">${velocity.solr.resource.loader.enabled:true}</str>+ <str name="params.resource.loader.enabled">${velocity.params.resource.loader.enabled:false}</str>+ </queryResponseWriter>+<!-- XSLT response writer transforms the XML output by any xslt file foundin Solr's conf/xslt directory. Changes to xslt files are checked forevery xsltCacheLifetimeSeconds.diff --git a/solr/solr-ref-guide/src/solr-plugins.adoc b/solr/solr-ref-guide/src/solr-plugins.adocindex 3433f84d91a..5e96b3ceb1d 100644--- a/solr/solr-ref-guide/src/solr-plugins.adoc+++ b/solr/solr-ref-guide/src/solr-plugins.adoc@@ -17,8 +17,8 @@// specific language governing permissions and limitations// under the License.-Solr allows you to load custom code to perform a variety of tasks within Solr, from custom Request Handlers to process your searches, to custom Analyzers and Token Filters for your text field. You can even load custom Field Types. These pieces of custom code are called plugins.+Solr allows you to load custom code to perform a variety of tasks within Solr, from custom Request Handlers to process your searches, to custom Analyzers and Token Filters for your text field. You can even load custom Field Types. These pieces of custom code are called _plugins_.-Not everyone will need to create plugins for their Solr instances - what's provided is usually enough for most applications. However, if there's something that you need, you may want to review the Solr Wiki documentation on plugins at http://wiki.apache.org/solr/SolrPlugins[SolrPlugins].+Not everyone will need to create plugins for their Solr instances - what's provided is usually enough for most applications. However, if there's something that you need, you may want to review the Solr Wiki documentation on plugins at https://cwiki.apache.org/confluence/display/solr/SolrPlugins[SolrPlugins].If you have a plugin you would like to use, and you are running in SolrCloud mode, you can use the Blob Store API and the Config API to load the jars to Solr. The commands to use are described in the section <<adding-custom-plugins-in-solrcloud-mode.adoc#adding-custom-plugins-in-solrcloud-mode,Adding Custom Plugins in SolrCloud Mode>>.diff --git a/solr/solr-ref-guide/src/velocity-response-writer.adoc b/solr/solr-ref-guide/src/velocity-response-writer.adocindex c59d4ebea1a..10b75d98322 100644--- a/solr/solr-ref-guide/src/velocity-response-writer.adoc+++ b/solr/solr-ref-guide/src/velocity-response-writer.adoc@@ -40,6 +40,8 @@ The above example shows the optional initialization and custom tool parameters u=== VelocityResponseWriter Startup Parameters+These are Java system properties to mitigate security risks.+`velocity.resourceloader.params.enabled`::The "params" resource loader allows templates to be specified in Solr request parameters. For example:+