Class: Typesensual::Search::Hit
- Inherits:
-
Object
- Object
- Typesensual::Search::Hit
- Defined in:
- lib/typesensual/search/hit.rb
Instance Method Summary collapse
- #document ⇒ Object
- #highlights ⇒ Object
-
#initialize(hit) ⇒ Hit
constructor
{ "highlights": [ { "field": "company_name", "matched_tokens": ["Stark"], "snippet": "Stark Industries" } ], "document": { "id": "124", "company_name": "Stark Industries", "num_employees": 5215, "country": "USA" }, "text_match": 130916 }.
- #score ⇒ Object
Constructor Details
#initialize(hit) ⇒ Hit
{ "highlights": [ { "field": "company_name", "matched_tokens": ["Stark"], "snippet": "Stark Industries" } ], "document": { "id": "124", "company_name": "Stark Industries", "num_employees": 5215, "country": "USA" }, "text_match": 130916 }
26 27 28 |
# File 'lib/typesensual/search/hit.rb', line 26 def initialize(hit) @hit = hit end |
Instance Method Details
#document ⇒ Object
34 35 36 |
# File 'lib/typesensual/search/hit.rb', line 34 def document @hit['document'] end |
#highlights ⇒ Object
30 31 32 |
# File 'lib/typesensual/search/hit.rb', line 30 def highlights @hit['highlights'] end |
#score ⇒ Object
38 39 40 |
# File 'lib/typesensual/search/hit.rb', line 38 def score @hit['text_match'] end |