Class: Droonga::Searcher::SearchRequest

Inherits:
Object
  • Object
show all
Defined in:
lib/droonga/searcher.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#contextObject (readonly)

Returns the value of attribute context.



169
170
171
# File 'lib/droonga/searcher.rb', line 169

def context
  @context
end

#queryObject (readonly)

Returns the value of attribute query.



169
170
171
# File 'lib/droonga/searcher.rb', line 169

def query
  @query
end

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

Returns:

  • (Boolean)


185
186
187
# File 'lib/droonga/searcher.rb', line 185

def complex_output?
  output["format"] == "complex"
end

#need_output?Boolean

Returns:

  • (Boolean)


177
178
179
# File 'lib/droonga/searcher.rb', line 177

def need_output?
  @query.has_key?("output")
end

#outputObject



181
182
183
# File 'lib/droonga/searcher.rb', line 181

def output
  @query["output"]
end

#sourceObject



189
190
191
192
# File 'lib/droonga/searcher.rb', line 189

def source
  source_name = @query["source"]
  @resolved_results[source_name]
end