From 5a4a30e0b017608676bc6c280f8872903215bcb4 Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Thu, 17 Feb 2022 21:38:40 +0000 Subject: [PATCH] fix search title (#1122) --- src/@types/aquarius/SearchResponse.d.ts | 5 ++++- src/@utils/aquarius.ts | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/@types/aquarius/SearchResponse.d.ts b/src/@types/aquarius/SearchResponse.d.ts index a90df2095..e679a7b33 100644 --- a/src/@types/aquarius/SearchResponse.d.ts +++ b/src/@types/aquarius/SearchResponse.d.ts @@ -20,7 +20,10 @@ interface SearchResponse { _scroll_id?: string | undefined _shards: ShardsResponse hits: { - total: number + total: { + relation: string + value: number + } max_score: number hits: Array<{ _index: string diff --git a/src/@utils/aquarius.ts b/src/@utils/aquarius.ts index aac6fb2dd..f70748116 100644 --- a/src/@utils/aquarius.ts +++ b/src/@utils/aquarius.ts @@ -79,7 +79,7 @@ export function transformQueryResult( result.results = (queryResult.hits.hits || []).map( (hit) => hit._source as Asset ) - result.totalResults = queryResult.hits.total + result.totalResults = queryResult.hits.total.value result.totalPages = result.totalResults / size < 1 ? Math.floor(result.totalResults / size)