Skip to content

Commit

Permalink
fix(indexing): let's be synchronous
Browse files Browse the repository at this point in the history
  • Loading branch information
Jerska committed Mar 22, 2016
1 parent 4f7ff3d commit d0f6fae
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions crawler/item.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ def self.index items
to_index = items.map(&:to_index).flatten
idx = Algolia::Index.new("#{index_name}.tmp")
idx.set_settings index_settings
to_index.each_slice(1000).each { |sub| idx.save_objects sub }
sleep 1
to_index.each_slice(1000).each { |sub| idx.save_objects! sub }
Algolia.move_index "#{index_name}.tmp", index_name
puts "Indexed #{to_index.count} #{plural}"
end
Expand Down

0 comments on commit d0f6fae

Please sign in to comment.