我正在使用 sharepoint 对象模型开发一个 sharepoint 站点。我在执行FullTextSqlQuery时收到“搜索请求无法连接到搜索服务”消息。Office Sharepoint Server 搜索和索引服务正在运行。我怎么解决这个问题?
这是代码:
FullTextSqlQuery qry = new FullTextSqlQuery(SPContext.Current.Site);
qry.QueryText = "SELECT Path, Title, Rank, Description FROM portal..scope() Where FREETEXT(*,'\"" + keys + "\"') ORDER BY \"Path\" DESC";
qry.EnableStemming = true;
qry.ResultTypes = ResultType.RelevantResults;
qry.KeywordInclusion = KeywordInclusion.AllKeywords;
qry.AuthenticationType = QueryAuthenticationType.NtAuthenticatedQuery;
ResultTableCollection queryResults = qry.Execute();
ResultTable queryResultsTable = queryResults[ResultType.RelevantResults];
DataTable queryDataTable = new DataTable();
queryDataTable.Load(queryResultsTable, LoadOption.OverwriteChanges);
ResultTable queryResultsTable = queryResults[ResultType.RelevantResults];
DataTable queryDataTable = new DataTable();
queryDataTable.Load(queryResultsTable, LoadOption.OverwriteChanges);