04-14-2010 12:14 PM
[…]
String searchCriteria = "+@cm\\:title:\"Test\"";
Query query = new Query(Constants.QUERY_LANG_LUCENE, searchCriteria);
Node[] nodes = repositoryService.get(new Predicate(null, spacesStore, query));
[…]BUT: Nowhere through the API I can read the short prefix ("cm" in this case) - For other namespaces I don't have a single idea how that prefix could be - however, I know the long full names, like:04-14-2010 12:35 PM
@\{http\://www.alfresco.org/model/content/1.0\}title:'Test"That's how Lucene needs to receive it, so obviously you'll need some extra escaping in the client code.04-15-2010 04:23 AM
There's an example on the wiki: http://wiki.alfresco.com/wiki/Search#Finding_nodes_by_content_mimetypeI 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 http://www.slideshare.net/JM.Pascal/alfresco-search-tutorial-presentation 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 http://forums.alfresco.com/en/viewtopic.php?f=3&t=19701 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.@\{http\://www.alfresco.org/model/content/1.0\}title:'Test"
That's how Lucene needs to receive it, so obviously you'll need some extra escaping in the client code.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.
04-26-2010 06:21 AM
10-01-2010 05:52 AM
10-01-2010 06:11 AM
10-01-2010 06:13 AM
its "org.alfresco.repo.search.impl.lucene.LuceneQueryParser" - Eclipse should easily find it 🙂Don't have that - I only have "org.alfresco.webservice…." - I use the Remote SDK.
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.