[英]Alfresco : How to search for a specific files types?
I am working to search all PNG files(ie all files which has file name extension ".png") in alfresco. 我正在室外搜索所有PNG文件(即文件扩展名为“ .png”的所有文件)。 I am using the followingcode, but it does not return any result:
我正在使用以下代码,但不会返回任何结果:
var docs = search.luceneSearch("@cm\\:content.fileType:\"*.png\"");
for (var i=0; i<docs.length; i++)
{
//TO print the name of files--> "Name: " + docs[i].name ;
}
I am not sure if content.fileType is the right way to code to search for file types. 我不确定content.fileType是否是编码搜索文件类型的正确方法。 Any suggestion please ?
有什么建议吗?
You should go with the content.mimetype
query, for example: @\\{http\\://www.alfresco.org/model/content/1.0\\}content.mimetype:text/plain
您应该使用
content.mimetype
查询,例如: @\\{http\\://www.alfresco.org/model/content/1.0\\}content.mimetype:text/plain
https://community.alfresco.com/docs/DOC-4673-search#jive_content_id_Finding_nodes_by_content_mimetype https://community.alfresco.com/docs/DOC-4673-search#jive_content_id_Finding_nodes_by_content_mimetype
如果使用此语句,则仅查找PNG图像会有所帮助:
var docs = search.luceneSearch("@cm\\:name:\"png\"");
If your really want to search for PNG files you should follow Lista's approach using mimetype but with correct syntax 如果您确实要搜索PNG文件,则应使用miatype但语法正确,遵循Lista的方法
var docs = search.luceneSearch("@cm\\:content.mimetype:\"image/png\"");
searching for name part "PNG" ("@cm\\:name:\\"png\\"") would find any document having a token "PNG" in it's name like png.name.pdf or any_png.doc since document name is stored tokenized in the index 搜索名称部分“ PNG”(“ @ cm \\:name:\\” png \\“”)会发现任何名称中带有标记“ PNG”的文档,例如png.name.pdf或any_png.doc,因为存储了文档名称在索引中标记化
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.