【问题标题】:Sharepoint Object Model vs WebServicesSharepoint 对象模型与 WebServices
【发布时间】:2010-12-02 21:29:21
【问题描述】:

我创建了一个 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();

【问题讨论】:

    标签: .net sharepoint sharepoint-object-model


    【解决方案1】:

    你至少需要添加:

    ftq.EnableStemming = false;
    ftq.TrimDuplicates = true;
    ftq.IgnoreAllNoiseQuery = true;
    ftq.KeywordInclusion = KeywordInclusion.AllKeywords;
    

    至少对这两种方法进行公平的比较。那么,你也可以试试:

    ftq.AuthenticationType = QueryAuthenticationType.PluggableAuthenticatedQuery;
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-04-28
      • 1970-01-01
      • 2014-02-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多