Sha256: d93f386c19e96b8603dda241cb22922a8f7340273bd0b9fee5e1b0499c94863a

Contents?: true

Size: 620 Bytes

Versions: 3

Compression:

Stored size: 620 Bytes

Contents

module Elasticsearch
  module Extensions
    module Documents
      module Queryable

        def as_hash
          raise NotImplementedError, "#{self.class.name} should implement #as_hash method"
        end

        def execute
          raw_results = index.search(self)
          parse_results(raw_results)
        end

        def parse_results(raw_results)
          raw_results
        end

        def index_name
          Elasticsearch::Extensions::Documents.index_name
        end

        def index
          @index ||= Elasticsearch::Extensions::Documents::Index.new
        end

      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
elasticsearch-documents-1.0.0 lib/elasticsearch/extensions/documents/queryable.rb
elasticsearch-documents-0.1.0 lib/elasticsearch/extensions/documents/queryable.rb
elasticsearch-documents-0.0.1 lib/elasticsearch/extensions/documents/queryable.rb