Explicit ES import when AP status or account is created or updated
This commit is contained in:
parent
98c9bc52c0
commit
87b5f7f485
5 changed files with 9 additions and 2 deletions
|
@ -85,6 +85,8 @@ class ActivityPub::Activity::Create < ActivityPub::Activity
|
||||||
attach_tags(@status)
|
attach_tags(@status)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
StatusesIndex.import! @status
|
||||||
|
|
||||||
resolve_thread(@status)
|
resolve_thread(@status)
|
||||||
fetch_replies(@status)
|
fetch_replies(@status)
|
||||||
distribute
|
distribute
|
||||||
|
|
|
@ -25,7 +25,8 @@ class Importer::StatusesIndexImporter < Importer::BaseImporter
|
||||||
# on the results of the filter, so this filtering happens here instead
|
# on the results of the filter, so this filtering happens here instead
|
||||||
bulk.map! do |entry|
|
bulk.map! do |entry|
|
||||||
new_entry = begin
|
new_entry = begin
|
||||||
if entry[:index] && entry.dig(:index, :data, 'searchable_by').blank?
|
if entry[:index] && entry.dig(:index, :data, 'searchable_by').blank? &&
|
||||||
|
Rails.configuration.x.search_scope == :classic
|
||||||
{ delete: entry[:index].except(:data) }
|
{ delete: entry[:index].except(:data) }
|
||||||
else
|
else
|
||||||
entry
|
entry
|
||||||
|
|
|
@ -73,6 +73,8 @@ class ActivityPub::ProcessAccountService < BaseService
|
||||||
set_fetchable_attributes! unless @options[:only_key] || @account.suspended?
|
set_fetchable_attributes! unless @options[:only_key] || @account.suspended?
|
||||||
|
|
||||||
@account.save_with_optional_media!
|
@account.save_with_optional_media!
|
||||||
|
|
||||||
|
AccountsIndex.import! @account
|
||||||
end
|
end
|
||||||
|
|
||||||
def set_immediate_protocol_attributes!
|
def set_immediate_protocol_attributes!
|
||||||
|
|
|
@ -50,6 +50,8 @@ class ActivityPub::ProcessStatusUpdateService < BaseService
|
||||||
|
|
||||||
reset_preview_card!
|
reset_preview_card!
|
||||||
broadcast_updates!
|
broadcast_updates!
|
||||||
|
|
||||||
|
StatusesIndex.import! @status
|
||||||
end
|
end
|
||||||
|
|
||||||
forward_activity! if significant_changes? && @status_parser.edited_at > last_edit_date
|
forward_activity! if significant_changes? && @status_parser.edited_at > last_edit_date
|
||||||
|
|
|
@ -40,7 +40,7 @@ class SearchService < BaseService
|
||||||
when :public
|
when :public
|
||||||
statuses_index = statuses_index.filter.or(term: { visibility: 'public' })
|
statuses_index = statuses_index.filter.or(term: { visibility: 'public' })
|
||||||
when :public_or_unlisted
|
when :public_or_unlisted
|
||||||
statuses_index = statuses_index.filter.or(term: { visibility: ['public', 'unlisted'] })
|
statuses_index = statuses_index.filter.or(terms: { visibility: ['public', 'unlisted'] })
|
||||||
end
|
end
|
||||||
definition = parsed_query.apply(statuses_index)
|
definition = parsed_query.apply(statuses_index)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue