Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

updating to convert from river to transport

  • Loading branch information...
commit c21844c01ab55ec3a5041d0001dc8a4df4a5c169 1 parent a11781e
Marty Schoch authored
5  README.md
Source Rendered
@@ -63,11 +63,8 @@ The following is a list of tasks that are useful for managing the application.
63 63
     rake lp:migrate             # Update couchbase views
64 64
     rake lp:ensure_buckets      # Detect and create missing buckets (Safe operation)
65 65
     rake lp:es:create_index     # Create ElasticSearch index
66  
-    rake lp:es:create_mapping   # Create ElasticSearch mapping
67 66
     rake lp:es:delete_index     # Delete ElasticSearch index
68  
-    rake lp:es:reset            # Delete and recreate ElasticSearch index and river
69  
-    rake lp:es:start_river      # Start ElasticSearch river
70  
-    rake lp:es:stop_river       # Stop ElasticSearch river (will start over indexing documents if recreated)
  67
+    rake lp:es:reset            # Delete and recreate ElasticSearch index
71 68
     rake lp:recalculate_active  # Recalculate active content
72 69
     rake lp:recalculate_scores  # Schedule background score indexing for all documents
73 70
     rake lp:reindex             # Regenerate all indexes
10  app/models/article.rb
@@ -306,16 +306,6 @@ def destroy
306 306
     # remove from default bucket
307 307
     Couch.client.delete(@id)
308 308
 
309  
-    # TODO we should not have to delete directly from elastic search but instead
310  
-    #      should be able to rely on the TAP function in couchbase, however
311  
-    #      currently this event is not replicated to elastic search via the river
312  
-    #
313  
-    # remove from elasticsearch index
314  
-    Typhoeus::Request.delete("#{ENV['ELASTIC_SEARCH_URL']}/learning_portal/lp_v1/#{id}?refresh=true")
315  
-
316  
-    # wait period to give delete chance to take effect
317  
-    sleep 3
318  
-
319 309
     # save a clone of this document into the 'system' bucket
320 310
     Couch.client(:bucket => "system").set("#{doc['id']}", doc)
321 311
   end
7  config/es_mapping.json
... ...
@@ -1,7 +0,0 @@
1  
-{
2  
-  "lp_v1": {
3  
-    "_source": {
4  
-      "includes" : ["_*", "popularity"]
5  
-    }
6  
-  }
7  
-}
19  config/es_river.json
... ...
@@ -1,19 +0,0 @@
1  
-{
2  
-  "type" : "couchbase",
3  
-  "couchbase" : {
4  
-    "uris": ["COUCHBASE_URL/pools"],
5  
-    "bucket": "default",
6  
-    "bucketPassword": "",
7  
-    "autoBackfill": true,
8  
-    "registeredTapClient": true,
9  
-    "deregisterTapOnShutdown": false,
10  
-    "vbuckets": []
11  
-  },
12  
-  "index" : {
13  
-    "index" : "learning_portal",
14  
-    "type" : "lp_v1",
15  
-    "bulk_size" : "100",
16  
-    "bulk_timeout" : "10ms",
17  
-    "throttle_size" : 100
18  
-  }
19  
-}
5  config/initializers/elasticsearch_river.rb
... ...
@@ -1,5 +0,0 @@
1  
-river_body = File.read("#{Rails.root}/config/es_river.json")
2  
-river_body.gsub! "COUCHBASE_URL", ENV["COUCHBASE_URL"]
3  
-
4  
-Typhoeus::Request.put("#{ENV['ELASTIC_SEARCH_URL']}/_river/lp_river/_meta", :body => river_body)
5  
-$stdout.puts "Started ElasticSearch river from 'config/es_river.json'."
2  doc/dependencies.application.md
Source Rendered
@@ -22,5 +22,5 @@ Download and install this updated `libcouchbase` homebrew recipe.
22 22
 
23 23
     plugin -install mobz/elasticsearch-head
24 24
     plugin -install elasticsearch/elasticsearch-lang-javascript/1.1.0
25  
-    plugin -install mschoch/elasticsearch-river-couchbase/1.0.1-SNAPSHOT
  25
+    plugin -install couchbaselabs/elasticsearch-transport-couchbase/1.0.0-dp
26 26
 
34  lib/tasks/learningportal.rake
@@ -9,13 +9,10 @@ namespace :learningportal do
9 9
       "#{ENV["COUCHBASE_URL"]}"
10 10
     end
11 11
 
12  
-    desc "Delete and recreate ElasticSearch index and river"
  12
+    desc "Delete and recreate ElasticSearch index"
13 13
     task :reset => :environment do
14  
-      Rake::Task["lp:es:stop_river"].invoke
15 14
       Rake::Task["lp:es:delete_index"].invoke
16 15
       Rake::Task["lp:es:create_index"].invoke
17  
-      Rake::Task["lp:es:create_mapping"].invoke
18  
-      Rake::Task["lp:es:start_river"].invoke
19 16
     end
20 17
 
21 18
     desc "Create ElasticSearch index"
@@ -24,27 +21,6 @@ namespace :learningportal do
24 21
       puts "Created ElasticSearch index."
25 22
     end
26 23
 
27  
-    desc "Create ElasticSearch mapping"
28  
-    task :create_mapping => :environment do
29  
-      Typhoeus::Request.put("#{es_url}/learning_portal/lp_v1/_mapping", :body => File.read("#{Rails.root}/config/es_mapping.json"))
30  
-      puts "Mapped ElasticSearch 'lp_v1' to 'learning_portal' index."
31  
-    end
32  
-
33  
-    desc "Start ElasticSearch river"
34  
-    task :start_river => :environment do
35  
-      body = File.read("#{Rails.root}/config/es_river.json")
36  
-      body.gsub!("COUCHBASE_URL", couchbase_url)
37  
-
38  
-      Typhoeus::Request.put("#{es_url}/_river/lp_river/_meta", :body => body)
39  
-      puts "Started ElasticSearch river from 'config/es_river.json'."
40  
-    end
41  
-
42  
-    desc "Stop ElasticSearch river (will start over indexing documents if recreated)"
43  
-    task :stop_river => :environment do
44  
-      Typhoeus::Request.delete("#{es_url}/_river/lp_river")
45  
-      puts "Stop ElasticSearch river."
46  
-    end
47  
-
48 24
     desc "Delete ElasticSearch index"
49 25
     task :delete_index => :environment do
50 26
       Typhoeus::Request.delete("#{es_url}/learning_portal")
@@ -202,16 +178,10 @@ namespace :lp do
202 178
       "#{ENV['ELASTIC_SEARCH_URL']}"
203 179
     end
204 180
 
205  
-    desc "Delete and recreate ElasticSearch index and river"
  181
+    desc "Delete and recreate ElasticSearch index"
206 182
     task :reset          => "learningportal:elasticsearch:reset"
207 183
     desc "Create ElasticSearch index"
208 184
     task :create_index   => "learningportal:elasticsearch:create_index"
209  
-    desc "Create ElasticSearch mapping"
210  
-    task :create_mapping => "learningportal:elasticsearch:create_mapping"
211  
-    desc "Start ElasticSearch river"
212  
-    task :start_river    => "learningportal:elasticsearch:start_river"
213  
-    desc "Stop ElasticSearch river (will start over indexing documents if recreated)"
214  
-    task :stop_river     => "learningportal:elasticsearch:stop_river"
215 185
     desc "Delete ElasticSearch index"
216 186
     task :delete_index   => "learningportal:elasticsearch:delete_index"
217 187
   end

0 notes on commit c21844c

Please sign in to comment.
Something went wrong with that request. Please try again.