|
|
@ -37,15 +37,26 @@ class StatusesIndex < Chewy::Index
|
|
|
|
english_stemmer
|
|
|
|
english_stemmer
|
|
|
|
),
|
|
|
|
),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
hashtag: {
|
|
|
|
|
|
|
|
tokenizer: 'keyword',
|
|
|
|
|
|
|
|
filter: %w(
|
|
|
|
|
|
|
|
word_delimiter_graph
|
|
|
|
|
|
|
|
lowercase
|
|
|
|
|
|
|
|
asciifolding
|
|
|
|
|
|
|
|
cjk_width
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
index_scope ::Status.unscoped.kept.without_reblogs.includes(:media_attachments, :preview_cards, :local_mentioned, :local_favorited, :local_reblogged, :local_bookmarked, preloadable_poll: :local_voters), delete_if: ->(status) { status.searchable_by.empty? }
|
|
|
|
index_scope ::Status.unscoped.kept.without_reblogs.includes(:media_attachments, :preview_cards, :local_mentioned, :local_favorited, :local_reblogged, :local_bookmarked, :tags, preloadable_poll: :local_voters), delete_if: ->(status) { status.searchable_by.empty? }
|
|
|
|
|
|
|
|
|
|
|
|
root date_detection: false do
|
|
|
|
root date_detection: false do
|
|
|
|
field(:id, type: 'long')
|
|
|
|
field(:id, type: 'long')
|
|
|
|
field(:account_id, type: 'long')
|
|
|
|
field(:account_id, type: 'long')
|
|
|
|
field(:text, type: 'text', analyzer: 'verbatim', value: ->(status) { status.searchable_text }) { field(:stemmed, type: 'text', analyzer: 'content') }
|
|
|
|
field(:text, type: 'text', analyzer: 'verbatim', value: ->(status) { status.searchable_text }) { field(:stemmed, type: 'text', analyzer: 'content') }
|
|
|
|
|
|
|
|
field(:tags, type: 'text', analyzer: 'hashtag', value: ->(status) { status.tags.map(&:display_name) })
|
|
|
|
field(:searchable_by, type: 'long', value: ->(status) { status.searchable_by })
|
|
|
|
field(:searchable_by, type: 'long', value: ->(status) { status.searchable_by })
|
|
|
|
field(:language, type: 'keyword')
|
|
|
|
field(:language, type: 'keyword')
|
|
|
|
field(:properties, type: 'keyword', value: ->(status) { status.searchable_properties })
|
|
|
|
field(:properties, type: 'keyword', value: ->(status) { status.searchable_properties })
|
|
|
|