O'Reilly logo

Apache Solr Beginner's Guide by Alfredo Serafini

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Time for action – enabling XSLT Response Writer with Luke

An example of an interesting alternative is the XSLT Response Writer. For instance, we could use the one designed to enable XSLT processing over the XML responses.

  1. To do this, first of all we define a new core that we will name paintings_xslt. In its own solrconfig.xml file, we will add a simple new definition:
    <queryResponseWriter name="xslt" class="solr.XSLTResponseWriter">
      <int name="xsltCacheLifetimeSeconds">0</int>
    </queryResponseWriter>
  2. Once we have enabled it, we can use an XSLT file. For this, we could use a copy of the luke.xsl file provided in the default Solr examples.
  3. Now we can ask for the Luke analysis:
    >> curl -X GET 'http://localhost:8983/solr/paintings_xslt/admin/luke?q=*:*&wt=xslt&tr=luke.xsl' ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required