DefaultSearchPlugin
DefaultSearchPlugin
The DefaultSearchPlugin provides a full-text Product search based on the full-text searching capabilities of the underlying database.
The DefaultSearchPlugin is bundled with the @vendure/core
package. If you are not using an alternative search
plugin, then make sure this one is used, otherwise you will not be able to search products via the
search
query.
caution
Note that the quality of the fulltext search capabilities varies depending on the underlying database being used. For example, the MySQL & Postgres implementations will typically yield better results than the SQLite implementation.
Example
import { DefaultSearchPlugin, VendureConfig } from '@vendure/core';
export const config: VendureConfig = {
// Add an instance of the plugin to the plugins array
plugins: [
DefaultSearchPlugin.init({
indexStockStatus: true,
bufferUpdates: true,
}),
],
};
Signature
class DefaultSearchPlugin implements OnApplicationBootstrap, OnApplicationShutdown {
static options: DefaultSearchPluginInitOptions = {};
init(options: DefaultSearchPluginInitOptions) => Type<DefaultSearchPlugin>;
}
- Implements:
OnApplicationBootstrap
,OnApplicationShutdown