Solr
  1. Solr
  2. SOLR-3059

Provide example for XSLTUpdateRequest

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Trivial Trivial
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.6, 4.0-ALPHA
    • Component/s: update
    • Labels:
      None

      Description

      The XSLT update handler is poorly documented, and http://wiki.apache.org/solr/XsltUpdateRequestHandler should be improved

      Also, there should be an example stylesheet in the conf/xslt folder

      1. SOLR-3059.patch
        3 kB
        Jan Høydahl

        Activity

        Hide
        Jan Høydahl added a comment -

        Attaching simple stylesheet "updateXml.xsl" which will transform a search result to Solr's Update Xml syntax. One use case is to dump a Solr1.3 index (which does not have CSV response writer) into a format which can be indexed into another Solr (provided that all fields are stored):

        http://localhost:8983/solr/select?q=*:*&wt=xslt&tr=updateXml.xsl&rows=1000
        

        It can of cours also be used in XsltUpdateRequestHandler to transform when updating:

        curl "http://localhost:8983/solr/update/xslt?commit=true&tr=updateXml.xsl" -H "Content-Type: text/xml; charset=utf-8" --data-binary @queryresult.xml
        
        Show
        Jan Høydahl added a comment - Attaching simple stylesheet "updateXml.xsl" which will transform a search result to Solr's Update Xml syntax. One use case is to dump a Solr1.3 index (which does not have CSV response writer) into a format which can be indexed into another Solr (provided that all fields are stored): http://localhost:8983/solr/select?q=*:*&wt=xslt&tr=updateXml.xsl&rows=1000 It can of cours also be used in XsltUpdateRequestHandler to transform when updating: curl "http://localhost:8983/solr/update/xslt?commit=true&tr=updateXml.xsl" -H "Content-Type: text/xml; charset=utf-8" --data-binary @queryresult.xml
        Hide
        Jan Høydahl added a comment -
        Show
        Jan Høydahl added a comment - Updated the WIKI page: http://wiki.apache.org/solr/XsltUpdateRequestHandler
        Hide
        Jan Høydahl added a comment -

        Will commit this trivial improvement in a day or two

        Show
        Jan Høydahl added a comment - Will commit this trivial improvement in a day or two

          People

          • Assignee:
            Jan Høydahl
            Reporter:
            Jan Høydahl
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development