Number of results in group by
Hi Pat,
Is there a way to return more than one result when using a group_by clause?
This is what I have right now:
ThinkingSphinx.search(params[:query], group_by: :sphinx_internal_class)
Ideally I would like something like this:
ThinkingSphinx.search(params[:query], group_by: :sphinx_internal_class, max_results_per_group: 5)
Cheers!
Rai
Comments are currently closed for this discussion. You can start a new one.
Keyboard shortcuts
Generic
| ? | Show this help |
|---|---|
| ESC | Blurs the current field |
Comment Form
| r | Focus the comment reply box |
|---|---|
| ^ + ↩ | Submit the comment |
You can use Command ⌘ instead of Control ^ on Mac
Support Staff 1 Posted by Pat Allan on 26 Jul, 2014 05:13 PM
Hi Rai
A feature for this was added to Sphinx in v2.2.1, and it's in Thinking Sphinx v3.1.0 onwards, using the :group_best option:
Currently, 2.2.3 is the only Sphinx 2.2.x release on the Flying Sphinx servers, so make sure you've got that set under the production settings in
config/thinking_sphinx.yml- and of course, test it locally first :)Cheers
Pat
2 Posted by Raimond Garcia on 27 Jul, 2014 09:11 PM
Awesome Pat, works like a charm.
Thank you!
Support Staff 3 Posted by Pat Allan on 28 Jul, 2014 12:53 AM
Great :)
Pat Allan closed this discussion on 28 Jul, 2014 12:53 AM.