<?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 Re: Getting all grandchildredn of node in one query in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/getting-all-grandchildredn-of-node-in-one-query/m-p/44346#M18085</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Alfresco provides different languages to specify queries. You can learn more at&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://docs.alfresco.com/community/concepts/rm-searchsyntax-APIs.html" title="https://docs.alfresco.com/community/concepts/rm-searchsyntax-APIs.html" rel="nofollow noopener noreferrer"&gt;Search query syntax APIs | Alfresco Documentation&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.alfresco.com/5.2/concepts/query-lang-support.html" rel="nofollow noopener noreferrer"&gt;https://docs.alfresco.com/5.2/concepts/query-lang-support.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In your case, I'd use a PATH query with AFTS syntax. Something similar to this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' --header 'Authorization: Basic YWRtaW46YWRtaW4=' -d '{&lt;BR /&gt; "query": {&lt;BR /&gt; "language": "afts",&lt;BR /&gt; "query": "PATH:\"/\""&lt;BR /&gt; }&lt;BR /&gt;}' 'http://localhost:8080/alfresco/api/-default-/public/search/versions/1/search'&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 20 Jun 2018 08:00:11 GMT</pubDate>
    <dc:creator>angelborroy</dc:creator>
    <dc:date>2018-06-20T08:00:11Z</dc:date>
    <item>
      <title>Getting all grandchildredn of node in one query</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/getting-all-grandchildredn-of-node-in-one-query/m-p/44345#M18084</link>
      <description>Hello,Is it possible to get all grandchildren (or even grand...grandchildren) of node using just one query? I'm using REST API and Alfresco Community v5.2.0.Thank youSlawek</description>
      <pubDate>Tue, 19 Jun 2018 11:51:34 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/getting-all-grandchildredn-of-node-in-one-query/m-p/44345#M18084</guid>
      <dc:creator>slawek</dc:creator>
      <dc:date>2018-06-19T11:51:34Z</dc:date>
    </item>
    <item>
      <title>Re: Getting all grandchildredn of node in one query</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/getting-all-grandchildredn-of-node-in-one-query/m-p/44346#M18085</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Alfresco provides different languages to specify queries. You can learn more at&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://docs.alfresco.com/community/concepts/rm-searchsyntax-APIs.html" title="https://docs.alfresco.com/community/concepts/rm-searchsyntax-APIs.html" rel="nofollow noopener noreferrer"&gt;Search query syntax APIs | Alfresco Documentation&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.alfresco.com/5.2/concepts/query-lang-support.html" rel="nofollow noopener noreferrer"&gt;https://docs.alfresco.com/5.2/concepts/query-lang-support.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In your case, I'd use a PATH query with AFTS syntax. Something similar to this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' --header 'Authorization: Basic YWRtaW46YWRtaW4=' -d '{&lt;BR /&gt; "query": {&lt;BR /&gt; "language": "afts",&lt;BR /&gt; "query": "PATH:\"/\""&lt;BR /&gt; }&lt;BR /&gt;}' 'http://localhost:8080/alfresco/api/-default-/public/search/versions/1/search'&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Jun 2018 08:00:11 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/getting-all-grandchildredn-of-node-in-one-query/m-p/44346#M18085</guid>
      <dc:creator>angelborroy</dc:creator>
      <dc:date>2018-06-20T08:00:11Z</dc:date>
    </item>
    <item>
      <title>Re: Getting all grandchildredn of node in one query</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/getting-all-grandchildredn-of-node-in-one-query/m-p/44347#M18086</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can perform a FTS query using ReST API to query for nodes using the ANCESTOR field. This will give you all /^(grand-)*children$/ of&amp;nbsp;a particular node.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Jun 2018 08:00:41 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/getting-all-grandchildredn-of-node-in-one-query/m-p/44347#M18086</guid>
      <dc:creator>afaust</dc:creator>
      <dc:date>2018-06-20T08:00:41Z</dc:date>
    </item>
    <item>
      <title>Re: Getting all grandchildredn of node in one query</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/getting-all-grandchildredn-of-node-in-one-query/m-p/44348#M18087</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;At the same time as you I provided the alternative variant using ANCESTOR. Both are valid / possible. ANCESTOR has a slight advantage over PATH in the cost of processing.&lt;/P&gt;&lt;P&gt;Also note that the PATH example is a bit simple for the stated use case. A proper example query for PATH and looking up children + grand-children would be:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PATH:"/app:company_home/cm:My_x0020_Folder//*"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The above retrieves all children and grand-children of a folder called "My Folder" located at the top level of the Repository. If that folder had the NodeRef workspace://SpacesStore/1234-567890-3457-aefd, the ANCESTOR variant would look like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ANCESTOR:"&lt;SPAN&gt;workspace://SpacesStore/1234-567890-3457-aefd"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The resolution of the&amp;nbsp;wildcards and // in the PATH query is what typically makes it more expensive than ANCESTOR.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Jun 2018 08:04:42 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/getting-all-grandchildredn-of-node-in-one-query/m-p/44348#M18087</guid>
      <dc:creator>afaust</dc:creator>
      <dc:date>2018-06-20T08:04:42Z</dc:date>
    </item>
  </channel>
</rss>

