我创建了一个 xml 查询,我将其发送到我的共享点搜索服务,该服务正在返回一些结果。然后我从中提取 SQL 查询文本并开始将其与对象模型一起使用,但现在它无法正常工作。根据下面的代码,看起来我做错了什么吗?
查询 XML(返回结果):
<QueryPacket xmlns="urn:Microsoft.Search.Query" Revision="1000">
<Query domain="QDomain">
<SupportedFormats><Format>urn:Microsoft.Search.Response.Document.Document</Format></SupportedFormats>
<Context>
<QueryText language="en-US" type="MSSQLFT"><![CDATA[ SELECT Title, Rank, owsPublished1,owsSocialx0020Networkx0020Update, Description, Write, Path FROM scope() ORDER BY "Rank" DESC ]]></QueryText>
</Context>
<Range><StartAt>1</StartAt><Count>20</Count></Range>
<EnableStemming>false</EnableStemming>
<TrimDuplicates>true</TrimDuplicates>
<IgnoreAllNoiseQuery>true</IgnoreAllNoiseQuery>
<ImplicitAndBehavior>true</ImplicitAndBehavior> <IncludeRelevanceResults>true</IncludeRelevanceResults> <IncludeSpecialTermResults>true</IncludeSpecialTermResults>
<IncludeHighConfidenceResults>true</IncludeHighConfidenceResults>
</Query></QueryPacket>
对象模型代码(没有):
SPSite site = new SPSite("http://sp-dev/");
ServerContext sc = ServerContext.GetContext(site);
FullTextSqlQuery ftq = new FullTextSqlQuery(sc);
string querySQL = @"SELECT Title, Rank, owsPublished1,owsSocialx0020Networkx0020Update, Description, Write, Path FROM scope() ORDER BY ""Rank"" DESC ";
ftq.QueryText = querySQL;;
ResultTableCollection results = ftq.Execute();