Forum: Ferret Document Boost in acts_as_ferret?

38e746b2e29b513b9a3cc3ed1ca8acad?d=identicon&s=25 Johnny Cussen (Guest)
on 2006-10-12 01:24
(Received via mailing list)
Is it possible to set a boost value for a document using
acts_as_ferret  (not field boost - document boost)?
C9dd93aa135988cabf9183d3210665ca?d=identicon&s=25 Jens Kraemer (Guest)
on 2006-10-12 10:50
(Received via mailing list)
On Thu, Oct 12, 2006 at 09:10:22AM +1000, Johnny Cussen wrote:
> Is it possible to set a boost value for a document using
> acts_as_ferret  (not field boost - document boost)?

This should be possible by overriding the to_doc instance method in your
model:

def to_doc
  doc = super
  doc.boost = 2 # fit to taste, i.e. get from instance variable
  doc
end


Jens


--
webit! Gesellschaft für neue Medien mbH          www.webit.de
Dipl.-Wirtschaftsingenieur Jens Krämer       kraemer@webit.de
Schnorrstraße 76                         Tel +49 351 46766  0
D-01069 Dresden                          Fax +49 351 46766 66
This topic is locked and can not be replied to.