Permalink
Browse files

updating to convert from river to transport

  • Loading branch information...
1 parent a11781e commit c21844c01ab55ec3a5041d0001dc8a4df4a5c169 @mschoch mschoch committed Oct 5, 2012
View
@@ -63,11 +63,8 @@ The following is a list of tasks that are useful for managing the application.
rake lp:migrate # Update couchbase views
rake lp:ensure_buckets # Detect and create missing buckets (Safe operation)
rake lp:es:create_index # Create ElasticSearch index
- rake lp:es:create_mapping # Create ElasticSearch mapping
rake lp:es:delete_index # Delete ElasticSearch index
- rake lp:es:reset # Delete and recreate ElasticSearch index and river
- rake lp:es:start_river # Start ElasticSearch river
- rake lp:es:stop_river # Stop ElasticSearch river (will start over indexing documents if recreated)
+ rake lp:es:reset # Delete and recreate ElasticSearch index
rake lp:recalculate_active # Recalculate active content
rake lp:recalculate_scores # Schedule background score indexing for all documents
rake lp:reindex # Regenerate all indexes
View
@@ -306,16 +306,6 @@ def destroy
# remove from default bucket
Couch.client.delete(@id)
- # TODO we should not have to delete directly from elastic search but instead
- # should be able to rely on the TAP function in couchbase, however
- # currently this event is not replicated to elastic search via the river
- #
- # remove from elasticsearch index
- Typhoeus::Request.delete("#{ENV['ELASTIC_SEARCH_URL']}/learning_portal/lp_v1/#{id}?refresh=true")
-
- # wait period to give delete chance to take effect
- sleep 3
-
# save a clone of this document into the 'system' bucket
Couch.client(:bucket => "system").set("#{doc['id']}", doc)
end
View
@@ -1,7 +0,0 @@
-{
- "lp_v1": {
- "_source": {
- "includes" : ["_*", "popularity"]
- }
- }
-}
View
@@ -1,19 +0,0 @@
-{
- "type" : "couchbase",
- "couchbase" : {
- "uris": ["COUCHBASE_URL/pools"],
- "bucket": "default",
- "bucketPassword": "",
- "autoBackfill": true,
- "registeredTapClient": true,
- "deregisterTapOnShutdown": false,
- "vbuckets": []
- },
- "index" : {
- "index" : "learning_portal",
- "type" : "lp_v1",
- "bulk_size" : "100",
- "bulk_timeout" : "10ms",
- "throttle_size" : 100
- }
-}
@@ -1,5 +0,0 @@
-river_body = File.read("#{Rails.root}/config/es_river.json")
-river_body.gsub! "COUCHBASE_URL", ENV["COUCHBASE_URL"]
-
-Typhoeus::Request.put("#{ENV['ELASTIC_SEARCH_URL']}/_river/lp_river/_meta", :body => river_body)
-$stdout.puts "Started ElasticSearch river from 'config/es_river.json'."
@@ -22,5 +22,5 @@ Download and install this updated `libcouchbase` homebrew recipe.
plugin -install mobz/elasticsearch-head
plugin -install elasticsearch/elasticsearch-lang-javascript/1.1.0
- plugin -install mschoch/elasticsearch-river-couchbase/1.0.1-SNAPSHOT
+ plugin -install couchbaselabs/elasticsearch-transport-couchbase/1.0.0-dp
@@ -9,13 +9,10 @@ namespace :learningportal do
"#{ENV["COUCHBASE_URL"]}"
end
- desc "Delete and recreate ElasticSearch index and river"
+ desc "Delete and recreate ElasticSearch index"
task :reset => :environment do
- Rake::Task["lp:es:stop_river"].invoke
Rake::Task["lp:es:delete_index"].invoke
Rake::Task["lp:es:create_index"].invoke
- Rake::Task["lp:es:create_mapping"].invoke
- Rake::Task["lp:es:start_river"].invoke
end
desc "Create ElasticSearch index"
@@ -24,27 +21,6 @@ namespace :learningportal do
puts "Created ElasticSearch index."
end
- desc "Create ElasticSearch mapping"
- task :create_mapping => :environment do
- Typhoeus::Request.put("#{es_url}/learning_portal/lp_v1/_mapping", :body => File.read("#{Rails.root}/config/es_mapping.json"))
- puts "Mapped ElasticSearch 'lp_v1' to 'learning_portal' index."
- end
-
- desc "Start ElasticSearch river"
- task :start_river => :environment do
- body = File.read("#{Rails.root}/config/es_river.json")
- body.gsub!("COUCHBASE_URL", couchbase_url)
-
- Typhoeus::Request.put("#{es_url}/_river/lp_river/_meta", :body => body)
- puts "Started ElasticSearch river from 'config/es_river.json'."
- end
-
- desc "Stop ElasticSearch river (will start over indexing documents if recreated)"
- task :stop_river => :environment do
- Typhoeus::Request.delete("#{es_url}/_river/lp_river")
- puts "Stop ElasticSearch river."
- end
-
desc "Delete ElasticSearch index"
task :delete_index => :environment do
Typhoeus::Request.delete("#{es_url}/learning_portal")
@@ -202,16 +178,10 @@ namespace :lp do
"#{ENV['ELASTIC_SEARCH_URL']}"
end
- desc "Delete and recreate ElasticSearch index and river"
+ desc "Delete and recreate ElasticSearch index"
task :reset => "learningportal:elasticsearch:reset"
desc "Create ElasticSearch index"
task :create_index => "learningportal:elasticsearch:create_index"
- desc "Create ElasticSearch mapping"
- task :create_mapping => "learningportal:elasticsearch:create_mapping"
- desc "Start ElasticSearch river"
- task :start_river => "learningportal:elasticsearch:start_river"
- desc "Stop ElasticSearch river (will start over indexing documents if recreated)"
- task :stop_river => "learningportal:elasticsearch:stop_river"
desc "Delete ElasticSearch index"
task :delete_index => "learningportal:elasticsearch:delete_index"
end

0 comments on commit c21844c

Please sign in to comment.