Represents an external index, by which you can index any kind of data into Typesense and query it via the GraphQL API.

import { ExternalIndex, TypesenseDocument } from '@vendure-hub/vendure-advanced-search-plugin';

interface CollectionDocument extends TypesenseDocument {
name: string;
slug: string;
breadcrumb: string[];
rank: number;
}

export const collectionExternalIndex = new ExternalIndex<CollectionDocument>({
name: 'collections',
getAllIds: async (injector) => {
// ... omitted for brevity
},
// ... omitted for brevity
});
import { VendureConfig } from '@vendure/core';
import { AdvancedSearchPlugin } from '@vendure-hub/vendure-advanced-search-plugin';

import { collectionExternalIndex } from './collection-external-index';

export const config: VendureConfig = {
// ...
plugins: [
AdvancedSearchPlugin.init({
// ...
externalIndexes: [collectionExternalIndex],
}),
],
};

Type Parameters