sakaiproject/nakamura — pull request #366 by ctweney (2011-10-21 20:05:17+00:00)
Title: KERN-2266 Add tag clouds to solr searches; improve SolrSearchServlet

In my implementation I've made it possible to ask Solr for faceting fields. You do this on the search template as part of the sakai:query-template-options property, like so:

"sakai:query-template-options": {
"sort": "${sortOn} ${sortOrder}",
"facet" : true,
"facet.field" : "tag"
}

The response from SolrSearchServlet looks like so:

{
"items": 12,
"results": [
... many results snipped ...
],
"facet_fields": [{
"tag": {
"foo": 2,
"bork": 1
}
}
],
"total": 3
}

You can facet on more than one field, as long as you are faceting on fields that are in the Solr index:

"sakai:query-template-options": {
"sort": "${sortOn} ${sortOrder}",
"facet" : true,
"facet.field" : [ "tag", "name" ]
}

Along the way I refactored SolrSearchServlet to make its collections of various helpers cleaner and less duplicative. You can also have more than 1 response decorator.

Git commit msg:

commit 7bbda000a1f2b9f498b3d1ec186d17eebc0a2c6a
Author: Chris Tweney
Date: Fri Oct 21 13:00:32 2011 -0700

KERN-2266 Support generic facet fields in solr searches; update search templates to ask for tag facets

commit 4bb020f36357fed636130d2e9c2bd162d142fc26
Author: Chris Tweney
Date: Fri Oct 21 09:56:00 2011 -0700

KERN-2266 Move search helper trackers to solr search impl folder

commit c3450697fd92f18ef95ba03b369bd9e1c379e297
Merge: c3b0752 ad20a34
Author: Chris Tweney
Date: Fri Oct 21 09:06:14 2011 -0700

Merge remote branch 'central/master' into kern-2266-wip

* central/master:
KERN-2210 - adding use of ConnectionManager to ProfileServlet and added integration test for authprofile feed
NOJIRA Added metatype=true to service. Minor formatting
KERN-2095 Have RequestInfo parse URL parameters if supplied.
NOJIRA make preview_processor run as a daemon
KERN-2292 fix artifact id of files.impl bundle.
KERN-2292 update list.xml to use the two new bundles
KERN-2292 create an API and impl bundle for the files module, permitting hot redeploy
NOJIRA Updated refs to 1.1-SNAPSHOT from 0.11-SNAPSHOT
KERN-2290 Removed local httpclient bundle and added servicemix's bundle. Changed ref in captcha bundle to point to httpclient dep.
fix problems of OSGI property
KERN-2254 - fixing the issues Carl documented in pull request comments
KERN-2254 squash commit of search and bundle splitting after merge with master
NOJIRA removing redundant dependency declaration for commons.json
using OSGI property to config isHierarchical
KERN-2265: support 2 types of IMS-CP import

commit c3b075284e062e11dc83c399ca80b5c71720756e
Author: Chris Tweney
Date: Fri Oct 21 06:11:20 2011 -0700

KERN-2266 Add tagcloud support to SolrSearchResultSet

commit 37bc5c16121d3010e8b80a7fa76e76fc372c768d
Author: Chris Tweney
Date: Fri Oct 14 15:40:22 2011 -0700

KERN-2266 Separate SearchResultDecorator from SearchResultProcessor, and allow multiple decorators on a single node

commit 97f9d72926e0c15c4121e7280078ef7093290775
Author: Chris Tweney
Date: Fri Oct 14 10:56:35 2011 -0700

KERN-2266 Use the new tracker pattern to track SearchPropertyProviders

commit 15764ee74c8fd372e76a707f1bc47732c11842e2
Author: Chris Tweney
Date: Fri Oct 14 10:43:33 2011 -0700

KERN-2266 Introduce the DelayedSolrSearchServletHelperTracker in case it's ever useful; use the helpertrackers in SolrSearchServlet

commit eadd2659399c7dfd49676ae6554a5fc3e4e56ee0
Author: Chris Tweney
Date: Fri Oct 14 10:00:08 2011 -0700

KERN-2266 Simpler version of the helper tracker; rolled back some of the SolrSearchServlet changes until I can verify all behavior

commit 899ffc6814ca563ed0621f88f4d4743ae70fa814
Author: Chris Tweney
Date: Thu Oct 13 16:06:21 2011 -0700

KERN-2266 Refactor the processor and batchProcessor tracking code into SolrSearchServletHelperTracker instances; not everything works correctly yet, but this shows the pattern

commit 2cbc9dc895983cacb4b2ec70cfe7ffc0f0af0970
Author: Chris Tweney
Date: Thu Oct 13 11:45:07 2011 -0700

KERN-2266 Clean up warnings and useless comments in SolrSearchServlet