Class: RailsConnector::SES::Hit
- Inherits:
-
Object
- Object
- RailsConnector::SES::Hit
- Defined in:
- lib/rails_connector/ses.rb
Overview
A hit represents a found document for a particular search query.
Instance Attribute Summary collapse
-
#doc ⇒ Object
readonly
The raw result hash returned by the search engine, for a low-level access.
-
#id ⇒ Object
readonly
The ID of the found Obj.
-
#score ⇒ Object
readonly
The score of the hit.
Instance Method Summary collapse
-
#obj ⇒ Object
Returns the hit’s corresponding Obj (or nil if none found in the database).
Instance Attribute Details
#doc ⇒ Object (readonly)
The raw result hash returned by the search engine, for a low-level access. Don’t use this unless you know what you’re doing. Be aware that this is not migration safe.
64 65 66 |
# File 'lib/rails_connector/ses.rb', line 64 def doc @doc end |
#id ⇒ Object (readonly)
The ID of the found Obj.
54 55 56 |
# File 'lib/rails_connector/ses.rb', line 54 def id @id end |
#score ⇒ Object (readonly)
The score of the hit.
58 59 60 |
# File 'lib/rails_connector/ses.rb', line 58 def score @score end |
Instance Method Details
#obj ⇒ Object
Returns the hit’s corresponding Obj (or nil if none found in the database).
75 76 77 78 79 |
# File 'lib/rails_connector/ses.rb', line 75 def obj @obj ||= ::Obj.find(@id) rescue RailsConnector::ResourceNotFound nil end |