Class: FastRI::FullTextIndex::Result
- Inherits:
-
Object
- Object
- FastRI::FullTextIndex::Result
- Defined in:
- lib/fastri/full_text_index.rb
Instance Attribute Summary collapse
-
#index ⇒ Object
readonly
Returns the value of attribute index.
-
#metadata ⇒ Object
readonly
Returns the value of attribute metadata.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#query ⇒ Object
readonly
Returns the value of attribute query.
Instance Method Summary collapse
- #context(size) ⇒ Object
-
#initialize(searcher, query, index, path, metadata) ⇒ Result
constructor
A new instance of Result.
- #text(size) ⇒ Object
Constructor Details
#initialize(searcher, query, index, path, metadata) ⇒ Result
Returns a new instance of Result.
15 16 17 18 19 20 21 |
# File 'lib/fastri/full_text_index.rb', line 15 def initialize(searcher, query, index, path, ) @searcher = searcher @index = index @query = query @path = path @metadata = end |
Instance Attribute Details
#index ⇒ Object (readonly)
Returns the value of attribute index.
13 14 15 |
# File 'lib/fastri/full_text_index.rb', line 13 def index @index end |
#metadata ⇒ Object (readonly)
Returns the value of attribute metadata.
13 14 15 |
# File 'lib/fastri/full_text_index.rb', line 13 def @metadata end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
13 14 15 |
# File 'lib/fastri/full_text_index.rb', line 13 def path @path end |
#query ⇒ Object (readonly)
Returns the value of attribute query.
13 14 15 |
# File 'lib/fastri/full_text_index.rb', line 13 def query @query end |
Instance Method Details
#context(size) ⇒ Object
23 24 25 |
# File 'lib/fastri/full_text_index.rb', line 23 def context(size) @searcher.fetch_data(@index, 2*size+1, -size) end |
#text(size) ⇒ Object
27 28 29 |
# File 'lib/fastri/full_text_index.rb', line 27 def text(size) @searcher.fetch_data(@index, size, 0) end |