Get all ids matching a request

4 views
Skip to first unread message

seb

unread,
Nov 13, 2009, 1:27:24 AM11/13/09
to Thinking Sphinx
Hi

I have a weird question I guess more about Sphinx than Thinking
Sphinx, but I want to do it in a Rails application.
I'd like to get all ids (only ids not full object) matching a request.
I'd like to know if that's possible and if it will be still fast
enough even on large dataset (let's say 5 millions)

Thanks
Sébastien

Pat Allan

unread,
Nov 13, 2009, 8:09:06 AM11/13/09
to thinkin...@googlegroups.com
Hi Sébastien

There is a search_for_ids method on each indexed model, as well as
ThinkingSphinx.search_for_ids - this will return just the primary key
values for the matching records. I'm pretty sure it'll be fast enough
with a large data-set - but that will depend on the complexity of your
query.
http://freelancing-god.github.com/ts/en/searching.html#ids

(Only added this to the documentation a couple of days ago)

--
Pat
Reply all
Reply to author
Forward
0 new messages