lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Walter Lewis <lew...@hhpl.on.ca>
Subject Re: solr + cocoon problem
Date Tue, 16 Jan 2007 21:19:32 GMT
mirko@sas.upenn.edu 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.

Walter


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

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

            <cinclude:includexml>
                
<cinclude:src>http://localhost:8080/solr/select?q=<xsl:value-of 
select='$q' />&amp;start=<xsl:value-of select='$start' 
/>&amp;rows=<xsl:value-of select='$rows' />
                </cinclude:src>
            </cinclude:includexml>



Mime
View raw message