Module: Eson::More::Extract
- Defined in:
- lib/eson/more/extract.rb
Instance Method Summary collapse
-
#extract_hits(response) ⇒ Object
Extracts doc hits as hashes from a search result.
-
#extract_sources(response) ⇒ Object
Extracts doc sources as hashes from a search result.
Instance Method Details
#extract_hits(response) ⇒ Object
Extracts doc hits as hashes from a search result.
14 15 16 |
# File 'lib/eson/more/extract.rb', line 14 def extract_hits(response) response["hits"]["hits"] end |
#extract_sources(response) ⇒ Object
Extracts doc sources as hashes from a search result.
7 8 9 |
# File 'lib/eson/more/extract.rb', line 7 def extract_sources(response) extract_hits(response).map {|h| h["_source"] } end |