@polargold/pg-frontend-core
    Preparing search index...

    Interface ElasticSearchHitsResponse<SearchResultItem>

    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.

    interface ElasticSearchHitsResponse<SearchResultItem> {
        hits: { hits: SearchResultHit<SearchResultItem>[] | null | undefined };
    }

    Type Parameters

    • SearchResultItem
    Index
    hits: { hits: SearchResultHit<SearchResultItem>[] | null | undefined }