From 2f8af7c804d549a13391b769c6ab05818a0691e0 Mon Sep 17 00:00:00 2001 From: Michael Bromley Date: Thu, 22 Aug 2019 12:32:41 +0200 Subject: [PATCH] fix(elasticsearch-plugin): Correctly report facetValue counts --- packages/elasticsearch-plugin/src/elasticsearch.service.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/elasticsearch-plugin/src/elasticsearch.service.ts b/packages/elasticsearch-plugin/src/elasticsearch.service.ts index 76d3decd4c..c4c5545682 100644 --- a/packages/elasticsearch-plugin/src/elasticsearch.service.ts +++ b/packages/elasticsearch-plugin/src/elasticsearch.service.ts @@ -104,8 +104,8 @@ export class ElasticsearchService { }, }; const { body }: { body: SearchResponseBody } = await this.client.search({ - index: indexPrefix + VARIANT_INDEX_NAME, - type: VARIANT_INDEX_TYPE, + index: indexPrefix + (input.groupByProduct ? PRODUCT_INDEX_NAME : VARIANT_INDEX_NAME), + type: input.groupByProduct ? PRODUCT_INDEX_TYPE : VARIANT_INDEX_TYPE, body: elasticSearchBody, });