[jira] Updated: (SOLR-49) PATCH: XSLTServletFilter

2006-10-16 Thread Bertrand Delacretaz (JIRA)
 [ http://issues.apache.org/jira/browse/SOLR-49?page=all ]

Bertrand Delacretaz updated SOLR-49:


Attachment: solr-XSLTResponseWriter-20061016.tar.gz

Here's the latest incarnation, using a more Solrish way of initializing the 
response writer. 

The solr-XSLTResponseWriter-20061016.tar.gz attachment replaces all the 
previous patches.

I have added an init(NamedList args) method to the QueryResponseWriter 
(solr-49.patch in the attached file), which means that the solrconfig.xml part 
has changed:

!--
XSLT response writer (SOLR-49)
Changes to XSLT transforms are taken into account every  
xsltCacheLifetimeSeconds at most.
   --
  queryResponseWriter
name=xslt
class=org.apache.solr.request.XSLTResponseWriter
   
 int name=xsltCacheLifetimeSeconds5/int
   /queryResponseWriter 

Apart from that, the patch works as indicated in my previous comment.

 PATCH: XSLTServletFilter
 

 Key: SOLR-49
 URL: http://issues.apache.org/jira/browse/SOLR-49
 Project: Solr
  Issue Type: New Feature
  Components: search
 Environment: Tested on macosx 10.4.7, JDK 1.5.0_06
Reporter: Bertrand Delacretaz
Priority: Minor
 Attachments: solr-XSLTResponseWriter-20060922.tar.gz, 
 solr-XSLTResponseWriter-20061016.tar.gz, 
 solr-XSLTResponseWriter-files.tar.gz, xslt-filter-files.tar.gz


 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=usagetransform=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-namexslt/filter-name
 filter-classorg.apache.solr.xslt.XSLTServletFilter/filter-class
   /filter
   !-- apply the XSLT filter when select/html is used to make queries --  
   filter-mapping
 filter-namexslt/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.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira




Re: [jira] Updated: (SOLR-49) PATCH: XSLTServletFilter

2006-09-26 Thread Chris Hostetter

: Attachment: solr-XSLTResponseWriter-20060922.tar.gz

I finally got a chance to look at this tonight, i like it, but the big
thing thta jumped out at me was the configuration...

Since this QueryResponseWriter has use of configuration options, now is
probably the time to add an init(NamedList) method to the interface that
get's called with a upon construction by SolrCore just like
SolrRequestHandler (using DOMUtils.nodesToNamedList) ... that will have
the added benefit of allowing response writers to have defaults that can
be overriden by the defaults of the request handler *or* by query time
params.

FYI: an alternate approach to caching the Templates object in the
TransformProvider would be to use the SolrCache framework -- the
LRUCache doesn't currently have a notion of timed expiration but we
could just re-check the file modification in a CacheRegenertor and
document that the xsl files are only checked on commit.  (which may be a
better meme in general now that i think about).


-Hoss



Re: [jira] Updated: (SOLR-49) PATCH: XSLTServletFilter

2006-09-26 Thread Bertrand Delacretaz

On 9/26/06, Chris Hostetter [EMAIL PROTECTED] wrote:


...Since this QueryResponseWriter has use of configuration options, now is
probably the time to add an init(NamedList) method to the interface that
get's called with a upon construction by SolrCore...


I'm wondering if moving to a lightweight object container
(picocontainer, Spring, HiveMind...) to assemble and configure Solr's
components wouldn't make sense at some point...it might be too much
work right now, but I can't help thinking that there's some
reinvention going on here.


...FYI: an alternate approach to caching the Templates object in the
TransformProvider would be to use the SolrCache framework...


Ok - I'll have a look, thanks!

-Bertrand


Re: [jira] Updated: (SOLR-49) PATCH: XSLTServletFilter

2006-09-26 Thread Yonik Seeley

On 9/26/06, Bertrand Delacretaz [EMAIL PROTECTED] wrote:

On 9/26/06, Chris Hostetter [EMAIL PROTECTED] wrote:

 ...Since this QueryResponseWriter has use of configuration options, now is
 probably the time to add an init(NamedList) method to the interface that
 get's called with a upon construction by SolrCore...

I'm wondering if moving to a lightweight object container
(picocontainer, Spring, HiveMind...) to assemble and configure Solr's
components wouldn't make sense at some point...it might be too much
work right now, but I can't help thinking that there's some
reinvention going on here.


There certainly is reinvention going on... it's just too easy to keep
making incremental changes at this point.

http://www.nabble.com/solr-configuration-path-change-tf1286821.html#a3422968
http://www.nabble.com/XML-Query-tf1407548.html#a3809517
http://www.nabble.com/Fwd%3A-Microkernal-architecture-%28was-Re%3A-XML-Query%29-tf1416310.html#a3817176

-Yonik


[jira] Updated: (SOLR-49) PATCH: XSLTServletFilter

2006-09-23 Thread Bertrand Delacretaz (JIRA)
 [ http://issues.apache.org/jira/browse/SOLR-49?page=all ]

Bertrand Delacretaz updated SOLR-49:


Attachment: solr-XSLTResponseWriter-20060922.tar.gz

Here's yet another version which takes the Content-Type from the XSLT transform.

The code and these instructions replace the previous versions:

Must be configured like this in solrconfig.xml:

  !-- 
XSLT response writer (SOLR-49)
Changes to XSLT transforms are taken into account every 
xsltCacheLifetimeSeconds at most.
   --
  queryResponseWriter 
name=xslt 
class=org.apache.solr.request.XSLTResponseWriter
xsltCacheLifetimeSeconds=5
  /

The following request parameters activate the XSLTResponseWriter:

  wt = xslt
  tr = my-xslt-transform.xsl

The Content-Type comes from the xsl:output element of the XSLT transform:

xsl:output media-type=text/html/

And finally, the TransformerProvider warns about the possible performance 
implications of its simplistic cache, when first used:

  ATTENTION: The TransformerProvider's simplistic XSLT caching mechanism is 
  not appropriate for high load scenarios, unless a single XSLT transform is 
used 
  and xsltCacheLifetimeSeconds is set to a sufficiently high value.

 PATCH: XSLTServletFilter
 

 Key: SOLR-49
 URL: http://issues.apache.org/jira/browse/SOLR-49
 Project: Solr
  Issue Type: New Feature
  Components: search
 Environment: Tested on macosx 10.4.7, JDK 1.5.0_06
Reporter: Bertrand Delacretaz
Priority: Minor
 Attachments: solr-XSLTResponseWriter-20060922.tar.gz, 
 solr-XSLTResponseWriter-files.tar.gz, xslt-filter-files.tar.gz


 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=usagetransform=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-namexslt/filter-name
 filter-classorg.apache.solr.xslt.XSLTServletFilter/filter-class
   /filter
   !-- apply the XSLT filter when select/html is used to make queries --  
   filter-mapping
 filter-namexslt/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.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira




[jira] Updated: (SOLR-49) PATCH: XSLTServletFilter

2006-09-14 Thread Bertrand Delacretaz (JIRA)
 [ http://issues.apache.org/jira/browse/SOLR-49?page=all ]

Bertrand Delacretaz updated SOLR-49:


Attachment: xslt-filter-files.tar.gz

New files

 PATCH: XSLTServletFilter
 

 Key: SOLR-49
 URL: http://issues.apache.org/jira/browse/SOLR-49
 Project: Solr
  Issue Type: New Feature
  Components: search
 Environment: Tested on macosx 10.4.7, JDK 1.5.0_06
Reporter: Bertrand Delacretaz
Priority: Minor
 Attachments: xslt-filter-files.tar.gz


 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=usagetransform=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-namexslt/filter-name
 filter-classorg.apache.solr.xslt.XSLTServletFilter/filter-class
   /filter
   !-- apply the XSLT filter when select/html is used to make queries --  
   filter-mapping
 filter-namexslt/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.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira