Skip to content

Commit

Permalink
The table is not inferred automatically somehow (hitobito#2674)
Browse files Browse the repository at this point in the history
  • Loading branch information
kronn authored Jun 11, 2024
1 parent 2e34ad3 commit 1f4fddc
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
9 changes: 8 additions & 1 deletion app/indices/group_index.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,13 @@ module GroupIndex; end
ThinkingSphinx::Index.define_partial :group do
indexes name, short_name, sortable: true
indexes email, zip_code, town, country
indexes address_care_of, street, housenumber, postbox

# Somehow, these 4 columns are not recognized automatically
indexes "#{Group.table_name}.address_care_of", as: :address_care_of
indexes "#{Group.table_name}.street", as: :street
indexes "#{Group.table_name}.housenumber", as: :housenumber
indexes "#{Group.table_name}.postbox", as: :postbox

indexes address # TODO: remove when cleaning structured_addresses migration

indexes parent.name, as: :parent_name
Expand All @@ -17,5 +23,6 @@ module GroupIndex; end
indexes social_accounts.name, as: :social_account
indexes additional_emails.email, as: :additional_email

# this is inserted verbatim and not auto-quoted
where "#{Group.quoted_table_name}.deleted_at IS NULL"
end
8 changes: 7 additions & 1 deletion app/indices/person_index.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,13 @@ module PersonIndex; end

ThinkingSphinx::Index.define_partial :person do
indexes first_name, last_name, company_name, nickname, company, email, sortable: true
indexes address_care_of, street, housenumber, postbox

# Somehow, these 4 columns are not recognized automatically
indexes "#{Person.table_name}.address_care_of", as: :address_care_of
indexes "#{Person.table_name}.street", as: :street
indexes "#{Person.table_name}.housenumber", as: :housenumber
indexes "#{Person.table_name}.postbox", as: :postbox

indexes address # TODO: remove when cleaning structured_addresses migration
indexes zip_code, town, country, additional_information

Expand Down

0 comments on commit 1f4fddc

Please sign in to comment.