fix(server): search for terms separated by hyphens and/or underscores in asset search (#4156)

* Use hyphen and underscore as token separators in search

* Bump typesense asset schema version

* Bump typesense asset schema version
This commit is contained in:
ochen1 2023-09-24 21:30:16 -07:00 committed by GitHub
parent 1564ed3256
commit 91e2348381
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,6 +1,6 @@
import { CollectionCreateSchema } from 'typesense/lib/Typesense/Collections';
export const assetSchemaVersion = 8;
export const assetSchemaVersion = 9;
export const assetSchema: CollectionCreateSchema = {
name: `assets-v${assetSchemaVersion}`,
fields: [
@ -35,7 +35,7 @@ export const assetSchema: CollectionCreateSchema = {
{ name: 'motion', type: 'bool', facet: true },
{ name: 'people', type: 'string[]', facet: true, optional: true },
],
token_separators: ['.'],
token_separators: ['.', '-', '_'],
enable_nested_fields: true,
default_sorting_field: 'fileCreatedAt',
};