Advanced search and search analytics for Vendure.

Implements

  • OnModuleInit
  • OnApplicationBootstrap
  • OnModuleDestroy

Constructors

  • Internal

    Parameters

    • typesenseService: TypesenseService
    • typesenseHealthIndicator: TypesenseHealthIndicator
    • searchIndexService: SearchIndexService
    • eventBus: EventBus
    • registry: HealthCheckRegistryService
    • moduleRef: ModuleRef
    • externalIndexService: ExternalIndexService
    • options: AdvancedSearchInitOptions
    • i18nService: I18nService
    • licenseService: LicenseService

    Returns AdvancedSearchPlugin

Properties

uiExtensions: any

The static uiExtensions property is used to provide the necessary UI extensions to the Admin UI in order to display the advanced search features. This property is used in the AdminUiPlugin initialization.

import { compileUiExtensions } from '@vendure/ui-devkit/compiler';
import { AdvancedSearchPlugin } from '@vendure-hub/vendure-advanced-search-plugin';

// ...
plugins: [
AdminUiPlugin.init({
route: 'admin',
port: 3002,
app: compileUiExtensions({
outputPath: path.join(__dirname, '../admin-ui'),
extensions: [AdvancedSearchPlugin.uiExtensions],
devMode: false,
})
}),
],
uiExtensionsNoAnalytics: any

The static uiExtensionsNoAnalytics property is used to provide the necessary UI extensions to the Admin UI in order to display the advanced search features without analytics.

import { compileUiExtensions } from '@vendure/ui-devkit/compiler';
import { AdvancedSearchPlugin } from '@vendure-hub/vendure-advanced-search-plugin';

// ...
plugins: [
AdminUiPlugin.init({
route: 'admin',
port: 3002,
app: compileUiExtensions({
outputPath: path.join(__dirname, '../admin-ui'),
extensions: [AdvancedSearchPlugin.uiExtensionsNoAnalytics],
devMode: false,
})
}),
],

Methods

  • Internal

    Returns Promise<void>

  • Internal

    Returns Promise<void>

  • Internal

    Returns Promise<void>

  • The static init() method is called with the options to configure the plugin.

    Parameters

    Returns typeof AdvancedSearchPlugin

    AdvancedSearchPlugin.init({
    shopApiKeySecret: process.env.SHOP_API_KEY_SECRET as string,
    typeSenseClientOptions: {
    apiKey: process.env.TYPESENSE_API_KEY as string,
    nodes: [
    {
    host: process.env.TYPESENSE_HOST as string,
    port: 8108,
    protocol: 'http',
    },
    ],
    },
    analytics: {
    analyticsStrategy: new ClickhouseAnalyticsStrategy({
    url: process.env.CLICKHOUSE_URL as string,
    port: 8123,
    database: 'vendure_search_analytics',
    debug: false,
    }),
    },
    customMappings: {
    // same as ElasticSearchPlugin
    },
    }),