diff --git a/app/indices/group_index.rb b/app/indices/group_index.rb index 432d5f3f11..16d87aca00 100644 --- a/app/indices/group_index.rb +++ b/app/indices/group_index.rb @@ -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 @@ -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 diff --git a/app/indices/person_index.rb b/app/indices/person_index.rb index 2ffbff7b26..35a8dfd513 100644 --- a/app/indices/person_index.rb +++ b/app/indices/person_index.rb @@ -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