简体   繁体   English

Alfresco:如何搜索特定的文件类型?

[英]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.

相关问题 如何使用Alfresco Search WebScript在JavaScript控制器中按属性过滤类型? - How to filtering types by properties in JavaScript controller using the Alfresco Search WebScript? 在露天搜索时如何显示文件内容 - How to show the contents of files when searching in alfresco Alfresco Lucene搜索语法 - Alfresco Lucene search syntax Lucene在露天游览 - Lucene Search in Alfresco 如何在露天lucene搜索中查找标题为“ * .pdf”的文档 - How to find documents with title like “*.pdf” in alfresco lucene search 如何获取露天内容管理系统中存储的文件的元数据? - how to get the metadata of files stored in alfresco content management system? Alfresco-尝试删除文件,但Lucene搜索会继续返回相同的1000个结果,包括已删除的节点 - Alfresco - Attempting to delete files, but Lucene search keeps returning same 1000 results including deleted nodes 我们如何创建自定义solr索引和自定义lucen索引来搜索alfresco中的文档? - How we can create custom solr indexing and custom lucen indexing to search documents in alfresco? 如何使用 Lucene 查询从 alfresco 共享 UI 中获取特定内容类型的文档计数 - How to get specific content type document count from alfresco share UI using Lucene query 是否可以获取Alfresco中的节点类型(甚至属性类型)列表? - Is it possible to get a list of node types (or even property types) in Alfresco?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM