Our ferret 0.10.13 index has been slowly growing on our debian server
and has just got up over 14,000 records. Yesterday I randomly noticed
that one search I did was suddenly giving whack, unexpected results. I
have spent much time trying to track the problem.
Tried ferret 0.10.9 - no change.
Tried on a windows machine - where it works fine, and doesn’t give weird
results (which just adds to the strangeness - anyway I need it to work
on the debian server)
narrowed it down to one single entry that when you add or delete from
the index completely changes results in unrelated searches.
a little console output shows this best.
index = Ferret::Index::Index.new(FerretConfig::INDEXOPTIONS)
puts index.search(“westpac”).total_hits
286
puts index.search(“westpac branch”).total_hits
277
doc = Entry.find(1094481).make_entry_ferret_doc
=> {:latitude1d=>“36.9”, :address=>“61 Remuera Rd, Newmarket”,
:longitude1d=>“174.8”, :name=>“Spiro’s Florists”, :precision=>“1
number”, :tags=>“Flowers, bouquets, gift baskets, permanent floral
arrangements, inter-flora”, :zid=>1094481}
index << doc
index.flush
index.optimize
puts index.search(“westpac”).total_hits
286
puts index.search(“westpac branch”).total_hits
3
index.delete(“1094481”)
index.flush
index.optimize
puts index.search(“westpac”).total_hits
286
puts index.search(“westpac branch”).total_hits
277
I’m completely lost on this. It makes no sense to me at all.
Rebuilding the index doesn’t help. It happens the same on 2 similar but
independent debian boxes.
Anyone got any clues as to where to start?
While it’s fine to just remove this entry and presume everything is
working - without knowing why this breaks it’s pretty hard to have faith
in the index not breaking again…
Really appreciate any thoughts,
Sam