Hi Jeremy,

The xsl files go into the subdirectory /xslt/ (you have to create that)
in the /conf/ directory of the core that should return the transformed
results.

So, if you have a core /myCore/ that you want to return transformed
results you need to put the example.xsl into:

$SOLR_HOME/myCore/conf/xslt/example.xsl

and in $SOLR_HOME/myCore/conf/solrconfig.xml you add (change the cache
value to whatever appropriate):

<queryResponseWriter name="xslt" class="solr.XSLTResponseWriter">
   <int name="xsltCacheLifetimeSeconds">6000</int>
</queryResponseWriter>

Call this in a query:

http://<mysolrserver>/solr/myCore/select?q=id:<id>&wt=xslt&tr=example.xsl


Chantal


On Fri, 2011-10-14 at 07:22 +0200, Jeremy Cunningham wrote:
> Thanks for the response but I have seen this page and I had a few
> questions.  
> 
> 1.  Since I am using tomcat, I had to move the example directory into the
> tomcat directory structure.  In the multicore, there is no example.xsl.
> Where do I 
> need to put it? Also, how do I send docs for indexing when running solr
> under tomcat?  
> 
> Thanks,
> Jeremy
> 
> On 10/13/11 3:46 PM, "Lance Norskog" <goks...@gmail.com> wrote:
> 
> >http://wiki.apache.org/solr/XsltResponseWriter
> >
> >This is for the single-core example. It is easiest to just go to
> >solr/example, run java -jar start.jar, and hit the URL in the above wiki
> >page. Then poke around in solr/example/solr/conf/xslt. There is no
> >solrconfig.xml change needed.
> >
> >It is generally easiest to use the solr/example 'java -jar start.jar'
> >example to test out features. It is easy to break configuration linkages.
> >
> >Lance
> >
> >On Thu, Oct 13, 2011 at 12:42 PM, Jeremy Cunningham <
> >jeremy.cunningham.h...@statefarm.com> wrote:
> >
> >> I am new to solr and not a web developer.  I am a data warehouse guy
> >>trying
> >> to use solr for the first time.  I am familiar with xsl but I can't
> >>figure
> >> out how to get the example.xsl to be applied to my xml results.  I am
> >> running tomcat and have solr working.  I copied over the solr mulitiple
> >>core
> >> example to the conf directory on my tomcat server. I also added the war
> >>file
> >> and the search is fine.  I can't seem to figure out what I need to add
> >>to
> >> the solrcofig.xml or where ever so that the example.xsl is used.
> >>Basically
> >> can someone tell me where to put the xsl and where to configure its
> >>usage?
> >>
> >> Thanks
> >>
> >
> >
> >
> >-- 
> >Lance Norskog
> >goks...@gmail.com
> 

Reply via email to