Class: IndexTanked::SearchResult

Inherits:
Object
  • Object
show all
Defined in:
lib/index-tanked/search_result.rb

Direct Known Subclasses

ActiveRecordDefaults::SearchResult

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(query, index, options = {}) ⇒ SearchResult

Returns a new instance of SearchResult.



6
7
8
9
10
# File 'lib/index-tanked/search_result.rb', line 6

def initialize(query, index, options={})
  @index   = index
  @options = options
  @query   = query
end

Instance Attribute Details

#pageObject (readonly)

Returns the value of attribute page.



4
5
6
# File 'lib/index-tanked/search_result.rb', line 4

def page
  @page
end

#per_pageObject (readonly)

Returns the value of attribute per_page.



4
5
6
# File 'lib/index-tanked/search_result.rb', line 4

def per_page
  @per_page
end

Instance Method Details

#facets(force = false) ⇒ Object



17
18
19
20
# File 'lib/index-tanked/search_result.rb', line 17

def facets(force=false)
  execute_search(force)
  @raw_result["facets"]
end

#matches(force = false) ⇒ Object



22
23
24
25
# File 'lib/index-tanked/search_result.rb', line 22

def matches(force=false)
  execute_search(force)
  @raw_result["matches"]
end

#raw_result(force = false) ⇒ Object



32
33
34
35
# File 'lib/index-tanked/search_result.rb', line 32

def raw_result(force=false)
  execute_search(force)
  @raw_result
end

#results(force = false) ⇒ Object



27
28
29
30
# File 'lib/index-tanked/search_result.rb', line 27

def results(force=false)
  execute_search(force)
  @results
end

#search_time(force = false) ⇒ Object



12
13
14
15
# File 'lib/index-tanked/search_result.rb', line 12

def search_time(force=false)
  execute_search(force)
  @raw_result['search_time']
end