Hi all,
I’ve included a mysql ‘text’ column in my index, and aaf/Ferret
doesn’t use it when I search, UNLESS I specify it as a restrictor, and
then it only searches in that field!
For example:
=> 0 results are returned by a standard (all fields ?) search
Entity.find_by_contents “zixi”
Query: zixi
total hits: 0, results delivered: 0
BUT if I search only in 1 field, I find something
Entity.find_by_contents “extra:zixi”
Entity Load (0.001286) SELECT * FROM entities WHERE
(entities.id in (‘1723’)) AND ( (entities.type
= ‘Person’ ) )
Query: extra:zixi
total hits: 1, results delivered: 1
=> #<ActsAsFerret::SearchResults:0x24cd8b0 @total_hits=1,
How is that possible?
For info, here is my table schema :
create_table “entities”, :force => true do |t|
t.string “type”
t.text “extra”
t.datetime “created_at”
…
and my aaf setting :
file: Entity.rb
acts_as_ferret :remote => true,
:fields => {
:name => {:store => :yes, :boost => 1000},
:last_name => {:store => :yes, :boost => 100},
:tags_names => {:store => :yes, :boost => 30 } ,
:first_name => {:store => :yes, :boost => 10 },
:type => {:store => :yes},
:extra => {:store => :yes},
:slaves_list => {:store => :yes, :boost => 10 },
:masters_list => {:store => :yes, :boost => 10 },
:function => {:store => :yes},
:name_for_sort=> {:index => :untokenized}
}
TIA
Alain