mongoid_fulltext icon indicating copy to clipboard operation
mongoid_fulltext copied to clipboard

[Feature] Weighted/Prioritised search fields

Open zeevallin opened this issue 12 years ago • 0 comments

This is only conceptual, I don't know how this would be executed, but I want to share this idea anyway. In my app I would like to prioritise patterns matching in certain fields and weight the score dependent on that.

For example patterns matching in a title are usually more important than patterns matching in a description. This is how I would like to use the options:

class Artwork

  include Mongoid::Document
  include Mongoid::FullTextSearch

  field :title
  field :description

  fulltext_search_in :title, :description,
                     :priorities => { :title => 10, :description => 5 }

end

Is this even possible to emulate without a massive performance loss?

zeevallin avatar Apr 25 '13 13:04 zeevallin