Request examples for retrieving snippets

To request snippets with the Conversation Web Service, use the SearchFilter with the specified search interface. The Conversation Web Service returns snippets as part of the RecordListEntry element (which also returns the records themselves).

Example request

Specifying the name of the search interface in the SearchFilter retrieves snippeting information:
 <ns:SearchFilter Key="My search interface">
</ns:SearchFilter>
where My search interface is the name of the search interface for which snippeting is enabled for its members in the RECSEARCH_CONFIG XML document.
The following request illustrates how to request a snippet with the Conversation Web Service for a search interface Description:
<ns:Request>
  <ns:State/>
  <ns:Operator xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
   xmlns:ns="http://www.endeca.com/MDEX/conversation/1/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/1/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>
The following response from the Conversation Web Service returns snippeting information as part of the 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>
...