简体   繁体   English

如何通过SharePoint搜索获取托管属性的不同值?

[英]How to get distinct values of a managed property through SharePoint search?

I am building a phone catalog of my organization (an AJAX application which accesses the search.asmx web service). 我正在构建我的组织的电话目录(一个访问search.asmx Web服务的AJAX应用程序)。 I'd like to show a list box where the user could select a department (which is stored in managed property Department ). 我想显示一个列表框,用户可以在其中选择一个部门(存储在托管属性Department )。 To fill the list box with values, I need to somehow select all the distinct values of that property. 要使用值填充列表框,我需要以某种方式选择该属性的所有不同值。 Is it possible through search.asmx web service? 是否可以通过search.asmx网络服务?

What I've found: 我发现了什么:

  • an article, which states that it is possible , but it does not use the web service interface 一篇文章, 声明它是可能的 ,但它不使用Web服务接口
  • a Microsoft's white paper which states that "If the protocol client specifies at least one property, it MUST also specify the Path property. If it does not, the protocol server MUST return the status code "ERROR_BAD_QUERY"." 微软的白皮书 ,其中指出“如果协议客户端指定至少一个属性,它还必须指定Path属性。如果没有,协议服务器必须返回状态代码”ERROR_BAD_QUERY“。”

The two findings are somewhat inconsistent. 这两项调查结果有些不一致。 (and, yes the search really returns ERROR_BAD_QUERY). (并且,是的,搜索确实返回ERROR_BAD_QUERY)。

Why bother to check with the web service or complicate it? 为什么要费心去检查网络服务还是复杂化?

  1. Get all the properties into a DataTable. 将所有属性都放入DataTable中。
  2. Then create a DataView & then you can apply the DISTINCT on required column. 然后创建一个DataView,然后您可以在必需的列上应用DISTINCT。
  3. Finally use it to bind to your list box. 最后用它来绑定到你的列表框。

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

相关问题 Sharepoint 搜索属性权重 - Sharepoint Search Property Weighting SharePoint 2013-托管属性值不会更新 - SharePoint 2013 - Managed property value does not update 如何生成SharePoint搜索统计信息? - How do SharePoint search statistics get generated? 如何使用 Sharepoint Server Search(KeywordQuery 类)来搜索共享点列表? - How to use Sharepoint Server Search (KeywordQuery class) to search through a sharepoint list? REST API 获取 sharepoint 页面 webparts 的属性值/标题等 - REST API to get property values/title etc for sharepoint page webparts 使用C#在SharePoint高级搜索页面中创建托管属性 - Creating Managed Properties in the SharePoint Advanced Search Page Using C# 创建为托管属性时,SharePoint 2013 People:Assistant返回空 - SharePoint 2013 People:Assistant returns empty when created as Managed Property SharePoint 2010-什么是“企业关键字”的托管属性? - SharePoint 2010 - What is the Managed Property for “Enterprise Keywords” field? 通过托管客户端对象模型从SharePoint中检索图像 - Retrieving Images From SharePoint through the Managed Client Object Model 在单独的服务器场上搜索到网站集时,SharePoint托管属性出现问题 - SharePoint managed properties issue when search on separate farm to site collection
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM