11.05.2016 Views

Apache Solr Reference Guide Covering Apache Solr 6.0

21SiXmO

21SiXmO

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

VelocityResponseWriter; these are detailed in the following table. These initialization parameters are only<br />

specified in the writer registration in solrconfig.xml, not as request-time parameters. See further below for<br />

request-time parameters.<br />

VelocityResponseWriter initialization parameters<br />

Parameter Description Default<br />

value<br />

template.base.dir<br />

init.properties.file<br />

params.resource.loader.enabled<br />

solr.resource.loader.enabled<br />

tools<br />

If specified and exists as a file system directory, a file resource<br />

loader will be added for this directory. Templates in this directory<br />

will override "solr" resource loader templates.<br />

Specifies a properties file name which must exist in the <strong>Solr</strong> conf/<br />

directory ( not under a velocity/ subdirectory) or root of a JAR file<br />

in a .<br />

The "params" resource loader allows templates to be specified in<br />

<strong>Solr</strong> request parameters. For example: http://localhost:<br />

8983/ solr/ gettingstarted/ select? q=*:*& wt=velo<br />

city& v.template=custom& v.template.custom=CUSTOM<br />

%3A%20%23core_name where v.template=custom says to<br />

render a template called "custom" and v.template.custom's value<br />

is the actual custom template. This is disabled by default; it'd be<br />

a niche, unusual use case to need this enabled.<br />

The "solr" resource loader is the only template loader registered<br />

by default. Templates are served from resources visible to the<br />

<strong>Solr</strong>ResourceLoader under a velocity/ subdirectory. The<br />

VelocityResponseWriter itself has some built-in templates (in its<br />

JAR file, under velocity/) that are available automatically through<br />

this loader. These built-in templates can be overridden when the<br />

same template name is in conf/velocity/ or by using the templat<br />

e.base.dir option.<br />

External "tools" can be specified as list of string name/value (tool<br />

name / class name) pairs. Tools, in the Velocity context, are<br />

simply Java objects. Tool classes are constructed using a no-arg<br />

constructor (or a single-<strong>Solr</strong>Core-arg constructor if it exists) and<br />

added to the Velocity context with the specified name. A custom<br />

registered tool can override the built-in context objects with the<br />

same name, except for $request, $response, $page, and $debug<br />

(these tools are designed to not be overridden).<br />

false<br />

true<br />

VelocityResponseWriter request parameters<br />

Parameter Description Default value<br />

v.template Specifies the name of the template to render.<br />

v.layout<br />

Specifies a template name to use as the<br />

layout around the main, v.template,<br />

specified template.<br />

The main template is rendered into a string<br />

value included into the layout rendering as $c<br />

ontent.<br />

<strong>Apache</strong> <strong>Solr</strong> <strong>Reference</strong> <strong>Guide</strong> <strong>6.0</strong><br />

398

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!