<?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: Trying to search for files based on the content model properties Rest API in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/trying-to-search-for-files-based-on-the-content-model-properties/m-p/133061#M35841</link>
    <description>&lt;P&gt;Can you share the model where you have defined the propeties?&lt;/P&gt;
&lt;P&gt;You can also review this doc:&amp;nbsp;&lt;A href="https://docs.alfresco.com/content-services/5.2/develop/repo-ext-points/content-model/" target="_blank" rel="nofollow noopener noreferrer"&gt;https://docs.alfresco.com/content-services/5.2/develop/repo-ext-points/content-model/&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 04 Mar 2022 23:07:06 GMT</pubDate>
    <dc:creator>abhinavmishra14</dc:creator>
    <dc:date>2022-03-04T23:07:06Z</dc:date>
    <item>
      <title>Trying to search for files based on the content model properties Rest API</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/trying-to-search-for-files-based-on-the-content-model-properties/m-p/133060#M35840</link>
      <description>&lt;P&gt;Hello Community,&lt;/P&gt;&lt;P&gt;I'm trying to implement searching of files based on the &lt;STRONG&gt;properties&lt;/STRONG&gt; of the &lt;STRONG&gt;content model&lt;/STRONG&gt; of the document.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I found this ReST API:&amp;nbsp;&lt;/P&gt;&lt;P&gt;GET /alfresco/s/slingshot/search?term={term?}&amp;amp;tag={tag?}&amp;amp;site={site?}&amp;amp;container={container?}&amp;amp;sort={sort?}&amp;amp;query={query?}&amp;amp;repo={repo?}&lt;/P&gt;&lt;P&gt;But I'm not sure how to pass the property name of the document in the query parameter.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;For ex:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;My docuemt content model is: &lt;STRONG&gt;dc:InvoiceModel&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Property name is: &lt;STRONG&gt;dc:doctype.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;So, I want to pass the dc:doctype as query parameter to &lt;STRONG&gt;fetch all the documents of this property type&lt;/STRONG&gt;. The documents are inside a folder in the documentLibrary&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;I tried doing this:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://localhost:8080/alfresco/s/slingshot/search?container=documentLibrary/newfolder&amp;amp;sort=dc:dc:doctype|" target="_blank" rel="noopener nofollow noreferrer"&gt;http://localhost:8080/alfresco/s/slingshot/search?container=documentLibrary/newfolder&amp;amp;sort=dc:dc:doctype|&lt;/A&gt;false&amp;amp;repo=true&amp;amp;startIndex=0&amp;amp;query={"dc:doctype":"Sales Invoice","datatype":"d:text"}&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;But I'm getting zero records found. Could you please help me do this.&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV class=""&gt;&lt;STRONG&gt;Alfresco Version:&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;STRONG&gt;Alfresco Share v5.1.f&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;(r125711-b6, Aikau 1.0.63, Spring Surf 5.1.f, Spring WebScripts 6.5, Freemarker 2.3.20-alfresco-patched, Rhino 1.7R4-alfresco-patched, Yui 2.9.0-alfresco-20141223)&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;STRONG&gt;Alfresco Community v5.1.0&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;(r127059-b7) schema 10001&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Thank you all!&lt;/DIV&gt;</description>
      <pubDate>Thu, 03 Mar 2022 04:29:23 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/trying-to-search-for-files-based-on-the-content-model-properties/m-p/133060#M35840</guid>
      <dc:creator>Abhishek-S</dc:creator>
      <dc:date>2022-03-03T04:29:23Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to search for files based on the content model properties Rest API</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/trying-to-search-for-files-based-on-the-content-model-properties/m-p/133061#M35841</link>
      <description>&lt;P&gt;Can you share the model where you have defined the propeties?&lt;/P&gt;
&lt;P&gt;You can also review this doc:&amp;nbsp;&lt;A href="https://docs.alfresco.com/content-services/5.2/develop/repo-ext-points/content-model/" target="_blank" rel="nofollow noopener noreferrer"&gt;https://docs.alfresco.com/content-services/5.2/develop/repo-ext-points/content-model/&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 04 Mar 2022 23:07:06 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/trying-to-search-for-files-based-on-the-content-model-properties/m-p/133061#M35841</guid>
      <dc:creator>abhinavmishra14</dc:creator>
      <dc:date>2022-03-04T23:07:06Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to search for files based on the content model properties Rest API</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/trying-to-search-for-files-based-on-the-content-model-properties/m-p/133062#M35842</link>
      <description>&lt;P&gt;Sir,&lt;/P&gt;&lt;P&gt;This is my Alfresco version: Alfresco Community v5.1.0&lt;/P&gt;&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot (19).png" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="image"&gt;&lt;img src="https://connect.hyland.com/t5/image/serverpage/image-id/1440iB8984A81BB0CF5D9/image-size/large?v=v2&amp;amp;px=999" role="button" title="image" alt="image" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;This is my custom defined model!&lt;/P&gt;</description>
      <pubDate>Mon, 07 Mar 2022 06:14:04 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/trying-to-search-for-files-based-on-the-content-model-properties/m-p/133062#M35842</guid>
      <dc:creator>Abhishek-S</dc:creator>
      <dc:date>2022-03-07T06:14:04Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to search for files based on the content model properties Rest API</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/trying-to-search-for-files-based-on-the-content-model-properties/m-p/133063#M35843</link>
      <description>&lt;P&gt;Take a look at this example:&amp;nbsp;&lt;A href="https://documenter.getpostman.com/view/2694867/SVfRuTWU#b9df9ccc-b76a-c7e6-e50e-0e926d7ff124" target="_blank" rel="nofollow noopener noreferrer"&gt;https://documenter.getpostman.com/view/2694867/SVfRuTWU#b9df9ccc-b76a-c7e6-e50e-0e926d7ff124&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;You need to also encode the values for sort and query.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;example:&lt;/P&gt;

&lt;PRE&gt;dc:doctype|false &lt;STRONG&gt;TO&lt;/STRONG&gt; dc%3Adoctype%7Cfalse
&lt;/PRE&gt;
&lt;P&gt;You can't use the colon in the query. Rather you should use the property name like: "prop_dc_&lt;SPAN&gt;doctype&lt;/SPAN&gt;". see example here:&amp;nbsp;&lt;A href="https://documenter.getpostman.com/view/2694867/SVfRuTWU#b9df9ccc-b76a-c7e6-e50e-0e926d7ff124" target="_blank" rel="nofollow noopener noreferrer"&gt;https://documenter.getpostman.com/view/2694867/SVfRuTWU#b9df9ccc-b76a-c7e6-e50e-0e926d7ff124&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;datatype refers to the content/node type. e.g:&amp;nbsp;cm:content not property data types like d:text.&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;You may have to set the tokenize property to "&lt;SPAN&gt;both&lt;/SPAN&gt;"&lt;/P&gt;

&lt;PRE&gt;&amp;lt;index enabled="true"&amp;gt;
  &amp;lt;atomic&amp;gt;true&amp;lt;/atomic&amp;gt;
  &amp;lt;stored&amp;gt;false&amp;lt;/stored&amp;gt;
&lt;STRONG&gt;  &amp;lt;tokenised&amp;gt;both&amp;lt;/tokenised&amp;gt;&lt;/STRONG&gt;
&amp;lt;/index&amp;gt;&lt;/PRE&gt;
&lt;P&gt;Since you are using model manager, you need to set the indexing property to "Pattern - Many Matches".&amp;nbsp;&lt;/P&gt;

&lt;P&gt;You should rather deploy the model via bootstapping to better control over model.&lt;/P&gt;
&lt;P&gt;Take a look at these docs:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://ecmarchitect.com/alfresco-developer-series-tutorials/content/tutorial/tutorial.html" target="_blank" rel="nofollow noopener noreferrer"&gt;http://ecmarchitect.com/alfresco-developer-series-tutorials/content/tutorial/tutorial.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://docs.alfresco.com/content-services/5.2/develop/repo-ext-points/content-model/#definedeploy" target="_blank" rel="nofollow noopener noreferrer"&gt;https://docs.alfresco.com/content-services/5.2/develop/repo-ext-points/content-model/#definedeploy&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Mar 2022 22:33:22 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/trying-to-search-for-files-based-on-the-content-model-properties/m-p/133063#M35843</guid>
      <dc:creator>abhinavmishra14</dc:creator>
      <dc:date>2022-03-07T22:33:22Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to search for files based on the content model properties Rest API</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/trying-to-search-for-files-based-on-the-content-model-properties/m-p/133064#M35844</link>
      <description>&lt;P&gt;Thanks sir, got it!&lt;/P&gt;</description>
      <pubDate>Tue, 08 Mar 2022 07:16:48 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/trying-to-search-for-files-based-on-the-content-model-properties/m-p/133064#M35844</guid>
      <dc:creator>Abhishek-S</dc:creator>
      <dc:date>2022-03-08T07:16:48Z</dc:date>
    </item>
  </channel>
</rss>

