Class: Kiosk::Indexer::Adapter::ThinkingSphinxAdapter::Search
- Inherits:
-
Object
- Object
- Kiosk::Indexer::Adapter::ThinkingSphinxAdapter::Search
- Defined in:
- lib/kiosk/indexer/adapter/thinking_sphinx_adapter.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#query ⇒ Object
readonly
Returns the value of attribute query.
Instance Method Summary collapse
- #execute_for(model) ⇒ Object
-
#initialize(query, options = {}) ⇒ Search
constructor
A new instance of Search.
Constructor Details
#initialize(query, options = {}) ⇒ Search
Returns a new instance of Search.
70 71 72 73 74 |
# File 'lib/kiosk/indexer/adapter/thinking_sphinx_adapter.rb', line 70 def initialize(query, = {}) @query = query @options = {:comment => ''}.merge() @proxy = SearchProxy.new(@options) end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
68 69 70 |
# File 'lib/kiosk/indexer/adapter/thinking_sphinx_adapter.rb', line 68 def @options end |
#query ⇒ Object (readonly)
Returns the value of attribute query.
68 69 70 |
# File 'lib/kiosk/indexer/adapter/thinking_sphinx_adapter.rb', line 68 def query @query end |
Instance Method Details
#execute_for(model) ⇒ Object
76 77 78 79 80 81 |
# File 'lib/kiosk/indexer/adapter/thinking_sphinx_adapter.rb', line 76 def execute_for(model) query = @proxy.star_query(@query) (@options) do SearchResults.new(client.query(query, index_names_for(model), @options[:comment]), model, @options) end end |