function apply_enrich(ids) {

    if (!this || !this.store) return ids;

    if (this.db) {
        return this.index.get(this.field[0]).db.enrich(ids);
    }

    /** @type {EnrichedSearchResults} */
    const result = Array(ids.length);
    for (let x = 0, id; x < ids.length; x++) {
        id = ids[x];
        result[x] = {
            id: id,
            doc: this.store.get(id)
        };
    }

    return result;
}
@param {SearchResults} ids
@return {EnrichedSearchResults|SearchResults|Promise<EnrichedSearchResults|SearchResults>}
@this {Document|Index|WorkerIndex|null}