I am trying to pick the right indexing/search solution for my Rails 4 app. So far I have considered Sunspot (Solr) and Thinking Sphinx (Sphinx), but from reading the documentation on both of them, I am not sure whether they can satisfy my use case.
For simplicities sake, let's say I have "Sheep" and "Herd"s in my model. Every sheep belongs to exactly one herd.
I would like to present my user with a query interface that allows to specify criterions on sheep and herds. The search results shall be grouped by herd. A part of the criterions should work as facets, provding the user with the information how many sheeps/herds he will find when he specifies a certain value for a facet.
QUERY INTERFACE
Sheep criterions
Name: _____________
Color
[ ] Black (14)
[X] White (36)
Age: Between [ ] and [ ]
Herd criterions
Description contains: _____________
Country
[ ] Australia (12)
[ ] Germany (10)
[ ] Sealand (1)
RESULTS
+ Herd 37 (Australia) with 12 matching sheep (15 total)
+ Herd 10 (Germany) with 20 matching sheep (27 total)
- Herd 42 (Sealand) with 1 matching sheep (1 total)
Sad lonely white sheep
+ Herd 11 (Germany) with 3 matching sheep (7 total)
So I would like to do a faceted search on sheep, group them by herd and then do another faceted search on the results. Is this possible in either Solr, Sphinx or yet another search engine that can be combined with rails?
I considered duplicating the herd attributes into the sheep - at least for the indexing - but it seemed that this would produce an enormeus overhead.