<?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 The efficient way of finding property-values in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/the-efficient-way-of-finding-property-values/m-p/224773#M177903</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have a script that finds all values used for a particular property. Consider the following function that recives the resultset from a Lucene query and a name of a property (cm:author for example).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&lt;BR /&gt;function getPropertyValues(results, property){&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var values = new Array();&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; for(var i = 0; i &amp;lt; results.length; i++){&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var content = results[i];&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var value = content.properties[property];&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(values[value] == null){&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; values[value] = value;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return values;&lt;BR /&gt;}&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;/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;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;This is a really inefficient way of getting the list of property values that matches the query. Imagine that you have about 100 author that have produced 100 documents each, then you have to iterate through 100 000 nodes to make sure that you have not missed one and it is probably take several seconds.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My question is: What is the efficient way of getting the distinct values that exists for a property? &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks in advance&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Roland&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 11 Mar 2010 08:55:28 GMT</pubDate>
    <dc:creator>buurd</dc:creator>
    <dc:date>2010-03-11T08:55:28Z</dc:date>
    <item>
      <title>The efficient way of finding property-values</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/the-efficient-way-of-finding-property-values/m-p/224773#M177903</link>
      <description>HiI have a script that finds all values used for a particular property. Consider the following function that recives the resultset from a Lucene query and a name of a property (cm:author for example).function getPropertyValues(results, property){&amp;nbsp;&amp;nbsp;&amp;nbsp; var values = new Array();&amp;nbsp;&amp;nbsp;&amp;nbsp; for(var i = 0; i &amp;lt;</description>
      <pubDate>Thu, 11 Mar 2010 08:55:28 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/the-efficient-way-of-finding-property-values/m-p/224773#M177903</guid>
      <dc:creator>buurd</dc:creator>
      <dc:date>2010-03-11T08:55:28Z</dc:date>
    </item>
    <item>
      <title>Re: The efficient way of finding property-values</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/the-efficient-way-of-finding-property-values/m-p/224774#M177904</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Since I have not got any answers here I have now opened a support-ticket. I'll report back when I have an answer.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Mar 2010 07:53:09 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/the-efficient-way-of-finding-property-values/m-p/224774#M177904</guid>
      <dc:creator>buurd</dc:creator>
      <dc:date>2010-03-19T07:53:09Z</dc:date>
    </item>
    <item>
      <title>Re: The efficient way of finding property-values</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/the-efficient-way-of-finding-property-values/m-p/224775#M177905</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I got some feedback from Redpill on the problem. There are a table in the Alfresco-database that I can query: &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;select distinct string_value from alf_node_properties where qname_id = ? &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Now I just need to figure out how to access the database directly, the alfresco way. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;//Roland&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Mar 2010 08:29:01 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/the-efficient-way-of-finding-property-values/m-p/224775#M177905</guid>
      <dc:creator>buurd</dc:creator>
      <dc:date>2010-03-29T08:29:01Z</dc:date>
    </item>
    <item>
      <title>Re: The efficient way of finding property-values</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/the-efficient-way-of-finding-property-values/m-p/224776#M177906</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The DB is not the way to go … There is no index for the query.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;See getTopCategories() in LuceneCategoryServiceImpl which is essentially the same thing.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Andy&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Apr 2010 13:57:37 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/the-efficient-way-of-finding-property-values/m-p/224776#M177906</guid>
      <dc:creator>andy</dc:creator>
      <dc:date>2010-04-06T13:57:37Z</dc:date>
    </item>
  </channel>
</rss>

