2013-09-24 59 views
0

我有我的原子(大陸XML的列表)在此URL​​這樣的:如何在Google Search Appliance中對訂閱源編制索引?

<?xml version="1.0" encoding="UTF-8"?> 
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/"> 
    <title>List of all continents</title> 
    <opensearch:totalResults>{{ continents_length }}</opensearch:totalResults> 
    <opensearch:startIndex>{{ continents.start_index }}</opensearch:startIndex> 
    <opensearch:itemsPerPage>{{ count }}</opensearch:itemsPerPage> 
    <opensearch:Query continent="request" searchTerms="" startPage="{{ continents.start_index }}" /> 
    <author><name>My_site</name></author> 
    <id>urn:domain-id:mysite.com:continent</id> 

    <link rel="self" href="{{ url }}" /> 
    {% for continent in continents %} 
    <entry> 
     <span class="continent_id">{{ continent.continent_id }}</span> 
     <span class="continent_name">{{ continent.continent_name }}</span> 
     <span class="list_countries">{{ continent.list_countries }}</span> 
    </entry> 
    {% endfor %} 
</feed> 

,當我想在GSA-接口PUT和索引我進我已經使用這個:

<?xml version="1.0" encoding="utf-8"?> 
<entry xmlns="http://www.w3.org/2005/Atom"> 
    <title>continent</title> 
    <id>urn:domain-id:mysite.com:continent</id> 
    <author> 
     <name>admin user</name> 
    </author> 
    <link rel="self" href=".../feed/continent"/> 
    <content type="xhtml"> 
     <div xmlns="http://www.w3.org/1999/xhtml"> 
      <span id="refresh-each">15 12,14,18 * * *</span> 
      <span id="gsa-datasource">continent</span> 
      <span id="gsa-feedtype">full</span> 
      <span id="url">...continent/search?view=atom</span> 
      <span id="opensearch-pattern">&amp;count=100&amp;startPage=%STARTPAGE%</span> 
      <ul class="connection"> 
       <li id="userid">user</li> 
       <li id="password">pass</li> 
      </ul> 
      <ul id="metadata"> 
       <li id="continent_id">atom:entry/xhtml:span[@class='continent_id']</li> 
       <li id="continent_name">atom:entry/xhtml:span[@class='continent_name']</li> 
       <li id="list_countries">atom:entry/xhtml:span[@class='list_countries']</li> 
      </ul> 
      <div id="xsl-content"> 
       <![CDATA[ 
        <xsl:stylesheet version="1.0" 
         xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
         xmlns:atom="http://www.w3.org/2005/Atom" 
         xmlns:xhtml="http://www.w3.org/1999/xhtml" 
         exclude-result-prefixes="atom xhtml"> 

         <xsl:template name="FormatDescription"> 
          <xsl:param name="name"/> 
          <xsl:value-of select="$name"/> 
         </xsl:template> 

         <xsl:template match="atom:entry"> 
          <html> 
           <body> 
            <xsl:apply-templates select="atom:entry/xhtml:span" /> 
           </body> 
          </html> 
         </xsl:template> 
         <xsl:template match="atom:entry/xhtml:span"> 
          <xsl:copy-of select="*"/> 
         </xsl:template> 

        </xsl:stylesheet> 
       ]]> 
      </div> 
     </div> 
    </content> 
</entry> 

但是當我檢查的轉移文件的通量它錯誤返回0文件:

ProcessNode: Missing required attribute url. skipping element., skipping record 

對於第二個指數和tird之一,有沒有錯誤,也沒有文件!

200 OK Feed continent has been pushed successfully to the Google Search Appliance. 

任何建議/建議?

+0

嗨,我今天看到你的問題研究我自己的GSA feed問題。您確定只需將ATOM Feed注入GSA而不必首先轉換它們,也許可以通過XSLT進行轉換?可能他們確實允許這樣做,我不確定,但是你看過關於gsa feed協議的頁面嗎? https://developers.google.com/search-appliance/documentation/64/feedsguide –

回答

2

在此之後,「feed」這個詞在這裏很混亂。 GSA內容供稿不像任何RSS或Atom供稿。這裏有一個簡單的例子(從文件):

<?xml version="1.0" encoding="utf-8"?> 
<!DOCTYPE gsafeed PUBLIC "-//Google//DTD GSA Feeds//EN" ""> 
<gsafeed> 
    <header> 
    <datasource>hello</datasource> 
    <feedtype>incremental</feedtype> 
    </header> 
    <record url="http://www.corp.enterprise.com/hello02" mimetype="text/plain"> 
    <content>UPDATED - This is hello02</content> 
    </record> 
</group> 
</gsafeed> 

正如你可以看到,這是一個非常特殊的XML格式,而不是與網站更新源格式共享。這個文檔很好:http://www.google.com/support/enterprise/static/gsa/docs/admin/70/gsa_doc_set/feedsguide/feedsguide.html

相關問題