Dear Wiki user, You have subscribed to a wiki page or wiki category on "Solr Wiki" for change notification.
The "VelocityResponseWriter" page has been changed by HossMan: http://wiki.apache.org/solr/VelocityResponseWriter?action=diff&rev1=35&rev2=36 Comment: trunk->branch_4x and TOC = Introduction = - <!> Solr 1.4 <!> VelocityResponseWriter (aka [[Solritas]]) enables Solr to respond with content generated from [[http://velocity.apache.org|Velocity]] templates. Along with technologies like SolrJS, this makes Solr itself capable of driving sophisticated search interfaces without the need for an intermediate application server between the browser and Solr. See [[https://issues.apache.org/jira/browse/SOLR-620|SOLR-620]] for more information. - <!> Solr 4.0 (trunk) Skip to the section labeled 'Solr 4.0 (trunk)'! <!> + <<TableOfContents>> + - == Instructions to use, Solr 1.4 == + = Instructions to use, Solr 1.4+ = These steps will get you up and running for the examples below: * Download and install Solr 1.4.x @@ -17, +17 @@ * Index sample docs: cd example/exampledocs; java -jar post.jar *.xml * Hit the examples below... - === Sample Usage === + == Sample Usage == http://localhost:8983/solr/itas . Renders browse.vm from conf/velocity. Faceted navigation included. @@ -30, +30 @@ . Renders browse.vm, adding in explanation views per hit, and a Velocity context dump at the end. - ==== Using the VelocityResponseWriter in Solr Core ==== + === Using the VelocityResponseWriter in Solr Core === The VelocityResponseWriter is still a contrib component in Solr 1.4.x. 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: @@ -81, +81 @@ }}} Copy the .../contrib/velocity/src/main/solr/conf/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. - == Instructions to use, Solr 4.0 (trunk) == + = Instructions to use, Solr 4.0+ = These steps will get you up and running for the examples below: - * Check out Solr trunk: svn co https://svn.apache.org/repos/asf/lucene/dev/trunk + * Check out Solr trunk: svn co http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/ * Build Solr: ant clean example * Fire up Solr: cd example; java -jar start.jar * Index sample docs: cd example/exampledocs; java -jar post.jar *.xml * Hit the examples below... - === Sample Usage === + == Sample Usage == http://localhost:8983/solr/browse . Renders browse.vm from conf/velocity. Faceted navigation included. @@ -104, +104 @@ . Renders browse.vm, adding in explanation views per hit, and a Velocity context dump at the end. + = Options (All Versions) = - <!> Applies to both Solr 1.4 and 4.0 (trunk) <!> - - == Options == * {{{v.template}}}: template name to use, without the .vm suffix. If not specified, "default"[.vm] will be used. * {{{v.template.<name>}}}: overrides a file system template * {{{debugQuery}}}: if true, default view displays explanations for each hit and additional debugging information in the footer. @@ -117, +115 @@ * {{{v.contentType}}}: sets the value of the HTTP response's Content-Type header (in case (x)html pages should be UTF-8 (instead of ISO-8859-1) encoded, make sure you set this option to {{{text/xml;charset=UTF-8}}} (for XHTML) and {{{text/html;charset=UTF-8}}} (for HTML), respectively) - == Velocity Context == + = Velocity Context = * {{{esc}}}: a Velocity [[http://velocity.apache.org/tools/releases/1.4/generic/EscapeTool.html|EscapeTool]] instance * {{{date}}}: a Velocity [[http://velocity.apache.org/tools/releases/1.4/javadoc/org/apache/velocity/tools/generic/ComparisonDateTool.html|ComparisonDateTool]] instance * {{{list}}}: a Velocity [[http://velocity.apache.org/tools/releases/1.4/javadoc/org/apache/velocity/tools/generic/ListTool.html|ListTool]] instance @@ -128, +126 @@ * {{{response}}}: a [[http://lucene.apache.org/solr/api/org/apache/solr/client/solrj/response/QueryResponse.html|QueryResponse]] most of the time, but in some cases where QueryResponse doesn't like the request handlers output (AnalysisRequestHandler, for example, causes a ClassCastException parsing "response") the response will be a SolrResponseBase object. * {{{sort}}}: a Velocity [[http://velocity.apache.org/tools/releases/1.4/javadoc/org/apache/velocity/tools/generic/SortTool.html|SortTool]] instance - == TODO == + = TODO = * Ajax suggest * Integrate/adapt to SolrJS