Skip to content

Apache Lucene open-source search software

SOLR-13971: Renamed the velocity template parameter names

Ishan Chattopadhyaya212593d3624f
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index e9f54bc9917..458a0027b63 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -213,6 +213,25 @@ Other Changes
================== 8.3.1 ==================
+Consult the LUCENE_CHANGES.txt file for additional, low level, changes in this release.
+
+Versions of Major Components
+---------------------
+Apache Tika 1.19.1
+Carrot2 3.16.0
+Velocity 2.0 and Velocity Tools 3.0
+Apache ZooKeeper 3.5.5
+Jetty 9.4.19.v20190610
+
+Upgrade 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
+ "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"
+ respectively (both turned off by default). Please see SOLR-13971 for more details.
+
Bug Fixes
----------------------
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.java
index 7617649ed67..75fcd689cf1 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
@@ -65,8 +65,8 @@ public class VelocityResponseWriter implements QueryResponseWriter, SolrCoreAwar
public static final String PROPERTIES_FILE = "init.properties.file";
// System property names, these are _only_ loaded at node startup (no per-request control of these)
- public static final String PARAMS_RESOURCE_LOADER_ENABLED = "params.resource.loader.enabled";
- public static final String SOLR_RESOURCE_LOADER_ENABLED = "solr.resource.loader.enabled";
+ public static final String PARAMS_RESOURCE_LOADER_ENABLED = "velocity.resourceloader.params.enabled";
+ public static final String SOLR_RESOURCE_LOADER_ENABLED = "velocity.resourceloader.solr.enabled";
// request param names
public static final String TEMPLATE = "v.template";
diff --git a/solr/contrib/velocity/src/test/org/apache/solr/velocity/VelocityResponseWriterTest.java b/solr/contrib/velocity/src/test/org/apache/solr/velocity/VelocityResponseWriterTest.java
index f41ae5b046c..33f1b0239e9 100644
--- a/solr/contrib/velocity/src/test/org/apache/solr/velocity/VelocityResponseWriterTest.java
+++ b/solr/contrib/velocity/src/test/org/apache/solr/velocity/VelocityResponseWriterTest.java
@@ -34,16 +34,16 @@ import org.junit.Test;
public class VelocityResponseWriterTest extends SolrTestCaseJ4 {
@BeforeClass
public static void beforeClass() throws Exception {
- System.setProperty("params.resource.loader.enabled", "true");
- System.setProperty("solr.resource.loader.enabled", "true");
+ System.setProperty("velocity.resourceloader.params.enabled", "true");
+ System.setProperty("velocity.resourceloader.solr.enabled", "true");
initCore("solrconfig.xml", "schema.xml", getFile("velocity/solr").getAbsolutePath());
System.out.println(getFile("velocity/solr").getAbsolutePath());
}
@AfterClass
public static void afterClass() throws Exception {
- System.clearProperty("params.resource.loader.enabled");
- System.clearProperty("solr.resource.loader.enabled");
+ System.clearProperty("velocity.resourceloader.params.enabled");
+ System.clearProperty("velocity.resourceloader.solr.enabled");
}
@Test
diff --git a/solr/solr-ref-guide/src/velocity-response-writer.adoc b/solr/solr-ref-guide/src/velocity-response-writer.adoc
index 8f1f9140e95..c59d4ebea1a 100644
--- a/solr/solr-ref-guide/src/velocity-response-writer.adoc
+++ b/solr/solr-ref-guide/src/velocity-response-writer.adoc
@@ -34,13 +34,13 @@ Its JAR and dependencies must be added (via `<lib>` or solr/home lib inclusion),
</queryResponseWriter>
----
-The above example shows the optional initialization and custom tool parameters used by VelocityResponseWriter; these are detailed in the following table. These initialization parameters are only specified in the writer registration in `solrconfig.xml`, not as request-time parameters. In this example, all Solr nodes should be started with `-Dparams.resource.loader.enabled=true`. See further below for request-time parameters.
+The above example shows the optional initialization and custom tool parameters used by VelocityResponseWriter; these are detailed in the following table. These initialization parameters are only specified in the writer registration in `solrconfig.xml`, not as request-time parameters. In this example, all Solr nodes should be started with `-Dvelocity.resourceloader.params.enabled=true -Dvelocity.resourceloader.enabled=true`. See further below for request-time parameters.
== Configuration & Usage
=== VelocityResponseWriter Startup Parameters
-`params.resource.loader.enabled`::
+`velocity.resourceloader.params.enabled`::
The "params" resource loader allows templates to be specified in Solr request parameters. For example:
+
[source,bash]
@@ -48,7 +48,7 @@ http://localhost:8983/solr/gettingstarted/select?q=\*:*&wt=velocity&v.template=c
+
where `v.template=custom` says to render a template called "custom" and the value of `v.template.custom` is the custom template. This is `false` by default; it'd be a niche, unusual, use case to need this enabled.
-`solr.resource.loader.enabled`::
+`velocity.resourceloader.solr.enabled`::
The "solr" resource loader is the only template loader registered by default. Templates are served from resources visible to the SolrResourceLoader under a `velocity/` subdirectory. The VelocityResponseWriter itself has some built-in templates (in its JAR file, under `velocity/`) that are available automatically through this loader. These built-in templates can be overridden when the same template name is in conf/velocity/ or by using the `template.base.dir` option.
=== VelocityResponseWriter Initialization Parameters