Skip to content

Instantly share code, notes, and snippets.

@thbar
Created February 2, 2009 10:21
Show Gist options
  • Save thbar/56865 to your computer and use it in GitHub Desktop.
Save thbar/56865 to your computer and use it in GitHub Desktop.
TinyTL and ThinkingSphinx
preprocess {
Item.delete_all
}
source(:csv_file) {
FasterCSV.open(get_var(:source_file),"rb", :col_sep => ';', :headers => true)
}
each_row { |row|
Item.create!(row[:data].to_hash) # if (@counter = (@counter || 0) + 1) < 200
}
postprocess {
my_assert "Item.count > 5000"
# more assertions...
Rake::Task['ts:index'].invoke
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment