diff --git a/app/lib/activitypub/activity/create.rb b/app/lib/activitypub/activity/create.rb index ebae129732..daf9fcf8e3 100644 --- a/app/lib/activitypub/activity/create.rb +++ b/app/lib/activitypub/activity/create.rb @@ -85,6 +85,8 @@ class ActivityPub::Activity::Create < ActivityPub::Activity attach_tags(@status) end + StatusesIndex.import! @status + resolve_thread(@status) fetch_replies(@status) distribute diff --git a/app/lib/importer/statuses_index_importer.rb b/app/lib/importer/statuses_index_importer.rb index fa11882a23..4bb1fd70ee 100644 --- a/app/lib/importer/statuses_index_importer.rb +++ b/app/lib/importer/statuses_index_importer.rb @@ -25,7 +25,8 @@ class Importer::StatusesIndexImporter < Importer::BaseImporter # on the results of the filter, so this filtering happens here instead bulk.map! do |entry| 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) } else entry diff --git a/app/services/activitypub/process_account_service.rb b/app/services/activitypub/process_account_service.rb index 99bcb38353..1c95b7055c 100644 --- a/app/services/activitypub/process_account_service.rb +++ b/app/services/activitypub/process_account_service.rb @@ -73,6 +73,8 @@ class ActivityPub::ProcessAccountService < BaseService set_fetchable_attributes! unless @options[:only_key] || @account.suspended? @account.save_with_optional_media! + + AccountsIndex.import! @account end def set_immediate_protocol_attributes! diff --git a/app/services/activitypub/process_status_update_service.rb b/app/services/activitypub/process_status_update_service.rb index a0605b1a3b..7cc307d072 100644 --- a/app/services/activitypub/process_status_update_service.rb +++ b/app/services/activitypub/process_status_update_service.rb @@ -50,6 +50,8 @@ class ActivityPub::ProcessStatusUpdateService < BaseService reset_preview_card! broadcast_updates! + + StatusesIndex.import! @status end forward_activity! if significant_changes? && @status_parser.edited_at > last_edit_date diff --git a/app/services/search_service.rb b/app/services/search_service.rb index bce0f2d6e9..a9ed121529 100644 --- a/app/services/search_service.rb +++ b/app/services/search_service.rb @@ -40,7 +40,7 @@ class SearchService < BaseService when :public statuses_index = statuses_index.filter.or(term: { visibility: 'public' }) 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 definition = parsed_query.apply(statuses_index)