lucene-solr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Solr Wiki] Trivial Update of "VelocityResponseWriter" by JayHill
Date Mon, 14 Sep 2009 21:28:51 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Solr Wiki" for change notification.

The following page has been changed by JayHill:
http://wiki.apache.org/solr/VelocityResponseWriter

The comment on the change is:
  Fleshed out details on how to use withing Solr core

------------------------------------------------------------------------------
  http://localhost:8983/solr/itas?debugQuery=true
  
    Renders browse.vm, adding in explanation views per hit, and a Velocity context dump at
the end.
+ 
+ == Using the VelocityResponseWriter in Solr Core ==
+ 
+ The VelocityResponseWriter is still a contrib component. In order to use it with the core
distributions the following steps need to be followed:
+ 
+ The following jars need to be copied from contrib/velocity/src/main/solr/lib/ to $SOLR_HOME/lib:
+ 
+  * apache-solr-velocity-1.4-dev.jar
+ 
+  * velocity-1.6.1.jar
+ 
+  * velocity-tools-2.0-beta3.jar
+ 
+  * commons-beanutils-1.7.0.jar
+ 
+  * commons-collections-3.2.1.jar
+ 
+ The VelocityResponseWriter uses a more recent version of the commons lang jar than the current
version of Solr core, so the jar commons-lang-2.4.jar from .../contrib/velocity/src/main/solr/lib/
should replace $SOLR_HOME/lib/commons-lang-2.1.jar
+ 
+ Add some configuration for this ResponseWriter to solrconfig.xml like this:
+ 
+ {{{
+     <queryResponseWriter name="velocity" class="org.apache.solr.request.VelocityResponseWriter"/>
+ }}}
+ 
+ Set up a RequestHandler in solrconfig.xml:
+ 
+ {{{
+   <requestHandler name="/itas" class="solr.SearchHandler">
+      <lst name="defaults">
+        <str name="v.template">browse</str>
+        <str name="v.properties">velocity.properties</str>
+        <str name="title">Solritas</str>
+ 
+        <str name="wt">velocity</str>
+        <str name="defType">dismax</str>
+        <str name="q.alt">*:*</str>
+        <str name="rows">10</str>
+        <str name="fl">*,score</str>
+        <str name="facet">on</str>
+        <str name="facet.field">title</str>
+        <str name="facet.mincount">1</str>
+        <str name="qf">
+           text^0.5 title^1.5
+        </str>
+      </lst>
+      <!--<lst name="invariants">-->
+        <!--<str name="v.base_dir">/solr/contrib/velocity/src/main/templates</str>-->
+      <!--</lst>-->
+   </requestHandler>
+ }}}
+ 
+ Copy the .../contrib/velocity/src/main/solr/velocity directory to $SOLR_HOME/conf/. This
directory contains the Velocity templates that will be needed by the VelocityResponseWriter,
and also a style sheet, main.css. The templates and style sheet can be edited to customize
the display.
  
  == Options ==
  

Mime
View raw message