On Thu, 26 May 2016, at 01:02 PM, Zaccheo Bagnati wrote: > Hi all, > I have a SOLR core containing documents: > document (id, type, text) > and a core containing annotations (each document has 0 or more > annotations): > annotation (id, document_id, user, text) > > I can filter annotations on document fields using JoinQueryParser but how > can I create a faceting? Let's say I want to build a faceting on > document.type counting how many annotations there are per each document > type. > how would you deal with such a case in SOLR? Is there a better data > design > to obtain that result?
Just do the facet query on the annotations collection. A pivot facet on document id and type would give you what you want. Or, use a join to the docs collection to limit the number of documents you are faceting on.