开发者

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

开发者 https://www.devze.com 2022-12-20 20:53 出处:网络
I am building a phone catalog of my organization (an AJAX application which accesses the search.asmx web service).

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 s开发者_Python百科pecify 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).


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.
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号