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
{{ message }}
This repository was archived by the owner on Sep 21, 2021. It is now read-only.
Copy file name to clipboardExpand all lines: 300_Aggregations/45_filtering.asciidoc
+4-4
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ A natural extension to aggregation scoping is filtering. Because the aggregatio
5
5
operates in the context of the query scope, any filter applied to the query
6
6
will also apply to the aggregation.
7
7
8
-
[float]
8
+
[float="true"]
9
9
=== Filtered Query
10
10
If we want to find all cars over $10,000 and also calculate the average price
11
11
for those cars,((("filtering", "serch query results")))((("filtered query")))((("queries", "filtered"))) we can simply use a `filtered` query:
@@ -39,7 +39,7 @@ query, as we discussed in the previous chapter. The query (which happens to inc
39
39
a filter) returns a certain subset of documents, and the aggregation operates
40
40
on those documents.
41
41
42
-
[float]
42
+
[float="true"]
43
43
=== Filter Bucket
44
44
45
45
But what if you would like to filter just the aggregation results?((("filtering", "aggregation results, not the query")))((("aggregations", "filtering"))) Imagine we
@@ -95,7 +95,7 @@ Since the `filter` bucket operates like any other bucket, you are free to nest
95
95
other buckets and metrics inside. All nested components will "inherit" the filter.
96
96
This allows you to filter selective portions of the aggregation as required.
97
97
98
-
[float]
98
+
[float="true"]
99
99
=== Post Filter
100
100
101
101
So far, we have a way to filter both the search results and aggregations (a
@@ -168,7 +168,7 @@ The `post_filter` should be used only in combination with aggregations, and only
168
168
when you need differential filtering.
169
169
====
170
170
171
-
[float]
171
+
[float="true"]
172
172
=== Recap
173
173
174
174
Choosing the appropriate type of filtering--search hits, aggregations, or
0 commit comments