Class: FastRI::FullTextIndex::Result

Inherits:
Object
  • Object
show all
Defined in:
lib/fastri/full_text_index.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#indexObject (readonly)

Returns the value of attribute index.



13
14
15
# File 'lib/fastri/full_text_index.rb', line 13

def index
  @index
end

#metadataObject (readonly)

Returns the value of attribute metadata.



13
14
15
# File 'lib/fastri/full_text_index.rb', line 13

def 
  @metadata
end

#pathObject (readonly)

Returns the value of attribute path.



13
14
15
# File 'lib/fastri/full_text_index.rb', line 13

def path
  @path
end

#queryObject (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