You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-dev@lucene.apache.org by "Lance Norskog (JIRA)" <ji...@apache.org> on 2009/08/10 02:14:14 UTC

[jira] Created: (SOLR-1354) Experimental new feature: allow out-of-the-box apps by passing HTTP request parameters through to XSL scripts

Experimental new feature: allow out-of-the-box apps by passing HTTP request parameters through to XSL scripts
-------------------------------------------------------------------------------------------------------------

                 Key: SOLR-1354
                 URL: https://issues.apache.org/jira/browse/SOLR-1354
             Project: Solr
          Issue Type: New Feature
          Components: search
         Environment: Any JDK from 1.5 onward. Any OS. Uses standard XSLTC 'compiled'-only version of Apache Xalan distributed with the JRE.
            Reporter: Lance Norskog
            Priority: Minor
         Attachments: rss2.patch

It is not possible to create a standard web application with the Solr distribution without coding in XSL, Ruby, HTML/Javascript etc.

This patch is an experiment that allows you to configure an RSS 2.0 feed through HTTP parameters. To do this, it supplies:
1) a change to XSLTWriter.java to pass an HTTP parameter named 'tr.name' through as an XSL parameter called 'name'. The XSL script must then declare 'name' as a global parameter.
2) example/solr/conf/xslt/rss2.xsl - a mostly complete implementation of RSS 2.0.
3) a sample <requestHandler> in example/solr/conf/solrconfig.xml which configures solr/rss2 as an RSS feed for the sample electronics store in example/solr. This <requestHandler> supplies all parameters for the RSS feed.


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SOLR-1354) Pass HTTP request parameters through to XSL scripts

Posted by "Erik Hatcher (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SOLR-1354?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12747382#action_12747382 ] 

Erik Hatcher commented on SOLR-1354:
------------------------------------

Currently the Velocity handler does not deal with HTTP headers.

It would be nice (and handy) to have HTTP headers pass through the SolrParams somehow.  It would be easy enough to pass them through as regular parameters, but should their name get prefixed (eg Accept header being named "_http_Accept" or something like that)?

However, it is debatable how this should work... should the client to Solr (arguably NOT the users browser directly) translate any useful header information into standard Solr get parameters?

> Pass HTTP request parameters through to XSL scripts
> ---------------------------------------------------
>
>                 Key: SOLR-1354
>                 URL: https://issues.apache.org/jira/browse/SOLR-1354
>             Project: Solr
>          Issue Type: New Feature
>          Components: search
>         Environment: Any JDK from 1.5 onward. Any OS. Uses standard XSLTC 'compiled'-only version of Apache Xalan distributed with the JRE.
>            Reporter: Lance Norskog
>            Priority: Minor
>         Attachments: rss2.patch
>
>
> It is not possible to create a standard web application with the Solr distribution without coding in XSL, Ruby, HTML/Javascript etc.
> This patch is an experiment that allows you to configure an RSS 2.0 feed through HTTP parameters. To do this, it supplies:
> 1) a change to XSLTWriter.java to pass an HTTP parameter named 'tr.name' through as an XSL parameter called 'name'. The XSL script must then declare 'name' as a global parameter.
> 2) example/solr/conf/xslt/rss2.xsl - a mostly complete implementation of RSS 2.0.
> 3) a sample <requestHandler> in example/solr/conf/solrconfig.xml which configures solr/rss2 as an RSS feed for the sample electronics store in example/solr. This <requestHandler> supplies all parameters for the RSS feed.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (SOLR-1354) Pass HTTP request parameters through to XSL scripts

Posted by "Lance Norskog (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SOLR-1354?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Lance Norskog updated SOLR-1354:
--------------------------------

    Summary: Pass HTTP request parameters through to XSL scripts  (was: Experimental new feature: allow out-of-the-box apps by passing HTTP request parameters through to XSL scripts)

> Pass HTTP request parameters through to XSL scripts
> ---------------------------------------------------
>
>                 Key: SOLR-1354
>                 URL: https://issues.apache.org/jira/browse/SOLR-1354
>             Project: Solr
>          Issue Type: New Feature
>          Components: search
>         Environment: Any JDK from 1.5 onward. Any OS. Uses standard XSLTC 'compiled'-only version of Apache Xalan distributed with the JRE.
>            Reporter: Lance Norskog
>            Priority: Minor
>         Attachments: rss2.patch
>
>
> It is not possible to create a standard web application with the Solr distribution without coding in XSL, Ruby, HTML/Javascript etc.
> This patch is an experiment that allows you to configure an RSS 2.0 feed through HTTP parameters. To do this, it supplies:
> 1) a change to XSLTWriter.java to pass an HTTP parameter named 'tr.name' through as an XSL parameter called 'name'. The XSL script must then declare 'name' as a global parameter.
> 2) example/solr/conf/xslt/rss2.xsl - a mostly complete implementation of RSS 2.0.
> 3) a sample <requestHandler> in example/solr/conf/solrconfig.xml which configures solr/rss2 as an RSS feed for the sample electronics store in example/solr. This <requestHandler> supplies all parameters for the RSS feed.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SOLR-1354) Pass HTTP request parameters through to XSL scripts

Posted by "Lance Norskog (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SOLR-1354?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12757705#action_12757705 ] 

Lance Norskog commented on SOLR-1354:
-------------------------------------

Hoss-

The XML response format only includes the params given on the HTTP url, not the params acquired defaults/invariants/appends.

Echoparams does not show the defaults/invariants/appends. This is good, because these additional parameters are a security feature that allows you to expose certain search features to customers.

So, the solrconfig.xml in the patch sets various RSS parameters and these cannot be brought into the output XML document. 

So, to make an RSS/ATOM/etc. xsl script that is programmable through params, the XSL transformer really must explicitly pass the parameters.

> Pass HTTP request parameters through to XSL scripts
> ---------------------------------------------------
>
>                 Key: SOLR-1354
>                 URL: https://issues.apache.org/jira/browse/SOLR-1354
>             Project: Solr
>          Issue Type: New Feature
>          Components: search
>         Environment: Any JDK from 1.5 onward. Any OS. Uses standard XSLTC 'compiled'-only version of Apache Xalan distributed with the JRE.
>            Reporter: Lance Norskog
>            Priority: Minor
>         Attachments: rss2.patch
>
>
> It is not possible to create a standard web application with the Solr distribution without coding in XSL, Ruby, HTML/Javascript etc.
> This patch is an experiment that allows you to configure an RSS 2.0 feed through HTTP parameters. To do this, it supplies:
> 1) a change to XSLTWriter.java to pass an HTTP parameter named 'tr.name' through as an XSL parameter called 'name'. The XSL script must then declare 'name' as a global parameter.
> 2) example/solr/conf/xslt/rss2.xsl - a mostly complete implementation of RSS 2.0.
> 3) a sample <requestHandler> in example/solr/conf/solrconfig.xml which configures solr/rss2 as an RSS feed for the sample electronics store in example/solr. This <requestHandler> supplies all parameters for the RSS feed.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SOLR-1354) Pass HTTP request parameters through to XSL scripts

Posted by "Lance Norskog (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SOLR-1354?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12757706#action_12757706 ] 

Lance Norskog commented on SOLR-1354:
-------------------------------------

Erik-

There are two places in the chain where this could happen:
1) solrconfig.xml has the variable substitute syntax.
2) inside each output transformer.

Inside solrconfig is interesting because then http headers can automatically become search terms. This would be really handy with the language/locale field.

> Pass HTTP request parameters through to XSL scripts
> ---------------------------------------------------
>
>                 Key: SOLR-1354
>                 URL: https://issues.apache.org/jira/browse/SOLR-1354
>             Project: Solr
>          Issue Type: New Feature
>          Components: search
>         Environment: Any JDK from 1.5 onward. Any OS. Uses standard XSLTC 'compiled'-only version of Apache Xalan distributed with the JRE.
>            Reporter: Lance Norskog
>            Priority: Minor
>         Attachments: rss2.patch
>
>
> It is not possible to create a standard web application with the Solr distribution without coding in XSL, Ruby, HTML/Javascript etc.
> This patch is an experiment that allows you to configure an RSS 2.0 feed through HTTP parameters. To do this, it supplies:
> 1) a change to XSLTWriter.java to pass an HTTP parameter named 'tr.name' through as an XSL parameter called 'name'. The XSL script must then declare 'name' as a global parameter.
> 2) example/solr/conf/xslt/rss2.xsl - a mostly complete implementation of RSS 2.0.
> 3) a sample <requestHandler> in example/solr/conf/solrconfig.xml which configures solr/rss2 as an RSS feed for the sample electronics store in example/solr. This <requestHandler> supplies all parameters for the RSS feed.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (SOLR-1354) Experimental new feature: allow out-of-the-box apps by passing HTTP request parameters through to XSL scripts

Posted by "Lance Norskog (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SOLR-1354?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Lance Norskog updated SOLR-1354:
--------------------------------

    Attachment: rss2.patch

> Experimental new feature: allow out-of-the-box apps by passing HTTP request parameters through to XSL scripts
> -------------------------------------------------------------------------------------------------------------
>
>                 Key: SOLR-1354
>                 URL: https://issues.apache.org/jira/browse/SOLR-1354
>             Project: Solr
>          Issue Type: New Feature
>          Components: search
>         Environment: Any JDK from 1.5 onward. Any OS. Uses standard XSLTC 'compiled'-only version of Apache Xalan distributed with the JRE.
>            Reporter: Lance Norskog
>            Priority: Minor
>         Attachments: rss2.patch
>
>
> It is not possible to create a standard web application with the Solr distribution without coding in XSL, Ruby, HTML/Javascript etc.
> This patch is an experiment that allows you to configure an RSS 2.0 feed through HTTP parameters. To do this, it supplies:
> 1) a change to XSLTWriter.java to pass an HTTP parameter named 'tr.name' through as an XSL parameter called 'name'. The XSL script must then declare 'name' as a global parameter.
> 2) example/solr/conf/xslt/rss2.xsl - a mostly complete implementation of RSS 2.0.
> 3) a sample <requestHandler> in example/solr/conf/solrconfig.xml which configures solr/rss2 as an RSS feed for the sample electronics store in example/solr. This <requestHandler> supplies all parameters for the RSS feed.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SOLR-1354) Pass HTTP request parameters through to XSL scripts

Posted by "Lance Norskog (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SOLR-1354?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12744943#action_12744943 ] 

Lance Norskog commented on SOLR-1354:
-------------------------------------

Ow! Heck. The multi-valued param feature is a good point. 

One problem that came up is localization - fetching the local dateformat and formatting dates in the RSS feed according to the caller's locale.  This would require pulling the incoming HTTP headers and feeding them to the XSL as parameters.

Are there other request handlers that could use parameters? For example, the Velocity handler? How can it localize Velocity applications without the HTTP local header?


> Pass HTTP request parameters through to XSL scripts
> ---------------------------------------------------
>
>                 Key: SOLR-1354
>                 URL: https://issues.apache.org/jira/browse/SOLR-1354
>             Project: Solr
>          Issue Type: New Feature
>          Components: search
>         Environment: Any JDK from 1.5 onward. Any OS. Uses standard XSLTC 'compiled'-only version of Apache Xalan distributed with the JRE.
>            Reporter: Lance Norskog
>            Priority: Minor
>         Attachments: rss2.patch
>
>
> It is not possible to create a standard web application with the Solr distribution without coding in XSL, Ruby, HTML/Javascript etc.
> This patch is an experiment that allows you to configure an RSS 2.0 feed through HTTP parameters. To do this, it supplies:
> 1) a change to XSLTWriter.java to pass an HTTP parameter named 'tr.name' through as an XSL parameter called 'name'. The XSL script must then declare 'name' as a global parameter.
> 2) example/solr/conf/xslt/rss2.xsl - a mostly complete implementation of RSS 2.0.
> 3) a sample <requestHandler> in example/solr/conf/solrconfig.xml which configures solr/rss2 as an RSS feed for the sample electronics store in example/solr. This <requestHandler> supplies all parameters for the RSS feed.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SOLR-1354) Pass HTTP request parameters through to XSL scripts

Posted by "Hoss Man (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SOLR-1354?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12744774#action_12744774 ] 

Hoss Man commented on SOLR-1354:
--------------------------------

Lance: the topic of XSL params came up once upon a time, and before anyone ever got around to implementing it, someone pointed out that using echoParams you could get all of the params into the XML so that the template had access to them.

you've already written the code to convert params to xsl:params ... using echoParams still seems like it's more generally useful, because it can work with any param, and allows for multi-valued params as well (giving the tempalte the power to use the first, or all).

Is there any significant advantage you see to adding xsl:param support that echoParams *can't* handle?

> Pass HTTP request parameters through to XSL scripts
> ---------------------------------------------------
>
>                 Key: SOLR-1354
>                 URL: https://issues.apache.org/jira/browse/SOLR-1354
>             Project: Solr
>          Issue Type: New Feature
>          Components: search
>         Environment: Any JDK from 1.5 onward. Any OS. Uses standard XSLTC 'compiled'-only version of Apache Xalan distributed with the JRE.
>            Reporter: Lance Norskog
>            Priority: Minor
>         Attachments: rss2.patch
>
>
> It is not possible to create a standard web application with the Solr distribution without coding in XSL, Ruby, HTML/Javascript etc.
> This patch is an experiment that allows you to configure an RSS 2.0 feed through HTTP parameters. To do this, it supplies:
> 1) a change to XSLTWriter.java to pass an HTTP parameter named 'tr.name' through as an XSL parameter called 'name'. The XSL script must then declare 'name' as a global parameter.
> 2) example/solr/conf/xslt/rss2.xsl - a mostly complete implementation of RSS 2.0.
> 3) a sample <requestHandler> in example/solr/conf/solrconfig.xml which configures solr/rss2 as an RSS feed for the sample electronics store in example/solr. This <requestHandler> supplies all parameters for the RSS feed.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SOLR-1354) Pass HTTP request parameters through to XSL scripts

Posted by "Erik Hatcher (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SOLR-1354?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12757771#action_12757771 ] 

Erik Hatcher commented on SOLR-1354:
------------------------------------

Lance - echoparams=all indeed does echo out invariants and appends from the request handler config.  So your comment about security isn't accurate.  Also, the entire solrconfig.xml is available over HTTP through the file request handler anyway, making everything there exposed (which could be turned off, yes).



> Pass HTTP request parameters through to XSL scripts
> ---------------------------------------------------
>
>                 Key: SOLR-1354
>                 URL: https://issues.apache.org/jira/browse/SOLR-1354
>             Project: Solr
>          Issue Type: New Feature
>          Components: search
>         Environment: Any JDK from 1.5 onward. Any OS. Uses standard XSLTC 'compiled'-only version of Apache Xalan distributed with the JRE.
>            Reporter: Lance Norskog
>            Priority: Minor
>         Attachments: rss2.patch
>
>
> It is not possible to create a standard web application with the Solr distribution without coding in XSL, Ruby, HTML/Javascript etc.
> This patch is an experiment that allows you to configure an RSS 2.0 feed through HTTP parameters. To do this, it supplies:
> 1) a change to XSLTWriter.java to pass an HTTP parameter named 'tr.name' through as an XSL parameter called 'name'. The XSL script must then declare 'name' as a global parameter.
> 2) example/solr/conf/xslt/rss2.xsl - a mostly complete implementation of RSS 2.0.
> 3) a sample <requestHandler> in example/solr/conf/solrconfig.xml which configures solr/rss2 as an RSS feed for the sample electronics store in example/solr. This <requestHandler> supplies all parameters for the RSS feed.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SOLR-1354) Experimental new feature: allow out-of-the-box apps by passing HTTP request parameters through to XSL scripts

Posted by "Lance Norskog (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SOLR-1354?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12741157#action_12741157 ] 

Lance Norskog commented on SOLR-1354:
-------------------------------------

This experiment has two aims:
1) It should be possible to send in an HTTP request that creates an RSS2.0 feed for any Solr index.
2) The rss2.xsl script should give a handy starting point for other XSL scripts, giving an easily altered style for XSL's weirdly limited tools.

Parameters are name 'tr.param='. This convention made sense as 'tr=' gives the name of the XSL script.

There a few holes in the RSS 2.0 implementation. They are listed in the header text of rss2.xsl. The RSS2.0 standard is from http://cyber.law.harvard.edu/rss/rss.html by Dave Winer. (Yeah, yeah.) An ATOM 1.0 version is left as an exercise for the unwary.



> Experimental new feature: allow out-of-the-box apps by passing HTTP request parameters through to XSL scripts
> -------------------------------------------------------------------------------------------------------------
>
>                 Key: SOLR-1354
>                 URL: https://issues.apache.org/jira/browse/SOLR-1354
>             Project: Solr
>          Issue Type: New Feature
>          Components: search
>         Environment: Any JDK from 1.5 onward. Any OS. Uses standard XSLTC 'compiled'-only version of Apache Xalan distributed with the JRE.
>            Reporter: Lance Norskog
>            Priority: Minor
>         Attachments: rss2.patch
>
>
> It is not possible to create a standard web application with the Solr distribution without coding in XSL, Ruby, HTML/Javascript etc.
> This patch is an experiment that allows you to configure an RSS 2.0 feed through HTTP parameters. To do this, it supplies:
> 1) a change to XSLTWriter.java to pass an HTTP parameter named 'tr.name' through as an XSL parameter called 'name'. The XSL script must then declare 'name' as a global parameter.
> 2) example/solr/conf/xslt/rss2.xsl - a mostly complete implementation of RSS 2.0.
> 3) a sample <requestHandler> in example/solr/conf/solrconfig.xml which configures solr/rss2 as an RSS feed for the sample electronics store in example/solr. This <requestHandler> supplies all parameters for the RSS feed.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.