cancel
Showing results for 
Search instead for 
Did you mean: 

confused on search '+cm:' or '+@cm' ?

lucille_arkenst
Champ in-the-making
Champ in-the-making
In order to search metadata I believe one is to do it like this:
var results = search.luceneSearch("+@cm\\:title:\" + args.query + ");

But, shouldn't I include the PATH first?
Also, why is it "@cm"?  Shouldn't it be simply "+cm:" ?

Please help.

Cheers
7 REPLIES 7

kbonnet
Champ in-the-making
Champ in-the-making
If you dont include a "path" statement, the complete repository will be searched. If you do include it, only content within that path is searched.

the @ sign is needed for properties, so it's needed for your search on cm:title.

Good luck!

lucille_arkenst
Champ in-the-making
Champ in-the-making
Thanks, that's good to know.  Could you please advise me what book or link you found that out from?

Cheers!

mrogers
Star Contributor
Star Contributor
This wiki page is how I learned to use Lucene syntax in alfresco.  
http://wiki.alfresco.com/wiki/Search

lucille_arkenst
Champ in-the-making
Champ in-the-making
I looked at http://wiki.alfresco.com/wiki/Search but it does not explain where the search defaults to.

unknown-user
Champ on-the-rise
Champ on-the-rise
Search "Finding nodes by text property values" and "path Queries" from the link.

gauchoproluanco
Champ in-the-making
Champ in-the-making
Hi everybody,

We would like to finding nodes by a text property value. The problem is that these nodes are made from a custom-type model, so looking at the wiki we have to put on the query something like this:
+ @cm\:userName:"manager" 
.

At this time we have a query that get the all the contents of that custom-type model of a concrete folder:
PATH:"/app:company_home/st:sites/cm:folder-name/*" + TYPE:"name-prefix:name-type" 

It works!:

Results (5 rows)
Name   Node   Parent
service.log   workspace://SpacesStore/4832fd96-a82a-4420-a60d-39aaf28062a2   workspace://SpacesStore/e7ab3e0a-4077-4f39-879d-e1c7f8747109
ah-muleque.jpg   workspace://SpacesStore/9da6bec7-c329-409a-aaa2-628300fe9bfa   workspace://SpacesStore/4888be8a-0718-4a4c-8bd5-d0b79909cee5
…/…

We thought that the problem is in the @cm so we put instead  @name-prefix:name-type this is, the name of the custom-type model that we have, but this didn't work…

Anyone could we help us?

Thanks in advance!

Luis

gauchoproluanco
Champ in-the-making
Champ in-the-making
Hi everybody,

Finally we solved it in this way:


//TYPE
var type = "+TYPE:\"prefix:name\"";

//Field
searchingField = "+@prefix\\:nameOfTheField:" + "\"" + fieldValue + "\"";

//Run search
var searchResult = search.luceneSearch(path + type + searchingField);

Thank you and hope it helps,

Luis