Sharepoint Forum

 
Home » Forum » Sharepoint       Ask a questionRSS Feeds

Handling "no results" exception using QueryEx and only noise words

  Asked By: Payal Visaria         Date: Jan 07, 2010      Category: Sharepoint      Views: 295
 

We are writing an ASP.NET application that's using the Search QueryEx
web service for SharePoint. We submit strings and get result sets
back with no issues. The call to QueryEx looks like this:

ds = Search.QueryEx(queryString)

However, when a query is submitted with only "noise" words (like "a"
and "the"), we get an "internal server error" returned. We are able
to catch the error and display "no results" to the user, but our
question is: How can we tell the difference between a fatal error and
no results?

The SharePoint front-end search seems to handle it fine. We've looked
at the Search.aspx code and can't figure how SharePoint handles it.

Note: SearchPoint does not index noise words, so quering for "the"
will always return no results.

We also tried this with the Query function which returns XML instead
of a DataSet, and it does return "the query contained only noise
words - no results" in the XML string: It doesn't raise an exception
like QueryEx does.


Do you know someone who can help? Share a link to this thread on twitter, or facebook.

Tagged:                    

 

No Answers Found. Be the First, To Post Answer.

 


Your Answer
  • Answer should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].