cncflora_commons 0.0.26 → 0.0.27

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/cncflora_commons.rb +7 -7
  2. metadata +1 -1
@@ -59,10 +59,10 @@ def http_delete(uri)
59
59
  JSON.parse(response.body)
60
60
  end
61
61
 
62
- def search(index,query)
62
+ def search(db,index,query)
63
63
  query="scientificName:'Aphelandra longiflora'" unless query != nil && query.length > 0
64
64
  result = []
65
- r = http_get("#{settings.elasticsearch}/#{index}/_search?size=999&q=#{URI.encode(query)}")
65
+ r = http_get("#{settings.elasticsearch}/#{db}/#{index}/_search?size=999&q=#{URI.encode(query)}")
66
66
  if r['hits'] && r['hits']['hits'] then
67
67
  r['hits']['hits'].each{|hit|
68
68
  result.push(hit["_source"])
@@ -155,20 +155,20 @@ def setup!(config)
155
155
  config[:strings] = JSON.parse(File.read("src/locales/#{settings.lang}.json", :encoding => "BINARY"))
156
156
  end
157
157
 
158
- if ENV["DATAHUB_PORT_4001_TCP_ADDR"] then
158
+ if ENV["DATAHUB_PORT_8080_TCP_ADDR"] then
159
159
  config[:datahub] = "http://#{ENV["DATAHUB_PORT_8080_TCP_ADDR"]}:#{ENV["DATAHUB_PORT_8080_TCP_PORT"]}"
160
160
  end
161
161
 
162
162
  if config.has_key? :elasticsearch then
163
- config[:elasticsearch] = "#{config[:elasticsearch]}/#{settings.db}"
163
+ config[:elasticsearch] = "#{config[:elasticsearch]}"
164
164
  else
165
- config[:elasticsearch] = "#{config[:datahub]}/#{settings.db}"
165
+ config[:elasticsearch] = "#{config[:datahub]}"
166
166
  end
167
167
 
168
168
  if config.has_key? :couchdb then
169
- config[:couchdb] = "#{config[:couchdb]}/#{settings.db}"
169
+ config[:couchdb] = "#{config[:couchdb]}"
170
170
  else
171
- config[:couchdb] = "#{config[:datahub]}/#{settings.db}"
171
+ config[:couchdb] = "#{config[:datahub]}"
172
172
  end
173
173
 
174
174
  if settings.context then
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cncflora_commons
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.26
4
+ version: 0.0.27
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: