简体   繁体   English

Alfresco Lucene搜索语法

[英]Alfresco Lucene search syntax

I am writing a webscript, wherein I have a custom content model. 我正在编写一个Web脚本,其中有一个自定义内容模型。

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. 这向我返回了值1。但是此查询实际上向我返回了其cm:name属性为myDocument的文档。

what if I want to search for documents, who has cm:name property as an attribute. 如果我要搜索具有cm:name属性作为属性的文档怎么办。

So that later, I can change cm:name with mycontentmodel:myproperty, and find the elements that belong to my content type. 这样一来,我可以使用mycontentmodel:myproperty更改cm:name,并找到属于我的内容类型的元素。

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. 如果我理解正确,那么您想查找所有具有属性mycontentmodel:myproperty的文档,但您对该属性的实际值不感兴趣。

If so, find out what type or aspect mycontentmodel:myproperty belongs to. 如果是这样,请找出mycontentmodel:myproperty属于什么类型或方面。

If it belongs to type mycontentmodel:mytype the query can be: 如果它属于类型mycontentmodel:mytype,则查询可以是:

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

and if it belongs to aspect mycontentmodel:myaspect 如果它属于方面mycontentmodel:myaspect

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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