To edit pages or tickets please login with username/password: aaf/aaf

Ticket #166 (closed enhancement: fixed)

Opened 1 year ago

Last modified 1 year ago

Support dynamic per-document and per-field boosts

Reported by: jk Assigned to: jk
Priority: major Milestone: 0.4.2
Component: 0plugin Version:
Keywords: Cc:

Description (Last modified by jk)

class Mymodel < ActiveRecord::Base
  acts_as_ferret  :fields => {:name => {:boost => :rating}}
  # that should work also, of course: acts_as_ferret  :boost => :rating

  # function for determining boost value
  def rating
    return instance_rating
  end
end

Change History

08/27/07 05:46:11 changed by jk

  • description changed.

(follow-up: ↓ 3 ) 08/27/07 05:46:15 changed by jk

  • status changed from new to assigned.

(in reply to: ↑ 2 ; follow-up: ↓ 4 ) 08/27/07 13:50:41 changed by aaf

Replying to jk:

My inital thought was that the boost value would be defined when the model instance is indexed, but it would be cool if it could be calculated for every search. That would be really dynamic and accomodate for wastly more differentiated search scenarios.

(in reply to: ↑ 3 ) 09/11/07 21:50:36 changed by jk

Replying to aaf:

My inital thought was that the boost value would be defined when the model instance is indexed, but it would be cool if it could be calculated for every search. That would be really dynamic and accomodate for wastly more differentiated search scenarios.

The per-document and per-field boosts can only be calculated at indexing time. At search time you can only boost queries, as the boosts that were assigned to documents/fields are stored read-only in the index.

09/17/07 09:17:33 changed by jk

  • status changed from assigned to closed.
  • resolution set to fixed.

This is now implemented in trunk. usage for dynamic field boosts is as shown in the report. Usage for per-document dynamic boosts is:

class MyModel
  acts_as_ferret :boost => :popularity
  def popularity
    # return dynamic boost value for this document
  end
end

To edit pages or tickets please login with username/password: aaf/aaf