APIを使用した問合せごとのスニペットの取得

対話WebサービスのTextSearchFilterタイプを使用して、問合せベースで特定の属性のスニペットを有効化できます。

対話Webサービスを使用してスニペットをリクエストするには、指定した検索インタフェースまたはテキスト検索が有効な属性で、TextSearchFilterタイプを使用します。検索インタフェースを指定した場合は、RECSEARCH_CONFIG XMLドキュメントでそのメンバーに対してスニペットが有効化されます。対話Webサービスは、RecordListEntry要素の一部としてスニペットを返します(レコード自体も返します)。

TextSearchFilterタイプでEnableSnippeting属性をtrueに設定すると、指定した属性または検索インタフェースに対して、問合せごとにスニペットが有効化されます。SnippetLength属性はスニペットの長さを設定し、検索語はスニペットの語を指定します。
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <Request xmlns="http://www.endeca.com/MDEX/conversation/3/0">
      <State>
        <TextSearchFilter Key="Description" Mode="AllPartial" 
          EnableSnippeting="true" SnippetLength="4" Language="en">
            gearing
        </TextSearchFilter>
      </State>
      <RecordListConfig Id="RecordList" MaxPages="30">
         <Column>Description</Column>
         <RecordsPerPage>5</RecordsPerPage>
      </RecordListConfig>
    </Request>
  </soap:Body>
</soap:Envelope>
注意: これらの設定を使用するのは、検索インタフェースが構成されていない単一の属性に、スニペット情報を指定する必要がある場合のみです。これらの設定は、RECSEARCH_CONFIG > SEARCH_INTERFACE要素の検索インタフェースのメンバーに、スニペットをグローバルに有効化する設定をオーバーライドしません。

レスポンス

次の対話Webサービスからのレスポンスは、RecordListEntryの一部としてスニペット情報を返します。
<cs:ContentElement xsi:type="cs:RecordList" Id="RecordList" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<cs:NumRecords>61157</cs:NumRecords>
<cs:TotalPages>1224</cs:TotalPages>
<cs:RecordRange First="751" Last="800"/>
    ...
<cs:RecordListEntry>
  <cs:Record>
    <Description type="mdex:string">A true multi-sport bike that offers 
      streamlined riding and a revolutionary design. Aerodynamic design lets you 
      ride with the pros, and the gearing will conquer hilly roads.
    </Description>
    <FactSales_RecordSpec type="mdex:string">SO44563-19</FactSales_RecordSpec>
  </cs:Record>
  <cs:ComputedProperties>
    <cs:SearchSnippets Key="Description">
       <cs:SearchSnippet>
         <cs:SnippetText>...and the gearing will conquer hilly </cs:SnippetText>
         <cs:SnippetTerm>gearing<cs:SnippetTerm>
         <cs:SnippetText> the gearing will conquer...</cs:SnippetText>
       </cs:SearchSnippet>
     </cs:SearchSnippets>
   </cs:ComputedProperties>
</cs:RecordListEntry>