Have you looked to http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-facets.html to make the ElasticSearch integration easy in the future?