From 91e2348381d270198912ddabf7eddf114ab2ef35 Mon Sep 17 00:00:00 2001 From: ochen1 Date: Sun, 24 Sep 2023 21:30:16 -0700 Subject: [PATCH] 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 --- server/src/infra/typesense-schemas/asset.schema.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/src/infra/typesense-schemas/asset.schema.ts b/server/src/infra/typesense-schemas/asset.schema.ts index 53729c0772..d98bac0f50 100644 --- a/server/src/infra/typesense-schemas/asset.schema.ts +++ b/server/src/infra/typesense-schemas/asset.schema.ts @@ -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', };