2010-12-02 19 views
0

いくつかの結果を返していたSharePoint検索サービスに送信していたxmlクエリを作成しました。私はそれからSQLクエリテキストを取り出し、オブジェクトモデルで使用し始めましたが、今は動作しません。私は以下のコードに基づいて何か間違っているように見えますか?SharepointオブジェクトモデルとWebServices

クエリ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(); 

答えて

2

あなたは、少なくとも追加する必要があります。

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

にします少なくとも2つの方法を公正に比較してください。次に、試してみてください:

ftq.AuthenticationType = QueryAuthenticationType.PluggableAuthenticatedQuery; 
関連する問題