Manoel Lemos
2007-Mar-28 20:55 UTC
[Ferret-talk] Questions on tokenized x untokenized and date sorting
Gents, does this definition will allow me to search inside title,
sub_title and url and sort by score, rank_sort, last_updated_at_sort ?
acts_as_ferret :fields => { :title => {:boost => 2, :store =>
:yes},
:sub_title => {:store => :yes},
:url => {:store => :yes},
:rank_sort => {:index => :untokenized},
:last_updated_at_sort => {:index =>
:untokenized_omit_norms, :term_vector => :no}},
:remote => true
def rank_sort
begin
return self.rank_links.to_i
rescue
return nil
end
end
def last_updated_at_sort
begin
self.last_updated_at.to_i
rescue
return nil
end
end
--
Posted via http://www.ruby-forum.com/.
Jens Kraemer
2007-Mar-29 08:15 UTC
[Ferret-talk] Questions on tokenized x untokenized and date sorting
On Wed, Mar 28, 2007 at 10:55:07PM +0200, Manoel Lemos wrote:> Gents, does this definition will allow me to search inside title, > sub_title and url and sort by score, rank_sort, last_updated_at_sort ?looks good. Be sure to specify :int as the sort type when you sort by rank_sort or last_updated_at_sort, or left-pad the values to a fixed length with ''0''. Jens -- Jens Kr?mer webit! Gesellschaft f?r neue Medien mbH Schnorrstra?e 76 | 01069 Dresden Telefon +49 351 46766-0 | Telefax +49 351 46766-66 kraemer at webit.de | www.webit.de Amtsgericht Dresden | HRB 15422 GF Sven Haubold, Hagen Malessa