Hi Ramon,
I think you'd have to do three different queries:
query = params[:query]
@results1 = model.find_by_contents("client:1 content:#{query}", {:limit =>
3})
@results2 = model.find_by_contents("client:2 content:#{query}", {:limit =>
3})
@results3 = model.find_by_contents("client:3 content:#{query}", {:limit =>
3})
Ferret is fast enough that this shouldn't be a performance problem.
Thanks,
Doug
On 5/30/07, Ramon <[EMAIL PROTECTED]> wrote:
Hello,
I have a ferret index with 2 fields:
Acts_as_ferret :fields => [:client, :content]
If I do model.find_by_contents(query) I obtain all results by the query
but I would like to obtain 3 results for each client.
Any ideas?
Thanks for all.
--
Posted via http://www.ruby-forum.com/.
_______________________________________________
Ferret-talk mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/ferret-talk
_______________________________________________
Ferret-talk mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/ferret-talk