Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.1.0
    • Component/s: search
    • Labels:
      None
    • Environment:

      Tested on macosx 10.4.7, JDK 1.5.0_06

      Description

      Patch that implements server-side XSLT transforms of query results.

      The filter is activated by using select/html instead of select/ to run queries, and optionally adding a transform parameter to specify the XSLT transform to use, for example:

      http://localhost:8983/solr/select/html?q=usage&transform=my.xsl

      In which case my.xsl should be found in solr/conf/xslt/ with the example configuration. The default transform (solr/conf/xslt/query-to-html.xsl) outputs a simplistic HTML format.

      Performance is suboptimal, as the filter reparses the XML output generated by Solr. Modifying the XMLWriter to output to a ContentHandler would be more efficient, but I didn't have time to go that far.

      The TransformerProvider trivially caches the last Transformer used, could be improved using an LRU cache of several transformers, I haven't checked if Solr's infrastructure contains such an animal already.

      The patch is all new files, except for adding this in web.xml before the first <servlet>:

      <filter>
      <filter-name>xslt</filter-name>
      <filter-class>org.apache.solr.xslt.XSLTServletFilter</filter-class>
      </filter>

      <!-- apply the XSLT filter when select/html is used to make queries -->
      <filter-mapping>
      <filter-name>xslt</filter-name>
      <url-pattern>/select/html/*</url-pattern>
      </filter-mapping>

      I've left the client-side XSLT stuff (stylesheet parameter) as is for the moment.

      1. xslt-filter-files.tar.gz
        3 kB
        Bertrand Delacretaz
      2. solr-XSLTResponseWriter-files.tar.gz
        2 kB
        Bertrand Delacretaz
      3. solr-XSLTResponseWriter-20060922.tar.gz
        4 kB
        Bertrand Delacretaz
      4. solr-XSLTResponseWriter-20061016.tar.gz
        5 kB
        Bertrand Delacretaz
      5. SOLR-49.diff
        21 kB
        Hoss Man

        Activity

        Bertrand Delacretaz created issue -
        Bertrand Delacretaz made changes -
        Field Original Value New Value
        Attachment xslt-filter-files.tar.gz [ 12340851 ]
        Bertrand Delacretaz made changes -
        Attachment solr-XSLTResponseWriter-files.tar.gz [ 12341198 ]
        Bertrand Delacretaz made changes -
        Attachment solr-XSLTResponseWriter-20060922.tar.gz [ 12341455 ]
        Bertrand Delacretaz made changes -
        Attachment solr-XSLTResponseWriter-20061016.tar.gz [ 12342985 ]
        Hoss Man made changes -
        Assignee Hoss Man [ hossman ]
        Hoss Man made changes -
        Attachment SOLR-49.diff [ 12343110 ]
        Hoss Man made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Hoss Man made changes -
        Fix Version/s 1.1.0 [ 12312234 ]
        Uwe Schindler made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

          • Assignee:
            Hoss Man
            Reporter:
            Bertrand Delacretaz
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development