Class: Skala::ElasticsearchAdapter::Search::ResultTransformation::SetHits

Inherits:
Transformator::Transformation::Step
  • Object
show all
Defined in:
lib/skala/elasticsearch_adapter/search/result_transformation/set_hits.rb

Instance Method Summary collapse

Instance Method Details

#callObject



7
8
9
10
11
12
13
14
15
16
17
# File 'lib/skala/elasticsearch_adapter/search/result_transformation/set_hits.rb', line 7

def call
  target.hits = source["hits"]["hits"].map do |_hit|
    {
      id: _hit["_id"],
      index: _hit["_index"],
      score: _hit["_score"],
      type: _hit["_type"],
      version: _hit["_version"]
    }
  end
end