The minimal shape extractSearchResultItems needs - deliberately not the full Elasticsearch
response envelope (which also varies per app in its aggregations/total/shards shape).
A richer app-specific response type (e.g. one with total, aggregations, extra hit fields
like score/index/sort) still satisfies this via TypeScript's structural typing, so no
app needs to adopt a shared response type just to use this utility.
The minimal shape
extractSearchResultItemsneeds - deliberately not the full Elasticsearch response envelope (which also varies per app in itsaggregations/total/shardsshape). A richer app-specific response type (e.g. one withtotal,aggregations, extra hit fields likescore/index/sort) still satisfies this via TypeScript's structural typing, so no app needs to adopt a shared response type just to use this utility.