Document Descriptions empty in Search results using Query

Mar 22, 2013 at 3:50 PM
I'm doing a search query (operation: QUERY) using type STRING. When I get the results back, the description for documents and folders is empty. However, document libraries and views have a description. I've added the description field as a column in SharePoint but its still not coming through on the web services search.

I'd like to be able to use the description when displaying the search results to my users. For example, when I call GetListItems, I'm able to parse out the descriptions since they are in the returned XML.

What do I need to do to get the description field for documents to show up in the SPServices Query search results?
Coordinator
Mar 22, 2013 at 5:22 PM
Can you show the code you are using to call the Query Service?

M.
Mar 22, 2013 at 5:40 PM
Sure. Here it is.
function doSearchKeyword(theValue) {

    var queryText = "<QueryPacket xmlns='urn:Microsoft.Search.Query' Revision='1000'>";
    queryText += "<Query>";
    queryText += "<Context>";
    queryText += "<Range><Count>50</Count></Range>";
    queryText += "<QueryText language='en-US' type='STRING'>";
    queryText += theValue + " AND path:sites/jshoaf"; //Limit scope to 
    queryText += "</QueryText>";
    queryText += "</Context>";
    queryText += "</Query>";
    queryText += "</QueryPacket>";
        
  $().SPServices({
    operation:"Query",
    CAMLRowLimit: 20, 
    queryXml: queryText, 
    completefunc: fnCallBackKeyword 
  });
    
}
Coordinator
Mar 26, 2013 at 3:28 PM
Sorry I didn't get back to you faster on this.

I believe that the Query Web Services is only going to pass back values for Managed Properties. You can specify which you'd like returned like so:
var queryText = "<QueryPacket xmlns='urn:Microsoft.Search.Query' Revision='1000'>";
queryText += "<Query>";
queryText += "<Context>";
queryText += "<Range><Count>50</Count></Range>";
queryText += "<QueryText language='en-US' type='STRING'>";
queryText += "foo"; 
queryText += "</QueryText>";
queryText += "<Property name='Description' ></Property>";
queryText += "</Context>";
queryText += "</Query>";
queryText += "</QueryPacket>";
See http://msdn.microsoft.com/en-us/library/websvcsearch.queryservice.query(v=office.14).aspx

M.
Nov 5, 2013 at 11:34 PM
Description is not returned. Tag is not included in QueryResult. Might try using the asmx web service. It might return the property.