0
在SharePoint搜索服務適用於文檔中的內容和它的元數據(屬性),我需要檢索的字段名稱和它的內容(的SPField)的搜索是在它匹配。的SharePoint 2013 KeywordQuery搜索的SPField
我要補充什麼領域的SelectProperties反對呢?或在哪裏可以找到這些信息。
KeywordQuery keywordQuery = new KeywordQuery(SPContext.Current.Site);
keywordQuery.QueryText = queryText;
keywordQuery.ResultsProvider = SearchProvider.Default;
var selecProperties = keywordQuery.SelectProperties;
selecProperties.Add("UniqueId");
selecProperties.Add("FileLeafRef");
selecProperties.Add("ListId");
selecProperties.Add("WebId");
selecProperties.Add("Created");
selecProperties.Add("CheckoutUserOWSUSER");
SearchExecutor searchExecutor = new SearchExecutor();
ResultTableCollection resultTableCollection = searchExecutor.ExecuteQuery(keywordQuery);
ResultTable resultTable = resultTableCollection.Filter("TableType", KnownTableTypes.RelevantResults).FirstOrDefault();
DataTable dataTable = resultTable.Table;