@@ -48,14 +48,14 @@ The example below uses `RangeAggregationVisitor`:
4848
4949 ``` yaml
5050 services:
51- [[ = include_file( ' code_samples/search/custom/config/aggregation_services.yaml' , 1, 10 ) =]]
51+ [[ = include_file( ' code_samples/search/custom/config/aggregation_services.yaml' , 1, 9 ) =]]
5252 ```
5353
5454=== " Elasticsearch"
5555
5656 ``` yaml
5757 services:
58- [[ = include_file( ' code_samples/search/custom/config/aggregation_services.yaml' , 11, 20 ) =]]
58+ [[ = include_file( ' code_samples/search/custom/config/aggregation_services.yaml' , 10, 18 ) =]]
5959 ```
6060
6161The visitor is created by `SearchFieldAggregationVisitorFactory`.
@@ -76,22 +76,20 @@ For the result extractor, you can use the built-in `RangeAggregationResultExtrac
7676
7777=== " Solr"
7878
79- Tag the service with `ibexa.search.solr.query.location.aggregation.result.extractor`
80- and `ibexa.search.solr.query.content.aggregation.result.extractor`.
79+ Tag the service with `ibexa.search.solr.query.location.aggregation.result.extractor`.
8180
8281 ``` yaml
8382 services:
84- [[ = include_file( ' code_samples/search/custom/config/aggregation_services.yaml' , 21, 29 ) =]]
83+ [[ = include_file( ' code_samples/search/custom/config/aggregation_services.yaml' , 19, 26 ) =]]
8584 ```
8685
8786=== " Elasticsearch"
8887
89- Tag the service with `ibexa.search.elasticsearch.query.location.aggregation.result.extractor`
90- and `ibexa.search.elasticsearch.query.content.aggregation.result.extractor`.
88+ Tag the service with `ibexa.search.elasticsearch.query.location.aggregation.result.extractor`.
9189
9290 ``` yaml
9391 services:
94- [[ = include_file( ' code_samples/search/custom/config/aggregation_services.yaml' , 30, 37 ) =]]
92+ [[ = include_file( ' code_samples/search/custom/config/aggregation_services.yaml' , 27, 33 ) =]]
9593 ```
9694
9795You can use a different type of aggregation, followed by respective visitor and extractor classes:
@@ -141,6 +139,31 @@ The `canVisit()` method checks whether the provided aggregation is of the suppor
141139
142140The `visit()` method returns an array of results.
143141
142+ Finally, register the aggregation visitor as a service.
143+
144+ === " Solr"
145+
146+ Tag the aggregation visitor with `ibexa.search.solr.query.location.aggregation.visitor`:
147+
148+ ``` yaml
149+ services:
150+ [[ = include_file( ' code_samples/search/custom/config/aggregation_services.yaml' , 34, 37) =]]
151+ ```
152+
153+ For content-based aggregations, use the `ibexa.search.solr.query.content.aggregation.visitor` tag.
154+
155+ === " Elasticsearch"
156+
157+ Tag the aggregation visitor with `ibexa.elasticsearch.query.location.aggregation_visitor`:
158+
159+ ``` yaml
160+ services:
161+ [[ = include_file( ' code_samples/search/custom/config/aggregation_services.yaml' , 42, 45) =]]
162+ ```
163+
164+ For content-based aggregations, use the `ibexa.search.elasticsearch.query.content.aggregation.visitor` tag.
165+
166+
144167### Create result extractor
145168
146169=== " Solr"
@@ -172,26 +195,26 @@ The `visit()` method returns an array of results.
172195 The `extract()` method converts the [raw data provided by the search engine](https: //www.elastic.co /guide /en /elasticsearch /reference /current /search-aggregations.html) to a `RangeAggregationResult` object.
173196
174197
175- Finally, register both the aggregation visitor and the result extractor as services .
198+ Finally, register the result extractor as a service .
176199
177200=== " Solr"
178201
179- Tag the aggregation visitor with `ibexa.search.solr.query.location.aggregation.visitor` and the result extractor with `ibexa.search.solr.query.location.aggregation.result.extractor`:
202+ Tag the result extractor with `ibexa.search.solr.query.location.aggregation.result.extractor`:
180203
181204 ``` yaml
182205 services:
183- [[ = include_file( ' code_samples/search/custom/config/aggregation_services.yaml' , 38, 47 ) =]]
206+ [[ = include_file( ' code_samples/search/custom/config/aggregation_services.yaml' , 38, 41 ) =]]
184207 ```
185208
186- For content-based aggregations, use the `ibexa.search.solr.query.content.aggregation.visitor` and `ibexa.search.solr.query.content.aggregation. result.extractor` tags respectively .
209+ For content-based aggregations, use the `ibexa.search.solr.query.content.aggregation.result.extractor` tag .
187210
188211=== " Elasticsearch"
189212
190- Tag the aggregation visitor with `ibexa.elasticsearch.query.location.aggregation_visitor` and the result extractor with `ibexa.elasticsearch.query.location.aggregation_result_extractor`:
213+ Tag the result extractor with `ibexa.elasticsearch.query.location.aggregation_result_extractor`:
191214
192215 ``` yaml
193216 services:
194- [[ = include_file( ' code_samples/search/custom/config/aggregation_services.yaml' , 48, 57 ) =]]
217+ [[ = include_file( ' code_samples/search/custom/config/aggregation_services.yaml' , 46, 49 ) =]]
195218 ```
196219
197- For content-based aggregations, use the `ibexa.search.elasticsearch.query.content.aggregation.visitor` and `ibexa.search.elasticsearch.query.content.aggregation. result.extractor` tags respectively .
220+ For content-based aggregations, use the `ibexa.search.elasticsearch.query.content.aggregation.result.extractor` tag .
0 commit comments