Class: Groonga::Command::Select
- Inherits:
-
Object
- Object
- Groonga::Command::Select
- Defined in:
- lib/groonga/command.rb
Defined Under Namespace
Classes: Result
Instance Method Summary collapse
- #exec ⇒ Object
-
#initialize(context, table, options) ⇒ Select
constructor
A new instance of Select.
Constructor Details
#initialize(context, table, options) ⇒ Select
Returns a new instance of Select.
54 55 56 57 58 |
# File 'lib/groonga/command.rb', line 54 def initialize(context, table, ) @context = context @table = table @options = () end |
Instance Method Details
#exec ⇒ Object
60 61 62 63 64 65 66 67 68 69 70 71 72 73 |
# File 'lib/groonga/command.rb', line 60 def exec request_id = @context.send(query) loop do response_id, result = @context.receive if request_id == response_id drill_down_keys = @options["drilldown"] if drill_down_keys.is_a?(String) drill_down_keys = drill_down_keys.split(/(?:\s+|\s*,\s*)/) end return Result.parse(result, drill_down_keys) end # raise if request_id < response_id end end |