Sharepoint 2010 客户端对象模型 - 大型库 - 无需迭代即可查找项目
我有一个大型文档库(目前约有 6000 个文档),我需要根据自定义字段值(库上的自定义列)查找文档。
有没有一种方法可以在不遍历所有 6000 个文档的情况下取回该文档?
我知道迭代必须在某个时刻发生,但我更希望它发生在 SharePoint 服务器端,而不是将它们全部传输到客户端然后挑选文档。
谢谢
I have a large document library (at the moment ~6000 documents) and I need to find a document based on a custom field value (custom column on the library).
Is there a way of getting this document back without iterating through all 6000 documents?
I understand that an iteration must occur at some point, but I would prefer it to happen on the SharePoint server side, rather than transfer them all to the client side then cherry pick the document.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以查询Sharepoint。您发出一个 CAML 查询,该查询在服务器上执行并仅返回与您指定的条件相匹配的项目。您指定要搜索的自定义列的名称并指定要查找的值。为了提高效率,您可以只要求返回几个字段(例如文档 url)。因此,您不需要遍历列表中的文档来查找该项目。
您可以在这里找到一些讨论:
http://msdn.microsoft.com/en-us/library/ee956524.aspx 您还可以找到如何通过 javascript 或 silverlight 执行此操作的示例。
示例 CAML:
You can query Sharepoint. You issue a CAML query which is executed on the server and brings back only items that match the criteria that you specified. You specify the name of the custom column to search on and you specify the value to find. For efficiency , you can ask only for a few fields back (document url for example). So, you do not need to iterate over documents in the list to find the item.
You can find some discussion here:
http://msdn.microsoft.com/en-us/library/ee956524.aspx and you can also find examples how to do it from javascript or silvelight.
Example CAML: