Batch Queries in thinking sphinx

57 views
Skip to first unread message

mohitnegi

unread,
Jan 13, 2012, 2:17:58 AM1/13/12
to thinkin...@googlegroups.com
Hi,

Does TS support batch queries.

I have an array of queries, currently i am looping over the array and each time the result get will be inserted in the array, so let's say i have some 5 queries i am looping 5 times running each query and getting the result.

I read about multiple queries running in a batch in sphinx, Can it be done using TS also.

P.S. :  all the queries has to be queried on same index

----------------
Thanks
Mohit

Pat Allan

unread,
Jan 21, 2012, 11:28:53 PM1/21/12
to thinkin...@googlegroups.com

Hi Mohit

TS does support batch queries, although it's not really documented…

searches = ThinkingSphinx::Search.bundle_searches do |sphinx|
sphinx.search 'restaurants'
sphinx.search 'automobile'
end

This returns an array of search result objects. If you want to limit searches to specific models, use :classes => [Model] in the search calls.

Cheers

--
Pat

> --
> You received this message because you are subscribed to the Google Groups "Thinking Sphinx" group.
> To view this discussion on the web visit https://groups.google.com/d/msg/thinking-sphinx/-/b9SkISNj5SUJ.
> To post to this group, send email to thinkin...@googlegroups.com.
> To unsubscribe from this group, send email to thinking-sphi...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/thinking-sphinx?hl=en.

Reply all
Reply to author
Forward
0 new messages