Merge remote-tracking branch 'parent/main' into kb_migration

This commit is contained in:
KMY 2023-08-29 13:25:48 +09:00
commit 05a022448b
22 changed files with 306 additions and 209 deletions

View file

@ -31,12 +31,13 @@ class AccountsIndex < Chewy::Index
analyzer: {
natural: {
tokenizer: 'uax_url_email',
tokenizer: 'standard',
filter: %w(
english_possessive_stemmer
lowercase
asciifolding
cjk_width
elision
english_possessive_stemmer
english_stop
english_stemmer
),
@ -52,7 +53,7 @@ class AccountsIndex < Chewy::Index
},
verbatim: {
tokenizer: 'standard',
tokenizer: 'uax_url_email',
filter: %w(lowercase asciifolding cjk_width),
},

View file

@ -20,13 +20,19 @@ class PublicStatusesIndex < Chewy::Index
},
analyzer: {
content: {
verbatim: {
tokenizer: 'uax_url_email',
filter: %w(lowercase),
},
content: {
tokenizer: 'standard',
filter: %w(
english_possessive_stemmer
lowercase
asciifolding
cjk_width
elision
english_possessive_stemmer
english_stop
english_stemmer
),
@ -101,7 +107,7 @@ class PublicStatusesIndex < Chewy::Index
.includes(:media_attachments, :preloadable_poll, :preview_cards)
root date_detection: false do
field(:id, type: 'keyword')
field(:id, type: 'long')
field(:account_id, type: 'long')
field(:text, type: 'text', analyzer: 'sudachi_analyzer', value: ->(status) { status.searchable_text }) { field(:stemmed, type: 'text', analyzer: 'content') }
field(:language, type: 'keyword')

View file

@ -19,13 +19,19 @@ class StatusesIndex < Chewy::Index
},
},
analyzer: {
content: {
verbatim: {
tokenizer: 'uax_url_email',
filter: %w(lowercase),
},
content: {
tokenizer: 'standard',
filter: %w(
english_possessive_stemmer
lowercase
asciifolding
cjk_width
elision
english_possessive_stemmer
english_stop
english_stemmer
),
@ -133,7 +139,7 @@ class StatusesIndex < Chewy::Index
end
root date_detection: false do
field(:id, type: 'keyword')
field(:id, type: 'long')
field(:account_id, type: 'long')
field(:text, type: 'text', analyzer: 'sudachi_analyzer', value: ->(status) { status.searchable_text }) { field(:stemmed, type: 'text', analyzer: 'content') }
field(:searchable_by, type: 'long', value: ->(status, crutches) { status.searchable_by(crutches) })