Displaying 2 results from an estimated 2 matches for "make_entry_ferret_doc".
2006 Sep 25
0
Odd indexing issue
...no)
field_infos.create_index(FerretConfig::INDEXPATH)
index = Ferret::Index::Index.new(FerretConfig::INDEXOPTIONS)
batch_size = 1000
Entry.transaction do
0.step(Entry.count, batch_size) do |i|
Entry.find(:all, :limit => batch_size, :offset => i).each do |rec|
index << rec.make_entry_ferret_doc
end
end
end
index.flush
index.optimize
index.close
end
def make_entry_ferret_doc
doc = Ferret::Document.new
doc[:id] = self.id
doc[:name] = self.name
doc[:address] = self.physical_address
doc[:tags] = self.tags
doc
end
--
Posted via http://www.ruby-forum.com/.
2007 Feb 10
7
Adding entry breaks index
...dex 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...