简体   繁体   中英

Alfresco Lucene search syntax

I am writing a webscript, wherein I have a custom content model.

I want to list all the documents, that have a particular property as one of it's attributes.

Firstly I did

search.luceneSearch("PATH:\"/app:company_home//*\" AND @cm:name:myDocument")

This returned me value 1. But this query actually returns me the documents, whose cm:name property is myDocument.

what if I want to search for documents, who has cm:name property as an attribute.

So that later, I can change cm:name with mycontentmodel:myproperty, and find the elements that belong to my content type.

If I understand correctly, you'd like to find all the documents that have property mycontentmodel:myproperty, but you're not interested in the actual value of the property.

If so, find out what type or aspect mycontentmodel:myproperty belongs to.

If it belongs to type mycontentmodel:mytype the query can be:

PATH:"/app:company_home//*" AND TYPE:"mycontentmodel:mytype"

and if it belongs to aspect mycontentmodel:myaspect

PATH:"/app:company_home//*" AND ASPECT:"mycontentmodel:myaspect"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM