<?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 Lucene search for properties through Freemarker templates in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/lucene-search-for-properties-through-freemarker-templates/m-p/22059#M10524</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi there,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Hopefully a quick question about using Lucene to search for content within a template.&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am trying to find documents by searching only their assigned properties. For example, our content model provides a property called "Client". I need to find all content items which have a Client of "SampleClient".&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Trying something like&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;companyhome.childrenByLuceneSearch["Client:SampleClient"]&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;does not return any results.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;FYI, the whole template is the following and counts the number of documents returned. It works fine for simple text search:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&amp;lt;#assign x&amp;gt;&lt;BR /&gt;&amp;nbsp; &amp;lt;#list companyhome.childrenByLuceneSearch["TEXT:public"] as n&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; alex&lt;BR /&gt;&amp;nbsp; &amp;lt;/#list&amp;gt;&lt;BR /&gt;&amp;lt;/#assign&amp;gt;&lt;BR /&gt;Number of docs: ${x?word_list?size}&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;BR /&gt;&lt;SPAN&gt;Many thanks for the help,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Alex&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 30 Jun 2006 16:42:04 GMT</pubDate>
    <dc:creator>alexp</dc:creator>
    <dc:date>2006-06-30T16:42:04Z</dc:date>
    <item>
      <title>Lucene search for properties through Freemarker templates</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/lucene-search-for-properties-through-freemarker-templates/m-p/22059#M10524</link>
      <description>Hi there,Hopefully a quick question about using Lucene to search for content within a template.I am trying to find documents by searching only their assigned properties. For example, our content model provides a property called "Client". I need to find all content items which have a Client of "Sampl</description>
      <pubDate>Fri, 30 Jun 2006 16:42:04 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/lucene-search-for-properties-through-freemarker-templates/m-p/22059#M10524</guid>
      <dc:creator>alexp</dc:creator>
      <dc:date>2006-06-30T16:42:04Z</dc:date>
    </item>
    <item>
      <title>Re: Lucene search for properties through Freemarker templates</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/lucene-search-for-properties-through-freemarker-templates/m-p/22060#M10525</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The search you have attempted is malformed - take a look at the section on searching for specific properties here:&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://wiki.alfresco.com/wiki/Search#Finding_nodes_by_text_property_values" rel="nofollow noopener noreferrer"&gt;http://wiki.alfresco.com/wiki/Search#Finding_nodes_by_text_property_values&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt;You need to know the namespace prefix of your property from your custom model, assuming the namespace prefix was "custom" then the search string would look like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&lt;BR /&gt;@custom\:Client:SampleClient&lt;BR /&gt;&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;/CODE&gt;&lt;/PRE&gt;&lt;SPAN&gt;Note that you need to escape the '\' character as it's also an escape character in FreeMarker &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://connect.hyland.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt; So your final search string would look something like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&lt;BR /&gt;@custom\\:Client:SampleClient&lt;BR /&gt;&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;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;Hope this helps,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Kevin&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Jun 2006 18:06:00 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/lucene-search-for-properties-through-freemarker-templates/m-p/22060#M10525</guid>
      <dc:creator>kevinr</dc:creator>
      <dc:date>2006-06-30T18:06:00Z</dc:date>
    </item>
    <item>
      <title>Re: Lucene search for properties through Freemarker templates</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/lucene-search-for-properties-through-freemarker-templates/m-p/22061#M10526</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Many thanks Kevin, this worked perfectly.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Jul 2006 17:27:23 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/lucene-search-for-properties-through-freemarker-templates/m-p/22061#M10526</guid>
      <dc:creator>alexp</dc:creator>
      <dc:date>2006-07-19T17:27:23Z</dc:date>
    </item>
  </channel>
</rss>

