Rog D
asked on
Sharepoint Search API Call (QueryEX) Need to get a readable ContentType in my result set.
This code currently works but I would like to add some columns to the result set. Once such column is the ContentType of the document in the path column.
Here is the code I am using and it does indeed return a datatable with results but it has ContentTypeID (Some Unique Identifier).
SharePointSearchAPI.QueryS ervice queryService = new SharePointSearchAPI.QueryS ervice(); queryService.Url = SharePointServiceURL;
queryService.Credentials = System.Net.CredentialCache .DefaultNe tworkCrede ntials;
// set search string
StringBuilder xmlString = new StringBuilder("<QueryPacke t xmlns='urn:Microsoft.Searc h.Query'>" +
"<Query><SupportedFormats> <Format revision='1'> urn:Microsoft.Search.Respo nse.Docume nt:Documen t" +
"</Format></SupportedForma ts><Contex t><QueryTe xt language='en-US' type='STRING'>");
xmlString.Append(SharePoin tSearchStr ing); // user entered text
xmlString.Append("</QueryT ext></Cont ext>");
xmlString.Append("<Range>< Count>5000 </Count></ Range>");
xmlString.Append("</Query> </QueryPac ket>");
System.Data.DataSet queryResults = queryService.QueryEx(xmlSt ring.ToStr ing());
DataTable dtResults = queryResults.Tables[0];
Here is the code I am using and it does indeed return a datatable with results but it has ContentTypeID (Some Unique Identifier).
SharePointSearchAPI.QueryS
queryService.Credentials = System.Net.CredentialCache
// set search string
StringBuilder xmlString = new StringBuilder("<QueryPacke
"<Query><SupportedFormats>
"</Format></SupportedForma
xmlString.Append(SharePoin
xmlString.Append("</QueryT
xmlString.Append("<Range><
xmlString.Append("</Query>
System.Data.DataSet queryResults = queryService.QueryEx(xmlSt
DataTable dtResults = queryResults.Tables[0];
This question needs an answer!
Become an EE member today
7 DAY FREE TRIALMembers can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.