2014-01-28 59 views
2

我正在開發SharePoint的客戶端,我正在實現2013和2010 SharePoint SearchServices。我無法獲得secondaryFileExtension字段。 下面我對2010年搜索服務要求:SharePoint基本搜索服務2010 API secondaryFileExtention字段不存在

<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…</QueryResult> 
     </QueryResponse> 
    </Body> 
</Envelope> 

的QueryResult中:

<Document> 
    <Action> 
     <LinkUrl fileExt="aspx">https://xxxxxxxxxxxxxxx…</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…</Value> 
     </Property> 
     <Property> 
      <Name>HitHighlightedSummary</Name> 
      <Type>String</Type> 
      <Value><c0>Audio</c0> 2014-01-18…</Value> 
     </Property> 
     <Property> 
      <Name>HitHighlightedProperties</Name> 
      <Type>String</Type> 
      <Value><HHTitle><c0>Audio</c0> 2…</Value> 
     </Property> 
     <Property> 
      <Name>ContentClass</Name> 
      <Type>String</Type> 
      <Value>STS_ListItem_DocumentLibr…</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 當我轉到此鏈接時,我看到一個帶有2個字段名稱和標題的表單,並且可以從中下載.acc文件。 做與SharePoint 2013搜索服務類似請求返回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…</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…</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…</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…</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…</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…</Value> 
     <ValueType>Edm.String</ValueType> 
    </element> 
    <element m:type="SP.KeyValue"> 
     <Key>ParentLink</Key> 
     <Value>https://xxxxxxxxxxx.co…</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…</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…</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…</Value> 
     <ValueType>Edm.String</ValueType> 
    </element> 
    <element m:type="SP.KeyValue"> 
     <Key>PartitionId</Key> 
     <Value>d4cd988f-8939-401f-82e9-8…</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…</Key> 
     <Value>AttachmentURI;deeplinks;D…</Value> 
     <ValueType>Edm.String</ValueType> 
    </element> 
    <element m:type="SP.KeyValue"> 
     <Key>RenderTemplateId</Key> 
     <Value>~sitecollection/_catalogs…</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的搜索API真正的文件擴展名?

回答

1

在對搜索服務進行SharePoint 2010 SOAP調用時(使用SPServices),我遇到了類似的問題。我有2個自定義字段 - 一個子標題(單行文本)和一個文章類別(託管元數據) - 我需要在搜索結果中顯示出來,而我回來的所有內容正是您列出的內容(通過文件擴展名排序)。

這兩個字段必須添加爲「託管屬性」才能返回到搜索結果中 - 步驟如下:http://technet.microsoft.com/en-us/library/ff621097(v=office.14).aspx(儘管您需要中央管理級別訪問權限)。

一旦我的託管屬性在那裏,我遇到了另一個障礙,因爲雖然我可以看到可用於搜索的託管屬性(使用FAST Search for SharePoint工具:http://fastforsharepoint.codeplex.com/),但它們沒有顯示在結果中,即使我把它們放在SOAP調用的<屬性>列表中。

這個問題的解決實際上是指定與在<QUERYTEXT>場我的子報頭值通配符(注意,「#」)...這似乎迫使這兩個領域出現(路徑條件是可選):

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

不知道這是由於設計或者如果它是一個「功能」在SharePoint只返回現場的東西存在,有和/或請求。

如果您有服務器級別的訪問權限,那麼可能會有更優雅的解決方案,但這對我很有用。