On Fri, Sep 21, 2007 at 03:44:24AM +0200, José Valim wrote:
> Hi!
> 
> I'm using acts_as_ferret in my rails project and i need to order the
> search results by a combination of the result given by ferret (score)
> and a ranking in the database (normalized also). this combination can be
> like that:
> 
> 0.4*ferret_score+0.6*database_score
> 
> this database_score is also indexed
> any idea?

Probably the easiest way to achieve this is to use your ranking as a
document specific boost (available in current trunk):

acts_as_ferret :fields => { ... }, :boost => :normalized_ranking

That way your ranking will directly affect the score Ferret calculates.
Useful values for boosts in the index are 0..255, you'll have to
experiment a bit to see what boosts work best for you.

> and someone know how to access the ferret data in the object returned by
> find_by_content in aaf?

what do you mean by ferret data? You may access the score Ferret
assigned to a specific result with the ferret_score method.

cheers,
Jens

-- 
Jens Krämer
http://www.jkraemer.net/ - Blog
http://www.omdb.org/     - The new free film database
_______________________________________________
Ferret-talk mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/ferret-talk

Reply via email to