cncflora_commons 0.0.15 → 0.0.16
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/cncflora_commons.rb +10 -3
- metadata +1 -1
data/lib/cncflora_commons.rb
CHANGED
@@ -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']
|
67
|
-
|
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
|
|