File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change 44
55use Closure ;
66use Ensi \LaravelElasticQuery \Aggregating \AggregationCollection ;
7+ use Ensi \LaravelElasticQuery \Aggregating \Bucket \FilterAggregation ;
78use Ensi \LaravelElasticQuery \Aggregating \Bucket \NestedAggregation ;
89use Ensi \LaravelElasticQuery \Aggregating \Bucket \TermsAggregation ;
910use Ensi \LaravelElasticQuery \Aggregating \CompositeAggregationBuilder ;
1011use Ensi \LaravelElasticQuery \Aggregating \Metrics \MinMaxAggregation ;
1112use Ensi \LaravelElasticQuery \Aggregating \Metrics \ValueCountAggregation ;
1213use Ensi \LaravelElasticQuery \Contracts \Aggregation ;
14+ use Ensi \LaravelElasticQuery \Contracts \Criteria ;
1315use Ensi \LaravelElasticQuery \Filtering \BoolQueryBuilder ;
1416use Ensi \LaravelElasticQuery \Search \Sorting \Sort ;
1517
@@ -33,6 +35,13 @@ public function terms(
3335 return $ this ;
3436 }
3537
38+ public function filter (string $ name , Criteria $ criteria , AggregationCollection $ children ): static
39+ {
40+ $ this ->aggregations ->add (new FilterAggregation ($ name , $ criteria , $ children ));
41+
42+ return $ this ;
43+ }
44+
3645 public function minmax (string $ name , string $ field ): static
3746 {
3847 $ this ->aggregations ->add (new MinMaxAggregation ($ name , $ this ->absolutePath ($ field )));
You can’t perform that action at this time.
0 commit comments