Search code examples
ruby-on-railsrubysolrsunspotrsolr

Fetch top terms with sunspot


solr have a admin console like

http://localhost:8982/solr/admin/schema.jsp

which provides some schema fields data like top terms and freq for specific field.

I am using sunspot, and how to query data like this? like TOP 10 terms


Solution

  • Not sure for Sunspot but check for Solr TermsComponent which will allow you to retrieve the top terms with the frequency from a field.