Sha256: 47e827b25536a30397f9684fdaf60662b939f4e41327c2e09220c90e893f6543

Contents?: true

Size: 637 Bytes

Versions: 7

Compression:

Stored size: 637 Bytes

Contents

module AgnosticBackend
  module Queryable
    module Elasticsearch
      class ResultSet < AgnosticBackend::Queryable::ResultSet
        include AgnosticBackend::Utilities

        def total_count
          raw_results["hits"]["total"]
        end

        def scroll_cursor
          raw_results["_scroll_id"]
        end

        private

        def filtered_results
          raw_results["hits"]["hits"].map{|h| h["fields"]}
        end

        def transform(result)
          transform_nested_values(unflatten(result), Proc.new{|value| value.size > 1 ? value.split.join('|') : value.first})
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
agnostic_backend-1.0.4 lib/agnostic_backend/queryable/elasticsearch/result_set.rb
agnostic_backend-1.0.3 lib/agnostic_backend/queryable/elasticsearch/result_set.rb
agnostic_backend-1.0.2 lib/agnostic_backend/queryable/elasticsearch/result_set.rb
agnostic_backend-1.0.1 lib/agnostic_backend/queryable/elasticsearch/result_set.rb
agnostic_backend-1.0.0 lib/agnostic_backend/queryable/elasticsearch/result_set.rb
agnostic_backend-0.9.9 lib/agnostic_backend/queryable/elasticsearch/result_set.rb
agnostic_backend-0.9.8 lib/agnostic_backend/queryable/elasticsearch/result_set.rb