Skip to content

Commit

Permalink
Move localized fields to Media index
Browse files Browse the repository at this point in the history
  • Loading branch information
NuckChorris committed Oct 19, 2024
1 parent ce73fa7 commit 317e631
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
12 changes: 12 additions & 0 deletions app/indices/concerns/typesense_media_index.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
12 changes: 0 additions & 12 deletions app/indices/typesense_base_index.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 317e631

Please sign in to comment.