Enabling snippets per query with the API

You can enable snippets for a particular attribute on a per query basis using the SearchFilter element in the Conversation Web Service.

Setting the EnableSnippeting attribute to true in the SearchFilter enables snippeting per query, for the specified property. The SnippetLength attribute sets the length of the snippet; the search term specifies the snippet term:
<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" EnableSnippeting="true" 
      SnippetLength="4">gearing</ns:SearchFilter>
  </ns:Operator>
</ns:Request>
Note: Use these settings only if you need to specify snippeting information for a single attribute for which there is no search interface configured. These settings do not override the settings that globally enable snippeting for members of the search interface in the RECSEARCH_CONFIG > SEARCH_INTERFACE elements.