Sorry for not getting back to you sooner on this Walter.

This may indeed be possible if you change the before_match and after_match 
excerpts options to '<li>' and '</li>' respectively. You can do this via the 
:excerpt_options search option:

  Title.search 'foo', :excerpt_options => {:before_match => '<li>', 
:after_match => '</li>'}

All the options in the Sphinx docs should be able to be used.
http://sphinxsearch.com/docs/manual-2.1.7.html#api-func-buildexcerpts

-- 
Pat

On 23 May 2014, at 12:54 am, Walter Lee Davis <[email protected]> wrote:

> I have a collection of titles, and I am searching them with TS 2. The results 
> include some titles with multiple matches to the search string, which are 
> being formatted correctly with ellipses and highlighted search term matches.
> 
> My client would like the multiple matches within a title to be shown as a 
> list, like this:
> 
>       1. text leading up to [match string] and text thereafter
>       2. text leading up to [match string] and text thereafter
>       3. text leading up to [match string] and text thereafter
> 
> so a searcher can see that the same term hit multiple times in that title 
> more clearly. All I can see in the excerpts documentation (both TS and 
> Sphinx) is that you can insert a string between multiple hits in a record. Is 
> there a way to use HTML in this context (like </li><li>), or to override the 
> excerpt builder in TS2? From what I gleaned from the Sphinx documentation, 
> the return from the BuildExcerpts command is a list of strings, so I am 
> thinking that this may be possible as long as TS intercepts the list rather 
> than the raw string returned with the concatenation operation already 
> completed.
> 
> The other thing I was thinking was that I could just search for that 
> concatenation string in the result, and mangle the text into a list by 
> splitting on that term (obviously I would change it to something that could 
> never occur in my title records before I tried that).
> 
> Are there any other clever bits in TS that I have not discovered yet which 
> could make this simpler?
> 
> Thanks for all you do,
> 
> Walter
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Thinking Sphinx" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/thinking-sphinx.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Thinking Sphinx" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/thinking-sphinx.
For more options, visit https://groups.google.com/d/optout.

Reply via email to