public function buildPipeline(PipelineInterface $pipeline)
    {
        if ($pipeline->getType() !== PipelineInterface::TYPE_BUCKET_SELECTOR) {
            throw new \InvalidArgumentException("Query builder : invalid aggregation type {$pipeline->getType()}.");
        }

        $aggParams = [
            'buckets_path'  => $pipeline->getBucketsPath(),
            'script'        => $pipeline->getScript(),
            'gap_policy'    => $pipeline->getGapPolicy(),
        ];

        return ['bucket_selector' => $aggParams];
    }
public function buildPipeline(PipelineInterface $pipeline)
    {
        if ($pipeline->getType() !== PipelineInterface::TYPE_BUCKET_SELECTOR) {
            throw new \InvalidArgumentException("Query builder : invalid aggregation type {$pipeline->getType()}.");
        }

        $aggParams = [
            'buckets_path'  => $pipeline->getBucketsPath(),
            'script'        => $pipeline->getScript(),
            'gap_policy'    => $pipeline->getGapPolicy(),
        ];

        return ['bucket_selector' => $aggParams];
    }
public function buildPipeline ( PipelineInterface $ pipeline ) { if ( $ pipeline -> getType ( ) !== PipelineInterface :: TYPE_BUCKET_SELECTOR ) { throw new \ InvalidArgumentException ( "Query builder : invalid aggregation type {$pipeline->getType()}." ) ; } $ aggParams = [ 'buckets_path' => $ pipeline -> getBucketsPath ( ) , 'script' => $ pipeline -> getScript ( ) , 'gap_policy' => $ pipeline -> getGapPolicy ( ) , ] ; return [ 'bucket_selector' => $ aggParams ] ; }
Build the pipeline aggregation.

@param PipelineInterface $pipeline Bucket selector pipeline.

@return array
Build the pipeline aggregation .