Skip to content

Commit

Permalink
Revert "Add new publicly_searchable attribute to status index (#6)"
Browse files Browse the repository at this point in the history
This reverts commit 4bc96aa.
  • Loading branch information
jsgoldstein authored Jul 27, 2023
1 parent 34a26ce commit f9e674d
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 29 deletions.
11 changes: 5 additions & 6 deletions app/chewy/statuses_index.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,13 @@ class StatusesIndex < Chewy::Index
end

root date_detection: false do
field(:id, type: 'long')
field(:account_id, type: 'long')
field :id, type: 'long'
field :account_id, type: 'long'

field(:text, type: 'text', value: ->(status) { status.searchable_text }) do
field(:stemmed, type: 'text', analyzer: 'content')
field :text, type: 'text', value: ->(status) { status.searchable_text } do
field :stemmed, type: 'text', analyzer: 'content'
end

field(:searchable_by, type: 'long', value: ->(status, crutches) { status.searchable_by(crutches) })
field(:publicly_searchable, type: 'boolean', value: ->(status) { status.publicly_searchable? })
field :searchable_by, type: 'long', value: ->(status, crutches) { status.searchable_by(crutches) }
end
end
2 changes: 0 additions & 2 deletions app/models/account.rb
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ class Account < ApplicationRecord
include DomainMaterializable
include AccountMerging
include AccountSearch
include AccountStatusesSearch

enum protocol: { ostatus: 0, activitypub: 1 }
enum suspension_origin: { local: 0, remote: 1 }, _prefix: true
Expand Down Expand Up @@ -132,7 +131,6 @@ class Account < ApplicationRecord
scope :not_domain_blocked_by_account, ->(account) { where(arel_table[:domain].eq(nil).or(arel_table[:domain].not_in(account.excluded_from_timeline_domains))) }

after_update_commit :trigger_update_webhooks
after_update :update_statuses_index!, if: :saved_change_to_discoverable? and Chewy.enabled?

delegate :email,
:unconfirmed_email,
Expand Down
11 changes: 0 additions & 11 deletions app/models/concerns/account_statuses_search.rb

This file was deleted.

9 changes: 0 additions & 9 deletions app/models/concerns/status_search.rb

This file was deleted.

1 change: 0 additions & 1 deletion app/models/status.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ class Status < ApplicationRecord
include StatusSnapshotConcern
include RateLimitable
include StatusSafeReblogInsert
include StatusSearch

rate_limit by: :account, family: :statuses

Expand Down

0 comments on commit f9e674d

Please sign in to comment.