<?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: [SOLVED] Lucene Search for metadata - yes again in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/solved-lucene-search-for-metadata-yes-again/m-p/242928#M196058</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Please read the following sentence slowly word by word:&lt;/SPAN&gt;&lt;BR /&gt;&lt;STRONG&gt;You, are, my, hero!&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;It works. Thanks a lot!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;There's an example on the wiki: &lt;A href="http://wiki.alfresco.com/wiki/Search#Finding_nodes_by_content_mimetype" rel="nofollow noopener noreferrer"&gt;http://wiki.alfresco.com/wiki/Search#Finding_nodes_by_content_mimetype&lt;/A&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;@\{http\://&lt;A href="http://www.alfresco.org/model/content/1.0\}title:%22Test" rel="nofollow noopener noreferrer"&gt;www.alfresco.org/model/content/1.0\}title:'Test&lt;/A&gt;"&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;SPAN&gt;I have been on that page but I overlooked that only sample - But I have seen even places showing it wrong (not going to rediscover them yet) or on slideshare showing only half the information (like &lt;/SPAN&gt;&lt;A href="http://www.slideshare.net/JM.Pascal/alfresco-search-tutorial-presentation" rel="nofollow noopener noreferrer"&gt;http://www.slideshare.net/JM.Pascal/alfresco-search-tutorial-presentation&lt;/A&gt;&lt;SPAN&gt; on slide 46 which is just showing a portion and that is even wrong. Most places just show the short form. And yesterday I already looked at topic &lt;/SPAN&gt;&lt;A href="http://forums.alfresco.com/en/viewtopic.php?f=3&amp;amp;t=19701" rel="nofollow noopener noreferrer"&gt;http://forums.alfresco.com/en/viewtopic.php?f=3&amp;amp;t=19701&lt;/A&gt;&lt;SPAN&gt; as one of the place where I have been and I tried that already. What I noticed only now is that in addition to to the curly braces also the ":" after http has to be escaped - but ONLY that first occurrence! I am pretty sure I overlooked and forgot that. Actually in the previously mentioned slide 46 the escaping of the second ":" is definitely wrong - I get an error when I am trying to escape that also.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;That's how Lucene needs to receive it, so obviously you'll need some extra escaping in the client code.&lt;/BLOCKQUOTE&gt;&lt;SPAN&gt;The longer I think of it the more I do recognize that lucene search queries must be seen more like regular expressions than like a google like query search. And from this point of view it seems to be more clear that every special character needs to be escaped.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Investigating the options I found the REST method of Open Search style:&lt;/SPAN&gt;&lt;A href="http://wiki.alfresco.com/wiki/OpenSearch#Alfresco_Keyword_Search" rel="nofollow noopener noreferrer"&gt;http://wiki.alfresco.com/wiki/OpenSearch#Alfresco_Keyword_Search&lt;/A&gt;&lt;SPAN&gt;. This seems a lot easier but however does not seem to allow a special search in particular fields. - That said, for many people probably the Open Search method fits perfectly (I guess it uses the fields configured for simple search (not tested).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;BTW: I made a few quick tests and using the Alfresco Explorer I get slightly different results as if using the API. One quick guess is that "Search All stores" in Alfresco Explorer means "everything but dictionary" and for API those are also returned - have to investigate this further.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Many, many thanks again, and linking the most interesting (and most cited) two links for more information here&lt;/SPAN&gt;&lt;BR /&gt;&lt;UL&gt;&lt;LI&gt;&lt;A href="http://wiki.alfresco.com/wiki/Web_Scripts" rel="nofollow noopener noreferrer"&gt;http://wiki.alfresco.com/wiki/Web_Scripts&lt;/A&gt;&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;&lt;A href="http://wiki.alfresco.com/wiki/Java-backed_Web_Scripts_Samples" rel="nofollow noopener noreferrer"&gt;http://wiki.alfresco.com/wiki/Java-backed_Web_Scripts_Samples&lt;/A&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;SPAN&gt;we probably can get this topic as a sticky one - as I consider this as a very common request.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 15 Apr 2010 08:23:20 GMT</pubDate>
    <dc:creator>mwildam</dc:creator>
    <dc:date>2010-04-15T08:23:20Z</dc:date>
    <item>
      <title>[SOLVED] Lucene Search for metadata - yes again</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/solved-lucene-search-for-metadata-yes-again/m-p/242926#M196056</link>
      <description>I searched the forum, the wiki and even Google and I find a lot of information of what should work when using the API and lucene to search for meta data.Basically the only thing, what works is:[…]&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; String searchCriteria = "+@cm\\:title:\"Test\"";&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Query query = new Query(Constant</description>
      <pubDate>Wed, 14 Apr 2010 16:14:57 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/solved-lucene-search-for-metadata-yes-again/m-p/242926#M196056</guid>
      <dc:creator>mwildam</dc:creator>
      <dc:date>2010-04-14T16:14:57Z</dc:date>
    </item>
    <item>
      <title>Re: [SOLVED] Lucene Search for metadata - yes again</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/solved-lucene-search-for-metadata-yes-again/m-p/242927#M196057</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;There's an example on the wiki: &lt;/SPAN&gt;&lt;A href="http://wiki.alfresco.com/wiki/Search#Finding_nodes_by_content_mimetype" rel="nofollow noopener noreferrer"&gt;http://wiki.alfresco.com/wiki/Search#Finding_nodes_by_content_mimetype&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;e.g.&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;@\{http\://&lt;A href="http://www.alfresco.org/model/content/1.0\}title:%22Test" rel="nofollow noopener noreferrer"&gt;www.alfresco.org/model/content/1.0\}title:'Test&lt;/A&gt;"&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;SPAN&gt;That's how Lucene needs to receive it, so obviously you'll need some extra escaping in the client code.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Mike&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Apr 2010 16:35:03 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/solved-lucene-search-for-metadata-yes-again/m-p/242927#M196057</guid>
      <dc:creator>mikeh</dc:creator>
      <dc:date>2010-04-14T16:35:03Z</dc:date>
    </item>
    <item>
      <title>Re: [SOLVED] Lucene Search for metadata - yes again</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/solved-lucene-search-for-metadata-yes-again/m-p/242928#M196058</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Please read the following sentence slowly word by word:&lt;/SPAN&gt;&lt;BR /&gt;&lt;STRONG&gt;You, are, my, hero!&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;It works. Thanks a lot!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;There's an example on the wiki: &lt;A href="http://wiki.alfresco.com/wiki/Search#Finding_nodes_by_content_mimetype" rel="nofollow noopener noreferrer"&gt;http://wiki.alfresco.com/wiki/Search#Finding_nodes_by_content_mimetype&lt;/A&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;@\{http\://&lt;A href="http://www.alfresco.org/model/content/1.0\}title:%22Test" rel="nofollow noopener noreferrer"&gt;www.alfresco.org/model/content/1.0\}title:'Test&lt;/A&gt;"&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;SPAN&gt;I have been on that page but I overlooked that only sample - But I have seen even places showing it wrong (not going to rediscover them yet) or on slideshare showing only half the information (like &lt;/SPAN&gt;&lt;A href="http://www.slideshare.net/JM.Pascal/alfresco-search-tutorial-presentation" rel="nofollow noopener noreferrer"&gt;http://www.slideshare.net/JM.Pascal/alfresco-search-tutorial-presentation&lt;/A&gt;&lt;SPAN&gt; on slide 46 which is just showing a portion and that is even wrong. Most places just show the short form. And yesterday I already looked at topic &lt;/SPAN&gt;&lt;A href="http://forums.alfresco.com/en/viewtopic.php?f=3&amp;amp;t=19701" rel="nofollow noopener noreferrer"&gt;http://forums.alfresco.com/en/viewtopic.php?f=3&amp;amp;t=19701&lt;/A&gt;&lt;SPAN&gt; as one of the place where I have been and I tried that already. What I noticed only now is that in addition to to the curly braces also the ":" after http has to be escaped - but ONLY that first occurrence! I am pretty sure I overlooked and forgot that. Actually in the previously mentioned slide 46 the escaping of the second ":" is definitely wrong - I get an error when I am trying to escape that also.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;That's how Lucene needs to receive it, so obviously you'll need some extra escaping in the client code.&lt;/BLOCKQUOTE&gt;&lt;SPAN&gt;The longer I think of it the more I do recognize that lucene search queries must be seen more like regular expressions than like a google like query search. And from this point of view it seems to be more clear that every special character needs to be escaped.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Investigating the options I found the REST method of Open Search style:&lt;/SPAN&gt;&lt;A href="http://wiki.alfresco.com/wiki/OpenSearch#Alfresco_Keyword_Search" rel="nofollow noopener noreferrer"&gt;http://wiki.alfresco.com/wiki/OpenSearch#Alfresco_Keyword_Search&lt;/A&gt;&lt;SPAN&gt;. This seems a lot easier but however does not seem to allow a special search in particular fields. - That said, for many people probably the Open Search method fits perfectly (I guess it uses the fields configured for simple search (not tested).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;BTW: I made a few quick tests and using the Alfresco Explorer I get slightly different results as if using the API. One quick guess is that "Search All stores" in Alfresco Explorer means "everything but dictionary" and for API those are also returned - have to investigate this further.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Many, many thanks again, and linking the most interesting (and most cited) two links for more information here&lt;/SPAN&gt;&lt;BR /&gt;&lt;UL&gt;&lt;LI&gt;&lt;A href="http://wiki.alfresco.com/wiki/Web_Scripts" rel="nofollow noopener noreferrer"&gt;http://wiki.alfresco.com/wiki/Web_Scripts&lt;/A&gt;&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;&lt;A href="http://wiki.alfresco.com/wiki/Java-backed_Web_Scripts_Samples" rel="nofollow noopener noreferrer"&gt;http://wiki.alfresco.com/wiki/Java-backed_Web_Scripts_Samples&lt;/A&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;SPAN&gt;we probably can get this topic as a sticky one - as I consider this as a very common request.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Apr 2010 08:23:20 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/solved-lucene-search-for-metadata-yes-again/m-p/242928#M196058</guid>
      <dc:creator>mwildam</dc:creator>
      <dc:date>2010-04-15T08:23:20Z</dc:date>
    </item>
    <item>
      <title>Re: [SOLVED] Lucene Search for metadata - yes again</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/solved-lucene-search-for-metadata-yes-again/m-p/242929#M196059</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;If you are writing the query in code you can get the escaping done for you.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is the example for building a phrase. (Do not do the last bit of escaping for non-phrases)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LuceneQueryParser.escape("{" + ContentModel.PROP_CONTENT.getNamespaceURI() + "}"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; + ISO9075.encode(ContentModel.PROP_CONTENT.getLocalName()))).append(":\"").append(&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LuceneQueryParser.escape(phrase)).append("\"");&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Alfresco FTS is more escape friendly.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Andy&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Apr 2010 10:21:19 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/solved-lucene-search-for-metadata-yes-again/m-p/242929#M196059</guid>
      <dc:creator>andy</dc:creator>
      <dc:date>2010-04-26T10:21:19Z</dc:date>
    </item>
    <item>
      <title>Re: [SOLVED] Lucene Search for metadata - yes again</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/solved-lucene-search-for-metadata-yes-again/m-p/242930#M196060</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I tried to use the automatic escaping proposed by you but I don't have the LuceneQueryParser - where does it come from?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Oct 2010 09:52:15 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/solved-lucene-search-for-metadata-yes-again/m-p/242930#M196060</guid>
      <dc:creator>mwildam</dc:creator>
      <dc:date>2010-10-01T09:52:15Z</dc:date>
    </item>
    <item>
      <title>Re: [SOLVED] Lucene Search for metadata - yes again</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/solved-lucene-search-for-metadata-yes-again/m-p/242931#M196061</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;its "org.alfresco.repo.search.impl.lucene.LuceneQueryParser" - Eclipse should easily find it &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Cheers&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Gyro&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Oct 2010 10:11:46 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/solved-lucene-search-for-metadata-yes-again/m-p/242931#M196061</guid>
      <dc:creator>gyro_gearless</dc:creator>
      <dc:date>2010-10-01T10:11:46Z</dc:date>
    </item>
    <item>
      <title>Re: [SOLVED] Lucene Search for metadata - yes again</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/solved-lucene-search-for-metadata-yes-again/m-p/242932#M196062</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;its "org.alfresco.repo.search.impl.lucene.LuceneQueryParser" - Eclipse should easily find it &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/BLOCKQUOTE&gt;&lt;SPAN&gt;Don't have that - I only have "org.alfresco.webservice…." - I use the Remote SDK.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Oct 2010 10:13:41 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/solved-lucene-search-for-metadata-yes-again/m-p/242932#M196062</guid>
      <dc:creator>mwildam</dc:creator>
      <dc:date>2010-10-01T10:13:41Z</dc:date>
    </item>
  </channel>
</rss>

