views:

238

answers:

1

Assume I'm indexing a table of books. They have title, author, description, etc.

I want to do a search across all fields and return the title of the books that contain my search term. I can do a search and return the book_id (doc_id) from Sphinx so I can look them up myself, but what would be really awesome is if Sphinx just gave me the titles so I don't have to hit the database at all. I can get Sphinx to return different attributes to me, but getting a text field is eluding me.

Is this possible? If so, how do you do it?

[Update] Found this today: http://www.sphinxsearch.com/faq.html#row-storage

A: 

Hate to kill the idea so quickly, but it's not possible. Sphinx doesn't return any information about the values of fields, nor even which fields provided a match on the query.

And to elaborate a little more... Sphinx usually loads all attribute values into memory, which is probably why it's fine with returning them for each result. It could be that fields are stored in a non-reversible encoding, and so can't be translated back to normal values? That's a stab in the dark, though.

pat