<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic nested facets search in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/nested-facets-search/m-p/137944#M37004</link>
    <description>&lt;P&gt;Hi forum,&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;Apparently, that would be possible with pivot &lt;A href="https://hub.alfresco.com/t5/alfresco-content-services-blog/basic-content-reporting-using-the-5-2-1-search-api/ba-p/288718#toc-hId--1585172092" target="_self" rel="nofollow noopener noreferrer"&gt;facets.&lt;/A&gt; 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:&lt;/P&gt;&lt;PRE&gt;http://localhost:8983/solr/alfresco/select?facet.pivot=ns:region,ns:type&amp;amp;facet=true&amp;amp;indent=on&amp;amp;q=TYPE:ns\:caseFile&amp;amp;rows=0&amp;amp;start=0&amp;amp;wt=json&lt;/PRE&gt;&lt;P&gt;which produces this result:&lt;/P&gt;&lt;PRE&gt;  ....&lt;BR /&gt;&lt;BR /&gt;"_pivot_mappings_": {&lt;BR /&gt;"ns:region,ns:type": "text@s__lt@{http://xxx.eu/model/1.0}region,text@s__lt@{http://xxx.eu/model/1.0}type"&lt;BR /&gt;},&lt;BR /&gt;&lt;BR /&gt;"facet.pivot": "ns:region,ns:type",&lt;BR /&gt;...&lt;BR /&gt;&lt;BR /&gt;  "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": {}
  },&lt;/PRE&gt;&lt;P&gt;So, no data for the type.&lt;/P&gt;&lt;P&gt;In &lt;A href="https://javadeveloperzone.com/solr/solr-pivot-faceting-example/" target="_self" rel="nofollow noopener noreferrer"&gt;this&lt;/A&gt; example, facets are nested, as I expect them to be, but I am not able to get&amp;nbsp; such result. Am i doing something wrong?&lt;/P&gt;&lt;P&gt;Please give some hints. Thank you.&lt;/P&gt;&lt;P&gt;Dario&lt;/P&gt;</description>
    <pubDate>Mon, 13 Sep 2021 21:09:29 GMT</pubDate>
    <dc:creator>darionis</dc:creator>
    <dc:date>2021-09-13T21:09:29Z</dc:date>
    <item>
      <title>nested facets search</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/nested-facets-search/m-p/137944#M37004</link>
      <description>&lt;P&gt;Hi forum,&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;Apparently, that would be possible with pivot &lt;A href="https://hub.alfresco.com/t5/alfresco-content-services-blog/basic-content-reporting-using-the-5-2-1-search-api/ba-p/288718#toc-hId--1585172092" target="_self" rel="nofollow noopener noreferrer"&gt;facets.&lt;/A&gt; 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:&lt;/P&gt;&lt;PRE&gt;http://localhost:8983/solr/alfresco/select?facet.pivot=ns:region,ns:type&amp;amp;facet=true&amp;amp;indent=on&amp;amp;q=TYPE:ns\:caseFile&amp;amp;rows=0&amp;amp;start=0&amp;amp;wt=json&lt;/PRE&gt;&lt;P&gt;which produces this result:&lt;/P&gt;&lt;PRE&gt;  ....&lt;BR /&gt;&lt;BR /&gt;"_pivot_mappings_": {&lt;BR /&gt;"ns:region,ns:type": "text@s__lt@{http://xxx.eu/model/1.0}region,text@s__lt@{http://xxx.eu/model/1.0}type"&lt;BR /&gt;},&lt;BR /&gt;&lt;BR /&gt;"facet.pivot": "ns:region,ns:type",&lt;BR /&gt;...&lt;BR /&gt;&lt;BR /&gt;  "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": {}
  },&lt;/PRE&gt;&lt;P&gt;So, no data for the type.&lt;/P&gt;&lt;P&gt;In &lt;A href="https://javadeveloperzone.com/solr/solr-pivot-faceting-example/" target="_self" rel="nofollow noopener noreferrer"&gt;this&lt;/A&gt; example, facets are nested, as I expect them to be, but I am not able to get&amp;nbsp; such result. Am i doing something wrong?&lt;/P&gt;&lt;P&gt;Please give some hints. Thank you.&lt;/P&gt;&lt;P&gt;Dario&lt;/P&gt;</description>
      <pubDate>Mon, 13 Sep 2021 21:09:29 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/nested-facets-search/m-p/137944#M37004</guid>
      <dc:creator>darionis</dc:creator>
      <dc:date>2021-09-13T21:09:29Z</dc:date>
    </item>
    <item>
      <title>Re: nested facets search</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/nested-facets-search/m-p/137945#M37005</link>
      <description>&lt;P&gt;In order for it to work, fileds must be decalred as facetable in the content model.&lt;/P&gt;&lt;PRE&gt;&amp;lt;property name="ns:region"&amp;gt;
  &amp;lt;description&amp;gt;...&amp;lt;/description&amp;gt;
  &amp;lt;type&amp;gt;d:text&amp;lt;/type&amp;gt;
  &amp;lt;mandatory enforced="true"&amp;gt;true&amp;lt;/mandatory&amp;gt;
  &amp;lt;index enabled="true"&amp;gt;
    &lt;STRONG&gt;&amp;lt;facetable&amp;gt;true&amp;lt;/facetable&amp;gt;&lt;/STRONG&gt;
  &amp;lt;/index&amp;gt;
&amp;lt;/property&amp;gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 15 Sep 2021 19:40:26 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/nested-facets-search/m-p/137945#M37005</guid>
      <dc:creator>darionis</dc:creator>
      <dc:date>2021-09-15T19:40:26Z</dc:date>
    </item>
  </channel>
</rss>

