Module: Elasticord::Client::Get

Defined in:
lib/elasticord/client/get.rb

Class Method Summary collapse

Class Method Details

.one(elastic_search_client, index, type, id) ⇒ Object



6
7
8
9
10
11
# File 'lib/elasticord/client/get.rb', line 6

def one(elastic_search_client, index, type, id)
  result = elastic_search_client.get \
    index: index, type: type, ignore: 404, id: id

  (result && result['found']) ? result['_source'] : false
end