Restream/redmine_elasticsearch

View on GitHub
lib/redmine_elasticsearch/patches/response_results_patch.rb

Summary

Maintainability
A
0 mins
Test Coverage
# Patch for customize Elasticsearch::Model::Response::Results
module RedmineElasticsearch
  module Patches
    module ResponseResultsPatch

      # Returns the customized {Results} collection
      def results
        response.response['hits']['hits'].map { |hit| ::RedmineElasticsearch::SearchResult.new(hit) }
      end

    end
  end
end