lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Walter Lewis <>
Subject Re: solr + cocoon problem
Date Tue, 16 Jan 2007 21:19:32 GMT wrote:
> Any ideas on how to implement a cocoon layer above solr?
You're far from the only one approaching solr via cocoon ... :)

The approach we took, passes the search parameters to a "solrsearch" 
stylesheet, the heart of which is a <cinclude> block that embeds the 
solr results.  A further transformation prepares the results of the solr 
query for display.

The latest rewrite is getting more complicated as we work in flowscript 
to manipulate the values more before presenting them to solr, but the 
heart of the solution is below.


==== From the sitemap.xmap =====
    <map:match pattern="results">
        <map:generate type="request">
            <map:parameter name="generate-attributes" value="true"/>
        <map:transform type="xslt" src="style/solrsearch.xsl">
            <map:parameter name="use-request-parameters" value="true"/>
        <map:transform type="cinclude" />
        <map:transform type="xslt" src="style/search_result.xsl" />
        <map:serialize type="html"/>

=== From solrsearch.xsl ====
[assuming parameters of q, start and rows]

select='$q' />&amp;start=<xsl:value-of select='$start' 
/>&amp;rows=<xsl:value-of select='$rows' />

View raw message