Dear Wiki user, You have subscribed to a wiki page or wiki category on "Solr Wiki" for change notification.
The "XsltUpdateRequestHandler" page has been changed by JanHoydahl: http://wiki.apache.org/solr/XsltUpdateRequestHandler?action=diff&rev1=3&rev2=4 Comment: Better documentation - TODO: Write a better documentation + The XSLT UpdateRequestHandler lets you index arbitrary XML documents to Solr using on-the-fly XSLT transformation to Solr's update XML. + <!> [[Solr3.4]] - == Quickstart == - * Download a search result. Remove the first <?xml....> line. Let's call it searchres.xml - * Create an XSL for your transformation. Here is one which transforms our search results: http://dl.dropbox.com/u/20080302/updateXml.xsl - * Feed your data through XSLT update handler: - * curl "http://localhost:8983/solr/update/xslt?commit=true&tr=updateXml.xsl" -H "Content-Type: text/xml; charset=utf-8" + <<TableOfContents>> + + == Requirements == + <!> [[Solr3.4]] is the first version with XSLT support for updates. + + The XSLT request handler needs to be configured in solrconfig.xml + This should already be present in the example solrconfig.xml + {{{ + <!-- XSLT Update Request Handler + Transforms incoming XML with stylesheet identified by tr= + --> + <requestHandler name="/update/xslt" + startup="lazy" + class="solr.XsltUpdateRequestHandler"/> + }}} + + == Methods of uploading XML files == + An arbitrary XML for which you have a transformation stylesheet may be uploaded to Solr by sending the data to the {{{/solr/update/xslt}}} URL, and specifying the stylesheet in the {{{&tr=mySheet.xsl}}} parameter. + All of the normal methods for [[ContentStream|uploading content]] are supported. + + == Examples == + + === Transform query result XML === + Indexing a Solr XML query result file. This could be an export from an older search index that you want to migrate. For this we have a style sheet updateXml.xsl which was new in <!> [[Solr3.6]] + 1. Download the search result xml, let's call it "queryresult.xml" + 2. Feed your data through XSLT update handler selecting the correct style sheet + {{{ + curl "http://localhost:8983/solr/update/xslt?commit=true&tr=updateXml.xsl" -H "Content-Type: text/xml; charset=utf-8" --data-binary @queryresult.xml + }}} +
