スニペットを取得するリクエストの例

対話Webサービスを使用してスニペットをリクエストするには、指定した検索インタフェースで、SearchFilterを使用します。対話Webサービスは、RecordListEntry要素の一部としてスニペットを返します(レコード自体も返します)。

次のように、SearchFilterに検索インタフェースの名前を指定すると、スニペット情報を取得します。
<ns:SearchFilter Key="My search interface">
</ns:SearchFilter>
このとき、My search interfaceは、スニペットがRECSEARCH_CONFIG XMLドキュメントのメンバーに有 効化されている検索インタフェースの名前です。

リクエストの例

次のリクエストは、検索インタフェースDescriptionの対話Webサービスを使用してスニペットをリクエストする方法を示しています。
<ns:Request>
  <ns:State/>
  <ns:Operator xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
   xmlns:ns="http://www.endeca.com/MDEX/conversation/2/0" xsi:type="ns:SearchOperator">
    <ns:SearchFilter Key="Description">gearing</ns:SearchFilter>
  </ns:Operator>
  <ns:ContentElementConfig xsi:type="ns:RecordListConfig"
     Id="RecordList"
     HandlerFunction="RecordListHandler"
     HandlerNamespace="http://www.endeca.com/MDEX/conversation/2/0" 
     MaxPages="2">
    <ns:Column>Description</ns:Column>
    <ns:RecordsPerPage>50</ns:RecordsPerPage>
    <ns:Page>15</ns:Page>
    <ns:Sort Key="Description" Direction="Ascending"/>
  </ns:ContentElementConfig>
</ns:Request>

レスポンスの例

次の対話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>