It depends upon whether you want Solr to do the XSL processing, or the browser.
After fussing a bit, and doing some reading and thinking, we decided it was
best to let the browser do the work, at least in our case.
If the browser is doing the processing, you don't need to modify sorlconfig.xml
for that, and where you put it depends a bit on where the HTML page that points
to the xsl came from.
What we did was create a separate directory called "search" in the webapp
directory (parallel to admin, WEB-INF and the like). In there we placed three
things: our HTML page, our .css file and our xsl. (That way, when Solr
updates, we know exactly how to handle it).
The HTML page refers to the xsl thusly:
<input name="stylesheet" type="hidden">
With a value of
/solr/search/ourXSLStyleSheet.xsl
(We use javascript to generate the HTML, so it isn't in the tag initially).
We started with a copy of example.xsl and modified it *extensively*. If you
are not a programmer, trying to edit the xsl to produce what you want may be
more adventure than you want to tackle.
JRU
-----Original Message-----
From: Jeremy Cunningham [mailto:[email protected]]
Sent: Thursday, October 13, 2011 2:43 PM
To: [email protected]
Subject: Xsl for query output
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