lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Hatcher <erik.hatc...@gmail.com>
Subject Re: Velocity in Multicore
Date Fri, 18 Jan 2013 21:13:26 GMT
Paul -

In case you haven't already sussed this one out already, the likely issue is that each core
is separately configured and only the single core example collection1 core comes with the
VelocityResponseWriter wired in fully.  You need these lines (paths likely need adjusting!)
in your solrconfig.xml:

  <lib dir="../../../contrib/velocity/lib" regex=".*\.jar" />
  <lib dir="../../../dist/" regex="apache-solr-velocity-\d.*\.jar" />

and 

    <queryResponseWriter name="velocity" class="solr.VelocityResponseWriter" startup="lazy"/>


I used the example-DIH, <launching via [java -Dsolr.solr.home="./example-DIH/solr/" -jar
start.jar>), after adding the above to the db/conf/solrconfig.xml file and this works:

  http://localhost:8983/solr/db/select?q=*:*&wt=velocity&v.template=hello&v.template.hello=Hello%20World!

Before adding getting VrW registered, Solr fell back to the XML response writer as you experienced.

	Erik




On Jan 14, 2013, at 14:05 , Ramirez, Paul M (388J) wrote:

> Hi,
> 
> I've been unable to get the velocity response writer to work in a multicore environment.
Working from the examples that are distributed with Solr I simply started from the multicore
example and added a hello.vm into core0/conf/velocity directory. I then updated the solrconfig.xml
to add a new request handler as shown below. I've tried to use the v.base_dir to no success.
Essentially what I always end up with is the default solr response. Has anyone been able to
get the velocity response writer to work in a multicore environment? If so, could you point
me to the documentation on how to do so.
> 
> hello.vm
> ========
> Hello World!
> 
> solrconfig.xml
> ===========
> …
> <requestHandler name="/hello" class="solr.SearchHandler">
>     <lst name="defaults">
>       <str name="echoParams">explicit</str>
>       <!-- VelocityResponseWriter settings -->
>       <str name="wt">velocity</str>
>       <str name="v.template">hello</str>
>       <!-- I've tried all the following in addition to not specifying any. -->
>       <!--str name="v.base_dir">core0/conf/velocity</str-->
>       <!--str name="v.base_dir">conf/velocity</str-->
>       <!--str name="v.base_dir">multicore/core0/conf/velocity</str-->
>     </lst>
> 
>  </requestHandler>
> …
> 
> 
> 
> Regards,
> Paul Ramirez


Mime
View raw message