How to Retrieve Excerpts?

33 views
Skip to first unread message

Jason

unread,
May 12, 2008, 7:48:23 PM5/12/08
to Thinking Sphinx
Great plugin! I'm wondering if it handles fetching the excerpts from
the sphinx server and/or highlighting the keyterms? I see the
functionality in riddle, but can't find it anywhere in thinking
sphinx. Thanks.
-Jason

Pat Allan

unread,
May 12, 2008, 8:21:14 PM5/12/08
to thinkin...@googlegroups.com
Hi Jason

What you've found is correct - there's not any current support for
excerpts in Thinking Sphinx, only Riddle - mainly because I've never
needed it, and no one else has really asked for it before.

That's not to say I won't add it - I'm just not sure of the best way
to implement it. Do you have any suggestions of syntax you feel would
work well for getting the excerpts? ie: Should TS tie each excerpt to
the corresponding object? Or should excerpts just return the id values
and the excerpt text, and the user has to pair that to the object
themselves? (This email may be directed at Jason, but everyone else is
welcome to share their ideas about possible implementation)

Cheers

--
Pat

Jason Rust

unread,
May 12, 2008, 8:59:07 PM5/12/08
to thinkin...@googlegroups.com
Hmm, good question about the implementation.  I would imagine it working as an additional parameter to the search method (i.e. :excerpts => true).  The search method would then need to figure out all the content fields and pass them on to the excerpt method in Riddle.  Perhaps the code from Ultrasphinx could serve as a base (http://blog.evanweaver.com/files/doc/fauna/ultrasphinx/classes/Ultrasphinx/Search.html#M000026)?

-Jason
--
rusted code
intelligent web-based solutions
http://www.rustedcode.com/
Reply all
Reply to author
Forward
0 new messages