我正在尝试使用 KeywordQuery 构建 KQL 查询。我有一些要在结果表中显示的托管属性列,但它对我不起作用。
这是代码:
oKeywordQuery = new KeywordQuery(oSite);
oKeywordQuery.SelectProperties.Clear();
oKeywordQuery.QueryText = sQuery;
oKeywordQuery.KeywordInclusion = KeywordInclusion.AllKeywords;
oKeywordQuery.StartRow = 0;
oKeywordQuery.RowLimit = 500;
oKeywordQuery.EnableNicknames = true;
oKeywordQuery.EnablePhonetic = true;
oKeywordQuery.TrimDuplicates = false;
oKeywordQuery.SelectProperties.Add("IsDocument"); //This one as a test I was able to display but no managed properties
foreach (string sDisplayField in oDisplayFields)
{
oKeywordQuery.SelectProperties.Add(sDisplayField);
}
oSearchExecutor = new SearchExecutor();
oResultTableColl = oSearchExecutor.ExecuteQuery(oKeywordQuery);
var oResultTable = oResultTableColl.Filter("TableType", KnownTableTypes.RelevantResults);
oRTable = oResultTable.FirstOrDefault();
我能够得到结果,但没有显示托管属性列。似乎是什么问题?