使用 Rest API 根据内容模型属性在 Alfresco 中搜索文件
我正在尝试根据文档的内容模型的属性在Alfresco中实现文件搜索。
我找到了这个 ReST API:
GET /alfresco/s/slingshot/search?term={term?}&tag={tag?}&site={site?}&container={ container?}&sort={sort?}&query={query?}&repo={repo?}
但我不确定如何在查询参数中传递文档的属性名称。
例如:
我的文档内容模型是:dc:InvoiceModel
属性名称是:dc:doctype。
因此,我想将 dc:doctype 作为查询参数作为 销售发票 传递,例如,以获取所有销售发票类型的文档。这些文档位于 documentLibrary 中的一个文件夹内
我尝试这样做:
http://localhost:8080/alfresco/s/slingshot/search?container=documentLibrary/newfolder&sort=dc:dc:doc ...false&repo=true&startIndex=0&query={"dc:doctype":"销售发票","datatype":"d:text"}
但是我发现零条记录。你能帮我做这件事吗?
Alfresco 版本:
Alfresco Share v5.1.f (r125711-b6、Aikau 1.0.63、Spring Surf 5.1.f、Spring WebScripts 6.5、Freemarker 2.3.20-alfresco-patched、Rhino 1.7R4-alfresco-patched、Yui 2.9.0-alfresco-20141223)
Alfresco社区v5.1.0 (r127059-b7) schema 10001
谢谢大家!
I'm trying to implement searching of files in Alfresco based on the properties of the content model of the document.
I found this ReST API:
GET /alfresco/s/slingshot/search?term={term?}&tag={tag?}&site={site?}&container={container?}&sort={sort?}&query={query?}&repo={repo?}
But I'm not sure how to pass the property name of the document in the query parameter.
For ex:
My docuemt content model is: dc:InvoiceModel
Property name is: dc:doctype.
So, I want to pass the dc:doctype as query parameter as Sales Invoice for example to fetch all the documents of the type Sales Invoice. The documents are inside a folder in the documentLibrary
I tried doing this:
http://localhost:8080/alfresco/s/slingshot/search?container=documentLibrary/newfolder&sort=dc:dc:doc...false&repo=true&startIndex=0&query={"dc:doctype":"Sales Invoice","datatype":"d:text"}
But I'm getting zero records found. Could you please help me do this.
Alfresco Version:
Alfresco Share v5.1.f
(r125711-b6, Aikau 1.0.63, Spring Surf 5.1.f, Spring WebScripts 6.5, Freemarker 2.3.20-alfresco-patched, Rhino 1.7R4-alfresco-patched, Yui 2.9.0-alfresco-20141223)
Alfresco Community v5.1.0
(r127059-b7) schema 10001
Thank you all!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
请注意:slingshot 不是公共 API(但在 5.1 中你没有公共搜索 API)。在 5.2 中,您应该使用 Alfresco Content Services REST API
在这个问题中你应该已经找到答案:将多个搜索参数传递给 Alfresco slingshot 搜索 Webscript
一些备注:
documentLibrary
但仅与站点查询一起有意义dc\:doctype:"销售发票"
但应该是 url 编码的。您还可以添加 PATH 查询,如上面的答案所示be careful: slingshot is not a public API (but in 5.1 you don't have a public search API). In 5.2 you should use the Alfresco Content Services REST API
In this SO question you should already find you answer: Passing multiple search arguments to Alfresco slingshot search Webscript
some remarks:
documentLibrary
but only makes sense together with a sitedc\:doctype:"Sales Invoice"
but should be url encoded. You could also add a PATH query as shown in the answer above