cncflora_commons 0.0.15 → 0.0.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. data/lib/cncflora_commons.rb +10 -3
  2. metadata +1 -1
@@ -63,9 +63,13 @@ def search(index,query)
63
63
  query="scientificName:'Aphelandra longiflora'" unless query != nil && query.length > 0
64
64
  result = []
65
65
  r = http_get("#{settings.elasticsearch}/#{index}/_search?size=999&q=#{URI.encode(query)}")
66
- r['hits']['hits'].each{|hit|
67
- result.push(hit["_source"])
68
- }
66
+ if r['hist'] && r['hits']['hits'] then
67
+ r['hits']['hits'].each{|hit|
68
+ result.push(hit["_source"])
69
+ }
70
+ else
71
+ puts "search error #{r}"
72
+ end
69
73
  result
70
74
  end
71
75
 
@@ -175,6 +179,9 @@ def setup!(config)
175
179
 
176
180
  set :config, config
177
181
 
182
+ puts "Config loaded"
183
+ puts config
184
+
178
185
  config
179
186
  end
180
187
 
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.15
4
+ version: 0.0.16
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: