Class: Elastify::ElasticSearchHelper::SearchResultSet
- Inherits:
-
Object
- Object
- Elastify::ElasticSearchHelper::SearchResultSet
- Defined in:
- lib/elastify/elastic_search_helper.rb
Instance Attribute Summary collapse
-
#hits ⇒ Object
Returns the value of attribute hits.
-
#hits_maxscore ⇒ Object
Returns the value of attribute hits_maxscore.
-
#hits_total ⇒ Object
Returns the value of attribute hits_total.
-
#scroll_id ⇒ Object
Returns the value of attribute scroll_id.
-
#shards_failed ⇒ Object
Returns the value of attribute shards_failed.
-
#shards_successful ⇒ Object
Returns the value of attribute shards_successful.
-
#shards_total ⇒ Object
Returns the value of attribute shards_total.
-
#timed_out ⇒ Object
Returns the value of attribute timed_out.
-
#took ⇒ Object
Returns the value of attribute took.
Instance Method Summary collapse
-
#initialize(elasticsearch_search_result) ⇒ SearchResultSet
constructor
A new instance of SearchResultSet.
Constructor Details
#initialize(elasticsearch_search_result) ⇒ SearchResultSet
Returns a new instance of SearchResultSet.
89 90 91 92 93 94 95 96 97 98 99 100 |
# File 'lib/elastify/elastic_search_helper.rb', line 89 def initialize elasticsearch_search_result esr = JSON.parse(elasticsearch_search_result) self.scroll_id = esr["_scroll_id"] self.took = esr["took"] self.timed_out = esr["timed_out"] self.shards_total = esr["_shards"]["total"] self.shards_successful = esr["_shards"]["successful"] self.shards_failed = esr["_shards"]["failed"] self.hits_total = esr["hits"]["total"] self.hits_maxscore = esr["hits"]["maxscore"] self.hits = esr["hits"]["hits"].map{ |hit| SearchResult.new(hit) } end |
Instance Attribute Details
#hits ⇒ Object
Returns the value of attribute hits.
88 89 90 |
# File 'lib/elastify/elastic_search_helper.rb', line 88 def hits @hits end |
#hits_maxscore ⇒ Object
Returns the value of attribute hits_maxscore.
88 89 90 |
# File 'lib/elastify/elastic_search_helper.rb', line 88 def hits_maxscore @hits_maxscore end |
#hits_total ⇒ Object
Returns the value of attribute hits_total.
88 89 90 |
# File 'lib/elastify/elastic_search_helper.rb', line 88 def hits_total @hits_total end |
#scroll_id ⇒ Object
Returns the value of attribute scroll_id.
88 89 90 |
# File 'lib/elastify/elastic_search_helper.rb', line 88 def scroll_id @scroll_id end |
#shards_failed ⇒ Object
Returns the value of attribute shards_failed.
88 89 90 |
# File 'lib/elastify/elastic_search_helper.rb', line 88 def shards_failed @shards_failed end |
#shards_successful ⇒ Object
Returns the value of attribute shards_successful.
88 89 90 |
# File 'lib/elastify/elastic_search_helper.rb', line 88 def shards_successful @shards_successful end |
#shards_total ⇒ Object
Returns the value of attribute shards_total.
88 89 90 |
# File 'lib/elastify/elastic_search_helper.rb', line 88 def shards_total @shards_total end |
#timed_out ⇒ Object
Returns the value of attribute timed_out.
88 89 90 |
# File 'lib/elastify/elastic_search_helper.rb', line 88 def timed_out @timed_out end |
#took ⇒ Object
Returns the value of attribute took.
88 89 90 |
# File 'lib/elastify/elastic_search_helper.rb', line 88 def took @took end |