Hi!
please see comments below.
On Sun, Aug 26, 2007 at 11:48:16PM +0200, Kasper Weibel wrote:
> Jens Kraemer wrote:
> > On Thu, Aug 23, 2007 at 11:51:42PM +0200, Sam Giffney wrote:
> >> Raymond O'Connor wrote:
[..]
> >> Another option, although requiring a bit more work for the index, would
> >> be to boost each product by a dynamic value (appropriate to a normalised
> >> popularity perhaps) at index build time. Then you could just search and
> >> popularity would automatically be utilised.
> >
> > cool, didn't think of this - sounds better to me than constructing the
> > complex queries I suggested :-)
>
> Cool. Just today I was looking for a solution like this :-)
>
> When implementing I stumbled upon a problem indexing with
> script/runner Mymodel.rebuild_index
>
> class Mymodel < ActiveRecord::Base
> acts_as_ferret :fields => {:name => {:boost => :rating}}
>
> # function for determining boost value
> def rating
> return instance_rating
> end
> end
>
> This exits with
>
> ./script/../config/../vendor/rails/railties/lib/commands/runner.rb:47:
> ./script/
> ../config/../vendor/plugins/acts_as_ferret/lib/acts_as_ferret.rb:136:in
> `add_fie
> ld': can't convert Symbol into Float (TypeError)
D'uh ;-)
Aaf doesn't support dynamic per-document or per-field boosts yet, at
least not in the declarative way outlined above. For now, you'll have to
override the to_doc instance method so you can manually apply the boost.
I'll add that to aaf soon, just created a ticket:
http://projects.jkraemer.net/acts_as_ferret/ticket/166
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