2

SharePoint のクライアントを開発しており、2013 と 2010 の両方の SharePoint SearchServices を実装しています。secondaryFileExtension フィールドの取得に問題があります。2010 Search Service に対する私の要求の下に:

<QueryPacket Revision="1000">   
    <Query>     
        <Context> 
        <QueryText language="en-US" type="STRING">Audio SITE:"https://xxxxxxxxxxxxxxxxx.com/demo/testsp/Documents"
            </QueryText>    
       </Context>    
       <SupportedFormats Format="urn:Microsoft.Search.Response.Document.Document"/> 
       <Range> 
        <StartAt>1</StartAt> 
        <Count>30</Count>  
       </Range>   
       <EnableStemming>true</EnableStemming>
       <EnableSpellCheck>Suggest</EnableSpellCheck> 
       <IncludeSpecialTermsResults>true</IncludeSpecialTermsResults>     
       <IncludeRelevantResults>true</IncludeRelevantResults> 
       <ImplicitAndBehavior>true</ImplicitAndBehavior>     
       <TrimDuplicates>true</TrimDuplicates>
       <Properties>
          <Property name="Rank"/>
          <Property name="Title" />
          <Property name="Author"/>
          <Property name="Size" />
          <Property name="Path" />
          <Property name="Description" />
          <Property name="Write"/>
          <Property name="SiteName" />
          <Property name="HitHighlightedSummary"/>
          <Property name="HitHighlightedProperties"/>
          <Property name="ContentClass"/>
          <Property name="IsDocument"/>
          <Property name="FileExtension"/>
      </Properties>
    </Query>
</QueryPacket>

次の SOAP エンベロープを使用します。

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> 
    <soap:Body>    
        <Query xmlns="urn:Microsoft.Search">
        <queryXml>THE XML GOES HERE!</queryXml>
        </Query> 
</soap:Body> 
</soap:Envelope>

私は次の応答を得ています:

<Envelope>
    <Body>
        <QueryResponse>
            <QueryResult><ResponsePacket xmlns="ur…&lt;/QueryResult>
        </QueryResponse>
    </Body>
</Envelope>

クエリ結果:

<Document>
    <Action>
        <LinkUrl fileExt="aspx">https://xxxxxxxxxxxxxxx…&lt;/LinkUrl>
    </Action>
    <Properties>
        <Property>
            <Name>Rank</Name>
            <Type>Int64</Type>
            <Value>67299882</Value>
        </Property>
        <Property>
            <Name>Title</Name>
            <Type>String</Type>
            <Value>Audio 2014-01-18 19_10</Value>
        </Property>
        <Property>
            <Name>Author</Name>
            <Type>Object</Type>
            <Value>Testsp</Value>
        </Property>
        <Property>
            <Name>Size</Name>
            <Type>Int64</Type>
           <Value>62327</Value>
        </Property>
        <Property>
            <Name>Path</Name>
            <Type>String</Type>
          <Value>https://xxxxxxxxxxxxxxxx.com/demo/testsp/Documents/Forms/DispForm.aspx?ID=1</Value>
        </Property>
        <Property>
            <Name>Write</Name>
            <Type>DateTime</Type>
            <Value>2014-01-19T02:53:05</Value>
        </Property>
        <Property>
            <Name>SiteName</Name>
            <Type>String</Type>
           <Value>https://xxxxxxxxxxxxxx…&lt;/Value>
        </Property>
        <Property>
            <Name>HitHighlightedSummary</Name>
            <Type>String</Type>
            <Value><c0>Audio</c0> 2014-01-18…&lt;/Value>
        </Property>
        <Property>
            <Name>HitHighlightedProperties</Name>
            <Type>String</Type>
            <Value><HHTitle><c0>Audio</c0> 2…&lt;/Value>
        </Property>
        <Property>
            <Name>ContentClass</Name>
            <Type>String</Type>
            <Value>STS_ListItem_DocumentLibr…&lt;/Value>
        </Property>
        <Property>
            <Name>IsDocument</Name>
            <Type>Boolean</Type>
            <Value>false</Value>
        </Property>
        <Property>
            <Name>FileExtension</Name>
            <Type>String</Type>
            <Value>ASPX</Value>
        </Property>
    </Properties>
</Document>

ただし、プロパティ SecondaryFileExtention は存在しません (オーディオ ファイル タイプのため、"acc" が含まれている必要があります)。アクション タグには次のリンクが含まれています : https://xxxxxxxxxxxxxxx.com/demo/testsp/Documents/Forms/DispForm.aspx?ID=1から .acc ファイルをダウンロードできます。SharePoint 2013 Search Service で同様の要求を行うと、pdf ファイルの次のプロパティが返されます。

<element m:type="SP.SimpleDataRow">
    <Cells>
    <element m:type="SP.KeyValue">
        <Key>Rank</Key>
        <Value>12.6491832733154</Value>
        <ValueType>Edm.Double</ValueType>
    </element>
    <element m:type="SP.KeyValue">
        <Key>DocId</Key>
        <Value>4458265</Value>
        <ValueType>Edm.Int64</ValueType>
    </element>
    <element m:type="SP.KeyValue">
       <Key>WorkId</Key>
       <Value>4458265</Value>
       <ValueType>Edm.Int64</ValueType>
    </element>
    <element m:type="SP.KeyValue">
       <Key>Title</Key>
       <Value>W9</Value>
       <ValueType>Edm.String</ValueType>
    </element>
    <element m:type="SP.KeyValue">
       <Key>Author</Key>
       <Value>Dmitry Ivahno;Test User1</Value>
       <ValueType>Edm.String</ValueType>
    </element>
    <element m:type="SP.KeyValue">
       <Key>Size</Key>
       <Value>162678</Value>
       <ValueType>Edm.Int64</ValueType>
    </element>
    <element m:type="SP.KeyValue">
       <Key>Path</Key>
       <Value>https://xxxxxxxxxxxx.co…&lt;/Value>
       <ValueType>Edm.String</ValueType>
    </element>
    <element m:type="SP.KeyValue">
       <Key>Description</Key>
       <Value m:null="true"/>
       <ValueType>Null</ValueType>
    </element>
    <element m:type="SP.KeyValue">
       <Key>Write</Key>
       <Value>2013-05-23T14:18:46.00000…&lt;/Value>
       <ValueType>Edm.DateTime</ValueType>
    </element>
    <element m:type="SP.KeyValue">
       <Key>CollapsingStatus</Key>
       <Value>0</Value>
       <ValueType>Edm.Int64</ValueType>
    </element>
    <element m:type="SP.KeyValue">
       <Key>HitHighlightedSummary</Key>
       <Value xml:space="preserve">Form    W-9 (Rev. Decembe…&lt;/Value>
       <ValueType>Edm.String</ValueType>
    </element>
    <element m:type="SP.KeyValue">
       <Key>HitHighlightedProperties</Key>
       <Value m:null="true"/>
       <ValueType>Null</ValueType>
    </element>
    <element m:type="SP.KeyValue">
       <Key>contentclass</Key>
       <Value>STS_ListItem_DocumentLibr…&lt;/Value>
       <ValueType>Edm.String</ValueType>
    </element>
    <element m:type="SP.KeyValue">
       <Key>PictureThumbnailURL</Key>
       <Value m:null="true"/>
       <ValueType>Null</ValueType>
    </element>
    <element m:type="SP.KeyValue">
       <Key>ServerRedirectedURL</Key>
       <Value m:null="true"/>
       <ValueType>Null</ValueType>
    </element>
    <element m:type="SP.KeyValue">
       <Key>ServerRedirectedEmbedURL</Key>
       <Value m:null="true"/>
       <ValueType>Null</ValueType>
    </element>
    <element m:type="SP.KeyValue">
       <Key>ServerRedirectedPreviewUR…&lt;/Key>
       <Value m:null="true"/>
       <ValueType>Null</ValueType>
    </element>
    <element m:type="SP.KeyValue">
       <Key>FileExtension</Key>
       <Value>pdf</Value>
       <ValueType>Edm.String</ValueType>
    </element>
    <element m:type="SP.KeyValue">
       <Key>ContentTypeId</Key>
       <Value>0x010100FA0E9F7CB9E8B94DB…&lt;/Value>
       <ValueType>Edm.String</ValueType>
    </element>
    <element m:type="SP.KeyValue">
       <Key>ParentLink</Key>
       <Value>https://xxxxxxxxxxx.co…&lt;/Value>
       <ValueType>Edm.String</ValueType>
    </element>
    <element m:type="SP.KeyValue">
       <Key>ViewsLifeTime</Key>
       <Value>88</Value>
       <ValueType>Edm.Int64</ValueType>
    </element>
    <element m:type="SP.KeyValue">
       <Key>ViewsRecent</Key>
       <Value>0</Value>
       <ValueType>Edm.Int64</ValueType>
    </element>
    <element m:type="SP.KeyValue">
       <Key>SectionNames</Key>
       <Value/>
       <ValueType>Edm.String</ValueType>
    </element>
    <element m:type="SP.KeyValue">
       <Key>SectionIndexes</Key>
       <Value/>
       <ValueType>Edm.String</ValueType>
    </element>
    <element m:type="SP.KeyValue">
       <Key>SiteLogo</Key>
       <Value m:null="true"/>
       <ValueType>Null</ValueType>
    </element>
    <element m:type="SP.KeyValue">
       <Key>SiteDescription</Key>
       <Value m:null="true"/>
       <ValueType>Null</ValueType>
    </element>
    <element m:type="SP.KeyValue">
       <Key>deeplinks</Key>
       <Value m:null="true"/>
       <ValueType>Null</ValueType>
    </element>
    <element m:type="SP.KeyValue">
       <Key>importance</Key>
       <Value>0</Value>
       <ValueType>Edm.Int64</ValueType>
    </element>
    <element m:type="SP.KeyValue">
       <Key>SiteName</Key>
       <Value>https://xfa.sharepoint.co…&lt;/Value>
       <ValueType>Edm.String</ValueType>
    </element>
    <element m:type="SP.KeyValue">
       <Key>IsDocument</Key>
       <Value>true</Value>
       <ValueType>Edm.Boolean</ValueType>
    </element>
    <element m:type="SP.KeyValue">
       <Key>LastModifiedTime</Key>
       <Value>2013-05-23T14:18:46.00000…&lt;/Value>
       <ValueType>Edm.DateTime</ValueType>
    </element>
    <element m:type="SP.KeyValue">
       <Key>FileType</Key>
       <Value>pdf</Value>
       <ValueType>Edm.String</ValueType>
    </element>
    <element m:type="SP.KeyValue">
       <Key>IsContainer</Key>
       <Value>false</Value>
       <ValueType>Edm.Boolean</ValueType>
    </element>
    <element m:type="SP.KeyValue">
       <Key>WebTemplate</Key>
       <Value m:null="true"/>
       <ValueType>Null</ValueType>
    </element>
    <element m:type="SP.KeyValue">
       <Key>SecondaryFileExtension</Key>
       <Value>pdf</Value>
       <ValueType>Edm.String</ValueType>
    </element>
    <element m:type="SP.KeyValue">
       <Key>docaclmeta</Key>
       <Value m:null="true"/>
       <ValueType>Null</ValueType>
    </element>
    <element m:type="SP.KeyValue">
       <Key>OriginalPath</Key>
       <Value>https://xfa.sharepoint.co…&lt;/Value>
       <ValueType>Edm.String</ValueType>
    </element>
    <element m:type="SP.KeyValue">
       <Key>PartitionId</Key>
       <Value>d4cd988f-8939-401f-82e9-8…&lt;/Value>
       <ValueType>Edm.Guid</ValueType>
    </element>
    <element m:type="SP.KeyValue">
       <Key>UrlZone</Key>
       <Value>0</Value>
       <ValueType>Edm.Int32</ValueType>
    </element>
    <element m:type="SP.KeyValue">
       <Key>AAMEnabledManagedProperti…&lt;/Key>
       <Value>AttachmentURI;deeplinks;D…&lt;/Value>
       <ValueType>Edm.String</ValueType>
    </element>
    <element m:type="SP.KeyValue">
       <Key>RenderTemplateId</Key>
       <Value>~sitecollection/_catalogs…&lt;/Value>
       <ValueType>Edm.String</ValueType>
    </element>
    <element m:type="SP.KeyValue">
       <Key>piSearchResultId</Key>
       <Value>0_1</Value>
       <ValueType>Edm.String</ValueType>
    </element>
    </Cells>

ひょっとして、SharePoint 2010 Search API を使用して実際のファイル拡張子を取得することはできますか?

4

1 に答える 1

1

SharePoint 2010 の SOAP 呼び出しを検索サービスに対して (SPServices を使用して) 行っているときに、同様の問題に遭遇しました。検索結果に表示する必要があるサブヘッダー (1 行のテキスト) と記事カテゴリ (管理されたメタデータ) の 2 つのカスタム フィールドがありましたが、返されたのはまさにあなたがリストしたもの (ファイル拡張子によるランク) )。

検索結果に表示されるようにするには、これら 2 つのフィールドを「管理プロパティ」として追加する必要がありました。手順は次のとおりです。 14).aspx (ただし、集中管理レベルのアクセスが必要です)。

管理プロパティがそこにあると、検索に使用できる管理プロパティを表示できたものの (FAST Search for SharePoint ツール: http://fastforsharepoint.codeplex.com/を使用)、別の問題に遭遇しました。 SOAP 呼び出しの <Properties> リストに入れたとしても、結果に表示されます。

これに対する解決策は、実際には <QueryText> フィールドでサブヘッダー値にワイルドカードを指定することでした (「#」に注意してください)...これにより、これら 2 つのフィールドが強制的に表示されるように見えました (パス条件はオプションです)。

<QueryText language='en-US' type='STRING'>
    My Search Phrase SubHeader:# AND path:/PathTo/My/SPSite
</QueryText>

それが仕様によるものなのか、それともSharePointの「機能」であり、そこに何かが存在するか要求されているフィールドのみを返すかどうかはわかりません。

サーバーレベルのアクセス権がある場合は、おそらくもっと洗練されたソリューションが存在しますが、これは私にとってはうまくいきました.

于 2014-03-18T17:32:54.523 に答える