You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* @param string $parentPath The parent path to add the sub aggregation to
120
+
* @param string $name The name to identify the resulting aggregation
121
121
* @param array $aggregationConfiguration
122
122
* @return QueryInterface
123
123
* @throws Exception\QueryBuildingException
@@ -127,9 +127,9 @@ protected function addSubAggregation($parentPath, $name, $aggregationConfigurati
127
127
// Find the parentPath
128
128
$path =& $this->request['aggregations'];
129
129
130
-
foreach (explode(".", $parentPath) as$subPart) {
130
+
foreach (explode('.', $parentPath) as$subPart) {
131
131
if ($path == null || !array_key_exists($subPart, $path)) {
132
-
thrownewException\QueryBuildingException("The parent path " . $subPart . " could not be found when adding a sub aggregation");
132
+
thrownewException\QueryBuildingException(sprintf('The parent path segment "%s" could not be found when adding a sub aggregation to parent path "%s"', $subPart, $parentPath));
Copy file name to clipboardExpand all lines: README.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -208,8 +208,8 @@ Right now there are two methods implemented. One generic `aggregation` function
208
208
aggregation definition and a pre-configured `fieldBasedAggregation`. Both methods can be added to your TS search query.
209
209
You can nest aggregations by providing a parent name.
210
210
211
-
*`aggregation($name, array $aggregationDefinition, $parentPath = NULL)` -- generic method to add a $aggregationDefinition under a path $parentPath with the name $name
212
-
*`fieldBasedAggregation($name, $field, $type = "terms", $parentPath = NULL)` -- adds a simple filed based Aggregation of type $type with name $name under path $parentPath. Used for simple aggregations like sum, avg, min, max or terms
211
+
*`aggregation($name, array $aggregationDefinition, $parentPath = NULL)` -- generic method to add a $aggregationDefinition under a path $parentPath with the name $name.
212
+
*`fieldBasedAggregation($name, $field, $type = 'terms', $parentPath = '', $size = 10)` -- adds a simple filed based Aggregation of type $type with name $name under path $parentPath. Used for simple aggregations like sum, avg, min, max or terms. By default 10 buckets are returned.
0 commit comments