Class: Droonga::SingleStep
- Inherits:
-
Object
- Object
- Droonga::SingleStep
- Defined in:
- lib/droonga/single_step.rb
Instance Method Summary collapse
-
#initialize(definition) ⇒ SingleStep
constructor
A new instance of SingleStep.
- #plan(message) ⇒ Object
Constructor Details
#initialize(definition) ⇒ SingleStep
Returns a new instance of SingleStep.
21 22 23 |
# File 'lib/droonga/single_step.rb', line 21 def initialize(definition) @definition = definition end |
Instance Method Details
#plan(message) ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/droonga/single_step.rb', line 25 def plan() if ["type"] == "search" # XXX: workaround planner = Plugins::Search::Planner.new return planner.plan() end # XXX: Re-implement me. planner = Planner.new = {} [:write] = @definition.write? collector_class = @definition.collector_class if collector_class reduce_key = "result" [:reduce] = { reduce_key => collector_class.operator, } end inputs = @definition.inputs if inputs.empty? planner.send(:broadcast, , ) else input = inputs.values.first [:key] = ["body"][input[:filter]]["key"] planner.send(:scatter, , ) end end |