public ResultTableCollection ExecuteSearch(ClientContext context, Guid webId, Guid siteId) { SearchExecutor searchExecutor = new SearchExecutor(context); KeywordQuery keywordQuery = SharepointCsomProvider.GetKeywordQuery(webId, siteId, context); ClientResult <ResultTableCollection> clientResult = searchExecutor.ExecuteQuery(keywordQuery); context.ExecuteQuery(); return(clientResult.Value); }
public ResultTableCollection ExecuteSearch(ClientContext context, string location, bool searchOnlySiteCollection) { SearchExecutor searchExecutor = new SearchExecutor(context); KeywordQuery keywordQuery = searchOnlySiteCollection ? SharepointCsomProvider.GetKeywordQueryForSiteCollectionOnly(location, context) : SharepointCsomProvider.GetKeywordQuery(location, context); ClientResult <ResultTableCollection> clientResult = searchExecutor.ExecuteQuery(keywordQuery); context.ExecuteQuery(); return(clientResult.Value); }