We're working on something very like this at Westfield. I'm working on using 
field collapsing (aka. Grouping) to achieve this. That will allow us to compare 
apples to apples as it were, rather than having disparate result sets being 
merged and scored together. The trick comes when different filters are required 
against different objects. 

Andrew

Sent on the run. 

On 14/02/2012, at 16:44, Paul Annesley <[email protected]> wrote:

> With ThinkingSphinx, you can do something like:
> 
> ThinkingSphinx.search(search_term, classes: [ SomeModel, AnotherModel ])
> 
> The return value is a mixed-type collection of model objects.
> 
> Your view could then delegate to a different partial view for each type.
> I guess this (HAML) would do that automatically:
> - @results.each do |result|
>  = render result
> 
> I had a similar requirement, but the result objects had almost-the-same 
> interfaces, so instead of using Rails partials I wrote a 
> MethodHuntingDelegator to provide a uniform interface across the results:
> http://paul.annesley.cc/2012/01/methodhuntingdelegator/
> 
> -- Paul
> 
> 
> 
> On 14/02/2012, at 4:31 PM, Dmytrii Nagirniak wrote:
> 
>> Hi,
>> 
>> I wonder if anybody has recommendations implementing application wide search 
>> (you know, the **small** box on the top right).
>> 
>> It should search among different kinds of modes with very little (if 
>> anything) in common.
>> 
>> How would you approach this?
>> Not sure that Thinking Sphinx, ElasticSearch etc are good fit for that.
>> 
>> Thanks,
>> Dmytrii
>> 
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Ruby or Rails Oceania" group.
>> To post to this group, send email to [email protected].
>> To unsubscribe from this group, send email to 
>> [email protected].
>> For more options, visit this group at 
>> http://groups.google.com/group/rails-oceania?hl=en.
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Ruby or Rails Oceania" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to 
> [email protected].
> For more options, visit this group at 
> http://groups.google.com/group/rails-oceania?hl=en.
> 

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
or Rails Oceania" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rails-oceania?hl=en.

Reply via email to