From 317e631bb36d6566fe67ec89967b9aa9fb87ddd8 Mon Sep 17 00:00:00 2001 From: Emma Lejeck Date: Sat, 19 Oct 2024 14:42:46 -0700 Subject: [PATCH] Move localized fields to Media index --- app/indices/concerns/typesense_media_index.rb | 12 ++++++++++++ app/indices/typesense_base_index.rb | 12 ------------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/app/indices/concerns/typesense_media_index.rb b/app/indices/concerns/typesense_media_index.rb index 6de4af577..8356e19dd 100644 --- a/app/indices/concerns/typesense_media_index.rb +++ b/app/indices/concerns/typesense_media_index.rb @@ -7,6 +7,18 @@ module TypesenseMediaIndex schema do token_separators(*%w[/ - ( ) + ; : & , .]) + # Locale-specific strings + # Pulled from https://typesense.org/docs/0.24.0/api/collections.html#schema-parameters + field '.*\.ja-.*', type: 'string*', locale: 'ja' + field '.*\.zh-.*', type: 'string*', locale: 'zh' + field '.*\.ko-.*', type: 'string*', locale: 'ko' + field '.*\.th-.*', type: 'string*', locale: 'th' + field '.*\.el-.*', type: 'string*', locale: 'el' + field '.*\.ru-.*', type: 'string*', locale: 'ru' + field '.*\.sr-.*', type: 'string*', locale: 'sr' + field '.*\.uk-.*', type: 'string*', locale: 'uk' + field '.*\.be-.*', type: 'string*', locale: 'be' + # Poster field 'poster_image', type: 'object', optional: true, facet: false, index: false diff --git a/app/indices/typesense_base_index.rb b/app/indices/typesense_base_index.rb index 98b350178..31fb55727 100644 --- a/app/indices/typesense_base_index.rb +++ b/app/indices/typesense_base_index.rb @@ -9,18 +9,6 @@ class TypesenseBaseIndex < Typesensual::Index field 'created_at.month', type: 'int32', facet: true, optional: true field 'created_at.day', type: 'int32', facet: true, optional: true field 'created_at.timestamp', type: 'int64', optional: true - - # Locale-specific strings - # Pulled from https://typesense.org/docs/0.24.0/api/collections.html#schema-parameters - field '.*\.ja-.*', type: 'string*', locale: 'ja' - field '.*\.zh-.*', type: 'string*', locale: 'zh' - field '.*\.ko-.*', type: 'string*', locale: 'ko' - field '.*\.th-.*', type: 'string*', locale: 'th' - field '.*\.el-.*', type: 'string*', locale: 'el' - field '.*\.ru-.*', type: 'string*', locale: 'ru' - field '.*\.sr-.*', type: 'string*', locale: 'sr' - field '.*\.uk-.*', type: 'string*', locale: 'uk' - field '.*\.be-.*', type: 'string*', locale: 'be' end private