You can enable snippets for a particular attribute on a per-query basis using the TextSearchFilter type in the Conversation Web Service.
To request snippets with the Conversation Web Service, use the TextSearchFilter type with the specified search interface or text-search enabled attribute. If you specify a search interface, it will be one for which snippeting is enabled for its members in the RECSEARCH_CONFIG XML document. The Conversation Web Service returns snippets as part of the RecordListEntry element (which also returns the records themselves).
<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>
<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>