搜索请求无法连接到搜索服务

时间:2010-01-04 11:37:58

标签: sharepoint sharepoint-api moss2007enterprisesearch sharedservicesprovider

我正在使用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);

1 个答案:

答案 0 :(得分:0)