Jens,

One other thing. I can't seem to get the following working.

options = {:limit => 10, :offset => 20}
total_hits = Blog.id_multi_search(query, [], options)

The result returned seems to ignore the offset for some reason and 
always returns the same resultset...am I doing something wrong?

> Jens,
> 
>> In theory there's the multi_search method for exactly your scenario:
>>   results = Article.multi_search(query, [ Blog, MusicTrack, MediaFile ])
>> the big upside of this is that you get comparable scores and therefore a
>> reasonable sorting by relevance. the downside is that it does a find on
>> each id just as you do above.
> 
> I'm tried the following, which semi-works:
> 
> results =Blog.multi_search(@query, [Article, MediaFile, MusicTrack])
> 
> However, each on of those models has associations. Additionally, I need 
> to pass :conditions statements (e.g., only find published articles). For 
> instance, an article has comments, a MusicTrack has albums, genres, and 
> artists. Right now, this works, but it is not pre-featching associations 
> or using conditions. Is there a way to enable that like...
> 
> results =Blog.multi_search(@query, [Article(:conditions => ['published = 
> ?', yes], :include => [:article_comments], MediaFile, MusicTrack])

-- 
Posted via http://www.ruby-forum.com/.
_______________________________________________
Ferret-talk mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/ferret-talk

Reply via email to