From 62af452945a7d7e52e91b6b4c35892038efe300a Mon Sep 17 00:00:00 2001 From: goaround Date: Sun, 15 Mar 2020 18:15:01 +0100 Subject: [PATCH] Update aggs for multiple aggregation With `'use-filter' => true` you have to use multiple aggregation. Otherwise, you get an 400 error. See: https://github.com/10up/ElasticPress/issues/834 I would make sense to include two examples: One with `'use-filter' => true` and multiple aggregation and one without 'use-filter' --- docs/indexables.md | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/docs/indexables.md b/docs/indexables.md index 8382d9d477..5902be0739 100644 --- a/docs/indexables.md +++ b/docs/indexables.md @@ -380,11 +380,12 @@ The following are special parameters that are only supported by ElasticPress. 's' => 'search phrase', 'aggs' => array( 'name' => 'name-of-aggregation', // (can be whatever you'd like) - 'use-filter' => true // (*bool*) used if you'd like to apply the other filters (i.e. post type, tax_query, author), to the aggregation - 'aggs' => array( - 'name' => 'name-of-sub-aggregation', - 'terms' => array( - 'field' => 'terms.name-of-taxonomy.name-of-term', + 'use-filter' => true, // (*bool*) used if you'd like to apply the other filters (i.e. post type, tax_query, author), to the aggregation + 'aggs' => array( + 'name-of-sub-aggregation' => array( + 'terms' => array( + 'field' => 'terms.name-of-taxonomy.name-of-term', + ), ), ), ), @@ -532,4 +533,4 @@ The User Indexable is only enabled if the User feature is activated. ElasticPres * ```search_columns``` - Specify columns in the user database table to be searched. NB: this is merged into ```search_fields``` before being sent to Elasticsearch with ```search_fields``` overwriting ```search_columns```. \ No newline at end of file + Specify columns in the user database table to be searched. NB: this is merged into ```search_fields``` before being sent to Elasticsearch with ```search_fields``` overwriting ```search_columns```.