Skip to content
GitLab
Explore
Sign in
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
87c7ac12
Commit
87c7ac12
authored
9 years ago
by
Aivaras Gotovskis
Browse files
Options
Downloads
Patches
Plain Diff
Add aggregation doc.
parent
ddb7200e
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
docs/Aggregation/index.md
+49
-0
49 additions, 0 deletions
docs/Aggregation/index.md
docs/index.md
+1
-1
1 addition, 1 deletion
docs/index.md
with
50 additions
and
1 deletion
docs/Aggregation/index.md
0 → 100644
+
49
−
0
View file @
87c7ac12
# Aggregation
Objective aggregation builder represents all available
[
Elasticsearch aggregations
][
1
]
.
To form an aggregation you have to create
`Search`
object. See below an example of min aggregation usage.
```
php
$search
=
new
Search
();
$minAggregation
=
new
MinAggregation
(
'min_agg'
);
$minAggregation
->
setField
(
'price'
);
$search
->
addAggregation
(
$minAggregation
);
$queryArray
=
$search
->
toArray
();
```
There are 2 types of aggregation: bucketing and metric. The only difference in using them is that metric bucketing
aggregations supports nesting while metric aggregations will ignore any set nested aggregations.
## Metric Aggregations
-
[
Avg
](
Avg.md
)
-
[
Cardinality
](
Cardinality.md
)
-
[
ExtendedStats
](
ExtendedStats.md
)
-
[
Max
](
Max.md
)
-
[
Min
](
Min.md
)
-
[
PercentileRanks
](
PercentileRanks.md
)
-
[
Percentiles
](
Percentiles.md
)
-
[
Stats
](
Stats.md
)
-
[
Sum
](
Sum.md
)
-
[
TopHits
](
TopHits.md
)
-
[
ValueCount
](
ValueCount.md
)
## Bucketing Aggregations
-
[
Children
](
Children.md
)
-
[
DateRange
](
DateRange.md
)
-
[
Filter
](
Filter.md
)
-
[
Filters
](
Filters.md
)
-
[
GeoBounds
](
GeoBounds.md
)
-
[
GeoDistance
](
GeoDistance.md
)
-
[
GeoHashGrid
](
GeoHashGrid.md
)
-
[
Global
](
Global.md
)
-
[
Histogram
](
Histogram.md
)
-
[
Ipv4Range
](
Ipv4Range.md
)
-
[
Missing
](
Missing.md
)
-
[
Nested
](
Nested.md
)
-
[
Range
](
Range.md
)
-
[
ReverseNested
](
ReverseNested.md
)
-
[
Terms
](
Terms.md
)
[
1
]:
https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations.html
This diff is collapsed.
Click to expand it.
docs/index.md
+
1
−
1
View file @
87c7ac12
...
...
@@ -7,7 +7,7 @@ Everything starts from the `Search` object. We recommend first to take a look at
### Topics:
-
[
Build Queries
](
Query/index.md
)
-
[
Build Filters
](
Filter/index.md
)
-
[Build Aggregations]
-
[
Build Aggregations
]
(
Aggregation/index.md
)
### How to
-
[How to combine
`Filter`
and
`Query`
]
...
...
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