Skip to content

Instantly share code, notes, and snippets.

@ArFeRR
Created March 18, 2015 13:25
Show Gist options
  • Save ArFeRR/4c96ebd52e11419a1aef to your computer and use it in GitHub Desktop.
Save ArFeRR/4c96ebd52e11419a1aef to your computer and use it in GitHub Desktop.
$script = new \Elastica\Script('doc["skus.stock"].values');
$scriptAggr = new \Elastica\Aggregation\Terms('script_aggr');
$scriptAggr->setScript($script);
$scriptAggr->setParam('size', 100000);
$nestedAggr = new \Elastica\Aggregation\Nested('nested_sku_aggr', 'skus');
$nestedAggr->addAggregation($scriptAggr);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment