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

发布于 2024-08-22 10:33:14 字数 645 浏览 3 评论 0原文

我正在构建我的组织的电话目录(访问 search.asmx Web 服务的 AJAX 应用程序)。 我想显示一个列表框,用户可以在其中选择一个部门(存储在托管属性 Department 中)。为了用值填充列表框,我需要以某种方式选择该属性的所有不同值。 是否可以通过 search.asmx Web 服务?

我发现了什么:

  • 一篇文章 其中指出这是可能的,但它不使用
  • Microsoft 的 Web 服务接口 白皮书其中指出“如果协议客户端至少指定了一个属性,则它还必须指定 Path 属性。如果没有,协议服务器必须返回状态代码“ERROR_BAD_QUERY”。

这两个发现有些不一致。 (并且,是的,搜索确实返回 ERROR_BAD_QUERY)。

I am building a phone catalog of my organization (an AJAX application which accesses the search.asmx web service).
I'd like to show a list box where the user could select a department (which is stored in managed property 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?

What I've found:

  • an article, which states that it is possible, but it does not use the web service interface
  • 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"."

The two findings are somewhat inconsistent. (and, yes the search really returns ERROR_BAD_QUERY).

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

痴情换悲伤 2024-08-29 10:33:14

为什么要费力检查网络服务或使其复杂化呢?

  1. 将所有属性获取到 DataTable 中。
  2. 然后创建一个DataView &然后您可以在所需的列上应用 DISTINCT。
  3. 最后用它来绑定到您的列表框。

Why bother to check with the web service or complicate it?

  1. Get all the properties into a DataTable.
  2. Then create a DataView & then you can apply the DISTINCT on required column.
  3. Finally use it to bind to your list box.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文