diff options
author | Claire <claire.github-309c@sitedethib.com> | 2022-03-28 01:17:17 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-28 01:17:17 +0200 |
commit | 2c45859ca9076c0b9916922e0be21ff83fc3b143 (patch) | |
tree | 475166829989e56d1327959878a4e1fdd8c6a6b8 /app/chewy | |
parent | e6a159a64869927cca5535943cdf3a280aeb5394 (diff) |
Refactor account and status formatting (#17877)
* Refactor status formatting * Add account formatting helpers * Remove StatusFormatter * Fixup * Fix copied typo
Diffstat (limited to 'app/chewy')
-rw-r--r-- | app/chewy/statuses_index.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/app/chewy/statuses_index.rb b/app/chewy/statuses_index.rb index d119f7cac..bfd61a048 100644 --- a/app/chewy/statuses_index.rb +++ b/app/chewy/statuses_index.rb @@ -1,6 +1,8 @@ # frozen_string_literal: true class StatusesIndex < Chewy::Index + include FormattingHelper + settings index: { refresh_interval: '15m' }, analysis: { filter: { english_stop: { @@ -57,7 +59,7 @@ class StatusesIndex < Chewy::Index field :id, type: 'long' field :account_id, type: 'long' - field :text, type: 'text', value: ->(status) { [status.spoiler_text, PlainTextFormatter.new(status.text, status.local?).to_s].concat(status.ordered_media_attachments.map(&:description)).concat(status.preloadable_poll ? status.preloadable_poll.options : []).join("\n\n") } do + field :text, type: 'text', value: ->(status) { [status.spoiler_text, extract_status_plain_text(status)].concat(status.ordered_media_attachments.map(&:description)).concat(status.preloadable_poll ? status.preloadable_poll.options : []).join("\n\n") } do field :stemmed, type: 'text', analyzer: 'content' end |