4

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

naivists
  • 32,681
  • 5
  • 61
  • 85
  • Most things you can do with the API can be done with web services. I'd check to see if you can convert that code. – Jonesie Feb 27 '10 at 19:48

1 Answers1

0

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.
Echilon
  • 10,064
  • 33
  • 131
  • 217
  • 1
    Thank you, the idea is good. The thing is, I'm looking for an effective solution. SharePoint search engine slows down when you select all the items in the data store. So, the only option how this could work is if I'd load all the items once a day and store the list in cache. – naivists Nov 21 '12 at 05:34