1
我试图在SharePoint网站中执行文档搜索,但是我需要将结果受众群体定位应用于结果,然后才将结果显示给用户。FullTextSqlQuery中的受众定位
但是我很努力是(a)原始查询检索范围内的目标受众设置...
using (SPSite site = new SPSite(SPContext.Current.Site.ID)) {
using (FullTextSqlQuery fullText = new FullTextSqlQuery(site)) {
fullText.QueryText = @"select Title, Path, Description, TargetAudience from scope() where ((""scope"" = 'All Sites'))"
+ @" and IsDocument = 1 and freetext(*, '{0}')";
fullText.QueryText = string.Format(fullText.QueryText, this.documentFilter.AllOfTheseWords);
fullText.ResultTypes = ResultType.RelevantResults;
ResultTableCollection resultTableCollection = fullText.Execute();
allofTheseWords = new DataTable();
if (resultTableCollection.Exists(ResultType.RelevantResults)) {
allofTheseWords.Load(resultTableCollection[ResultType.RelevantResults], LoadOption.OverwriteChanges);
}
}
}
或(b)检索原始查询中的列表项ID(GUID),这样我可以那么每个结果占用原来的列表项(因此适用观众使用列表项指定目标。
有什么建议?