import { SearchResponse } from 'elasticsearch' ; internal export function shimHitsTotal ( response ) { const total = ( response . hits ?. total as any ) ?. value ?? response . hits ?. total ; const hits = { ... response . hits , total } ; return { ... response , hits } ; }