nested facets search

Showing results for 
Search instead for 
Did you mean: 
Active Member

nested facets search

Hi forum,

I wanted to check few stats of my repo, and I wanted to use facets to extract informartion about 'region' and 'type' of my documents. Both properties, 'type' and 'region' are part of document model.

Apparently, that would be possible with pivot facets. I tried various approcahes, form code and from solr web console but all i get is result for the first level (number of documents by region). I would also like to see count of each type in every region. Shortened response of my best try is this query:


which produces this result:


"_pivot_mappings_": {
"ns:region,ns:type": "text@s__lt@{}region,text@s__lt@{}type"

"facet.pivot": "ns:region,ns:type",

"facet_counts": { "facet_intervals": {}, "facet_pivot": { "ns:region,ns:type": [ { "field": "ns:region", "count": 479, "value": "{en}hk" }, { "field": "ns:region", "count": 120, "value": "{en}gk" }, { "field": "ns:region", "count": 5, "value": "{en}oc" }, { "field": "ns:region", "count": 2, "value": "{en}dep" }, ] }, "facet_queries": {}, "facet_fields": {}, "facet_heatmaps": {}, "facet_ranges": {} },

So, no data for the type.

In this example, facets are nested, as I expect them to be, but I am not able to get  such result. Am i doing something wrong?

Please give some hints. Thank you.










1 Reply
Active Member

Re: nested facets search

In order for it to work, fileds must be decalred as facetable in the content model.

<property name="ns:region">
  <mandatory enforced="true">true</mandatory>
  <index enabled="true">