using Microsoft.Office.Server.Search.Query; ResultTableCollection rtc = null; DataTable retResults = new DataTable(); string fullTextSql = "SELECT ModifiedBy,Title,owsCheckoutUser,FileExtension,owsFileLeafRef,Path FROM SCOPE() WHERE owsCheckoutUser IS NOT NULL" using (SPSite site = new SPSite(http://servername)) { using (FullTextSqlQuery query = new FullTextSqlQuery(site)) { query.QueryText = fullTextSql; query.ResultTypes = ResultType.RelevantResults; query.RowLimit = rowLimit; rtc = query.Execute(); if (rtc.Count > 0) { using(ResultTable relevantResults = rtc[ResultType.RelevantResults]) retResults.Load(relevantResults, LoadOption.OverwriteChanges); } }
0 comments:
Post a Comment