Class: Elastify::ElasticSearchHelper::SearchResult

Inherits:
Object
  • Object
show all
Defined in:
lib/elastify/elastic_search_helper.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(elasticsearch_search_result_hit) ⇒ SearchResult

Returns a new instance of SearchResult.



104
105
106
107
108
109
# File 'lib/elastify/elastic_search_helper.rb', line 104

def initialize elasticsearch_search_result_hit
    self.index = elasticsearch_search_result_hit["_index"]
    self.type = elasticsearch_search_result_hit["_type"]
    self.id = elasticsearch_search_result_hit["_id"]
    self.source = elasticsearch_search_result_hit["_source"]
end

Instance Attribute Details

#idObject

Returns the value of attribute id.



103
104
105
# File 'lib/elastify/elastic_search_helper.rb', line 103

def id
  @id
end

#indexObject

Returns the value of attribute index.



103
104
105
# File 'lib/elastify/elastic_search_helper.rb', line 103

def index
  @index
end

#scoreObject

Returns the value of attribute score.



103
104
105
# File 'lib/elastify/elastic_search_helper.rb', line 103

def score
  @score
end

#sourceObject

Returns the value of attribute source.



103
104
105
# File 'lib/elastify/elastic_search_helper.rb', line 103

def source
  @source
end

#typeObject

Returns the value of attribute type.



103
104
105
# File 'lib/elastify/elastic_search_helper.rb', line 103

def type
  @type
end