SOLR-2178: Hook in Carrot2 clustering to /browse

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1027743 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Grant Ingersoll 2010-10-26 20:56:46 +00:00
parent df1908187e
commit 0f52c2de16
4 changed files with 30 additions and 0 deletions

View File

@ -871,6 +871,14 @@
<!--<int name="carrot.numDescriptions">5</int>-->
<!-- produce sub clusters -->
<bool name="carrot.outputSubClusters">false</bool>
<str name="defType">edismax</str>
<str name="qf">
text^0.5 features^1.0 name^1.2 sku^1.5 id^10.0 manu^1.1 cat^1.4
</str>
<str name="q.alt">*:*</str>
<str name="rows">10</str>
<str name="fl">*,score</str>
</lst>
<arr name="last-components">
<str>clusteringComponent</str>

View File

@ -0,0 +1,9 @@
<h2 #annTitle("Clusters generated by Carrot2 using the /clustering RequestHandler")>Clusters</h2>
<div id="clusters">
Run Solr with java -Dsolr.clustering.enabled=true -jar start.jar to see results
</div>
<script type="text/javascript">
$('#clusters').load("#url_for_solr/clustering#lens",
{'wt':'velocity', 'v.template':"clusterResults"});
</script>

View File

@ -0,0 +1,12 @@
#foreach ($clusters in $response.response.clusters)
#set($labels = $clusters.get('labels'))
#set($docs = $clusters.get('docs'))
<h3>#foreach ($label in $labels)$label#if( $foreach.hasNext ),#end#end</h3>
<ol>
#foreach ($cluDoc in $docs)
<li><a href="#url_for_home?q=id:$cluDoc">$cluDoc</a></li>
#end
</ol>
#end

View File

@ -3,6 +3,7 @@
#parse('facet_ranges.vm')
#parse('facet_dates.vm')
#parse('facet_pivot.vm')
#parse('cluster.vm')