On Mon, Jul 31, 2006 at 04:10:03PM +0100, Pedro Côrte-Real wrote:
> On Mon, 2006-07-31 at 11:26 +0100, Pedro Côrte-Real wrote:
> > Anyone know how to set a field to be untokenized in acts_as_ferret?
> 
> I forgot that I was actually supplying my own #to_doc so it was a matter
> of changing it to not tokenize the fields I want. When using
> acts_as_ferret the regular way I don't know if this is possible.

it is, just provide a hash with the desired options to each field name:

acts_as_ferret(
  :fields => { 
    'title'       => { :boost => 2 }, 
    'description' => { :boost => 1, 
                       :index => Ferret::Document::Field::Index::UNTOKENIZED 
                     }
  })

options that can be set this way are (with their defaults given):

  :store       => Ferret::Document::Field::Store::NO
  :index       => Ferret::Document::Field::Index::TOKENIZED
  :term_vector => Ferret::Document::Field::TermVector::NO
  :binary      => false
  :boost       => 1.0


Jens

-- 
webit! Gesellschaft für neue Medien mbH          www.webit.de
Dipl.-Wirtschaftsingenieur Jens Krämer       [EMAIL PROTECTED]
Schnorrstraße 76                         Tel +49 351 46766  0
D-01069 Dresden                          Fax +49 351 46766 66
_______________________________________________
Ferret-talk mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/ferret-talk

Reply via email to