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 <ramon.pperez at gmail.com>
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
> Ferret-talk at rubyforge.org
> http://rubyforge.org/mailman/listinfo/ferret-talk
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://rubyforge.org/pipermail/ferret-talk/attachments/20070530/fa141f3a/attachment.html