Search code examples
riak

Can Riak do facet queries?


Riak has both secondary indexes and (solr-ish) search.

But can it do faceted searches like Solr does? That is:

  1. fetch facets that are applicable to the results returned
  2. drill down into facets by contraining facet values
  3. bucket the ranges (eg: cities that start with a C)

Solution

  • Solr-compatible interface of Riak is more like a marketing feature, than actually usable in real applications. Secondary indices are simple exact match and value range queries. So out-of-the-box Riak can not do it, some time ago it was clearly stated in official wiki, but that sentance is gone, only some traces left: http://news.ycombinator.com/item?id=2377680.

    But this functionality can be quite easily implemented using MapReduce with search results as input or simply on client by running through search results and generating data structure with possible filters and counts of available items matching that criteria.