Class: Droonga::Searcher::SearchRequest
- Inherits:
-
Object
- Object
- Droonga::Searcher::SearchRequest
- Defined in:
- lib/droonga/searcher.rb
Instance Attribute Summary collapse
-
#context ⇒ Object
readonly
Returns the value of attribute context.
-
#query ⇒ Object
readonly
Returns the value of attribute query.
-
#resolved_results ⇒ Object
readonly
Returns the value of attribute resolved_results.
Instance Method Summary collapse
- #complex_output? ⇒ Boolean
-
#initialize(context, query, resolved_results) ⇒ SearchRequest
constructor
A new instance of SearchRequest.
- #need_output? ⇒ Boolean
- #output ⇒ Object
- #source ⇒ Object
Constructor Details
#initialize(context, query, resolved_results) ⇒ SearchRequest
Returns a new instance of SearchRequest.
171 172 173 174 175 |
# File 'lib/droonga/searcher.rb', line 171 def initialize(context, query, resolved_results) @context = context @query = query @resolved_results = resolved_results end |
Instance Attribute Details
#context ⇒ Object (readonly)
Returns the value of attribute context.
169 170 171 |
# File 'lib/droonga/searcher.rb', line 169 def context @context end |
#query ⇒ Object (readonly)
Returns the value of attribute query.
169 170 171 |
# File 'lib/droonga/searcher.rb', line 169 def query @query end |
#resolved_results ⇒ Object (readonly)
Returns the value of attribute resolved_results.
169 170 171 |
# File 'lib/droonga/searcher.rb', line 169 def resolved_results @resolved_results end |
Instance Method Details
#complex_output? ⇒ Boolean
185 186 187 |
# File 'lib/droonga/searcher.rb', line 185 def complex_output? output["format"] == "complex" end |
#need_output? ⇒ Boolean
177 178 179 |
# File 'lib/droonga/searcher.rb', line 177 def need_output? @query.has_key?("output") end |
#output ⇒ Object
181 182 183 |
# File 'lib/droonga/searcher.rb', line 181 def output @query["output"] end |
#source ⇒ Object
189 190 191 192 |
# File 'lib/droonga/searcher.rb', line 189 def source source_name = @query["source"] @resolved_results[source_name] end |