Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
E
Elasticsearch DSL
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Public
Elasticsearch DSL
Commits
644fbd55
Commit
644fbd55
authored
9 years ago
by
Mantas Jonušas
Browse files
Options
Downloads
Patches
Plain Diff
Added ParametersTrait in AbstractAgregation class
parent
180928bc
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Aggregation/AbstractAggregation.php
+9
-1
9 additions, 1 deletion
Aggregation/AbstractAggregation.php
Aggregation/TermsAggregation.php
+1
-3
1 addition, 3 deletions
Aggregation/TermsAggregation.php
with
10 additions
and
4 deletions
Aggregation/AbstractAggregation.php
+
9
−
1
View file @
644fbd55
...
...
@@ -13,12 +13,15 @@ namespace ONGR\ElasticsearchBundle\DSL\Aggregation;
use
ONGR\ElasticsearchBundle\DSL\NamedBuilderBag
;
use
ONGR\ElasticsearchBundle\DSL\NamedBuilderInterface
;
use
ONGR\ElasticsearchBundle\DSL\ParametersTrait
;
/**
* AbstractAggregation class.
*/
abstract
class
AbstractAggregation
implements
NamedBuilderInterface
{
use
ParametersTrait
;
const
PREFIX
=
'agg_'
;
/**
...
...
@@ -113,7 +116,12 @@ abstract class AbstractAggregation implements NamedBuilderInterface
*/
public
function
toArray
()
{
$result
=
[
$this
->
getName
()
=>
[
$this
->
getType
()
=>
$this
->
getArray
()]];
$array
=
$this
->
getArray
();
$result
=
[
$this
->
getName
()
=>
[
$this
->
getType
()
=>
is_array
(
$array
)
?
$this
->
processArray
(
$array
)
:
$array
,
],
];
if
(
$this
->
supportsNesting
())
{
$nestedResult
=
$this
->
collectNestedAggregations
();
...
...
This diff is collapsed.
Click to expand it.
Aggregation/TermsAggregation.php
+
1
−
3
View file @
644fbd55
...
...
@@ -12,7 +12,6 @@
namespace
ONGR\ElasticsearchBundle\DSL\Aggregation
;
use
ONGR\ElasticsearchBundle\DSL\Aggregation\Type\BucketingTrait
;
use
ONGR\ElasticsearchBundle\DSL\ParametersTrait
;
use
ONGR\ElasticsearchBundle\DSL\ScriptAwareTrait
;
/**
...
...
@@ -22,7 +21,6 @@ class TermsAggregation extends AbstractAggregation
{
use
BucketingTrait
;
use
ScriptAwareTrait
;
use
ParametersTrait
;
/**
* {@inheritdoc}
...
...
@@ -44,6 +42,6 @@ class TermsAggregation extends AbstractAggregation
]
);
return
$this
->
processArray
(
$data
)
;
return
$data
;
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment