1
0
mirror of https://github.com/oceanprotocol/market.git synced 2024-12-02 05:57:29 +01:00

fix search title (#1122)

This commit is contained in:
Matthias Kretschmann 2022-02-17 21:38:40 +00:00 committed by GitHub
parent d2fb4db7c6
commit 5a4a30e0b0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 2 deletions

View File

@ -20,7 +20,10 @@ interface SearchResponse {
_scroll_id?: string | undefined _scroll_id?: string | undefined
_shards: ShardsResponse _shards: ShardsResponse
hits: { hits: {
total: number total: {
relation: string
value: number
}
max_score: number max_score: number
hits: Array<{ hits: Array<{
_index: string _index: string

View File

@ -79,7 +79,7 @@ export function transformQueryResult(
result.results = (queryResult.hits.hits || []).map( result.results = (queryResult.hits.hits || []).map(
(hit) => hit._source as Asset (hit) => hit._source as Asset
) )
result.totalResults = queryResult.hits.total result.totalResults = queryResult.hits.total.value
result.totalPages = result.totalPages =
result.totalResults / size < 1 result.totalResults / size < 1
? Math.floor(result.totalResults / size) ? Math.floor(result.totalResults / size)