Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

non-schedule_a and non-schedule_b tables: Update .*_text columns for tables with new tsvector #3836

Closed
jason-upchurch opened this issue Jun 26, 2019 · 3 comments
Assignees
Milestone

Comments

@jason-upchurch
Copy link
Contributor

jason-upchurch commented Jun 26, 2019

Summary

Throughout the db, former TSVECTOR columns that were generated upon insert to a VARCHAR column used the default to_tsvector(<argument>), however, to make searching more predictable, the function was updated with an inner function argument to split on and strip nonword characters as:

to_tsvector(regexp_replace(<argument>, '[^a-zA-Z0-9]', ' ', 'g'))

The above was added to migration files under PR #3811 to handle future inserts.

The historical db data also needs to be updated/refreshed to use the new to_tsvector definition.

The tables are:

affected table column is_fixed commit
fec_fitem_sched_b recipient_name_text T b5e14b5
fec_fitem_sched_b disbursement_description_text T 7761a2c
fec_fitem_sched_f payee_name_text T 7506c4e
fec_fitem_sched_a contributor_name_text T c679150
fec_fitem_sched_a contributor_employer_text T c679150
fec_fitem_sched_a contributor_occupation_text T c679150
fec_fitem_sched_c loan_source_name_text T a277d8d
fec_fitem_sched_c candidate_name_text T a277d8d
fec_fitem_sched_d creditor_debtor_name_text T 0363e40

The migration file handling this update is V0142__update_to_tsvector_function_over_all_columns.sql

@jason-upchurch jason-upchurch added this to the Sprint 9.4 milestone Jun 26, 2019
@lbeaufort lbeaufort changed the title Repopulate .*_text columns for tables, mvs, and vws with new tsvector Repopulate .*_text columns for tables with new tsvector Jun 27, 2019
@dorothyyeager dorothyyeager modified the milestones: Sprint 9.4, Sprint 9.5 Jul 2, 2019
@patphongs patphongs changed the title Repopulate .*_text columns for tables with new tsvector non-schedule_a and non-schedule_b tables: Repopulate .*_text columns for tables with new tsvector Jul 16, 2019
@patphongs patphongs changed the title non-schedule_a and non-schedule_b tables: Repopulate .*_text columns for tables with new tsvector non-schedule_a and non-schedule_b tables: Update .*_text columns for tables with new tsvector Jul 16, 2019
@fecjjeng
Copy link
Contributor

tsvector columns in fec_fitem_sched_a and fec_fitem_sched_b tables had been updated according to the new definition in issue #3787
tsvector columns in fec_fitem_sched_c, fec_fitem_sched_d, and fec_fitem_sched_f have been updated in all cloud environments (DEV/STG/PRD). @jason-upchurch It is ready for you to check if the desired changes is in place.

@jason-upchurch
Copy link
Contributor Author

@fecjjeng thank you so much for making this change! It looks great! 🎉

@fecjjeng
Copy link
Contributor

Database work done. No PR needed. Closed ticket.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants