This repository was archived by the owner on Mar 19, 2019. It is now read-only.
Open
Conversation
* Add extentions pg_trgm, unaccent, btree_gin repectively for trigram fuzzy search, unaccenting strings and using gin index. * Add column tokens TSVECTOR to alias table to add tokenized names. * Add view master_entities to extract all the master entities. * Add materialized view search_mv holding all the search relevant information about master entities. * Add materialized view search_words_mv for all unique tokens (used to suggest the next best query). * Index fts_search_idx on materialized view search_mv column tokens to for quick FTS. * Add view untokenized_names holding all master entities with empty tokens, signifying unsupported names by to_tsvector. * Index untokenized_names_idx on materialized view search_mv column names to aid quick view untokenized_names query. * Unique indexes on search_mv and search_words_mv to aid REFRESH CONCURRENTLY command.
* Add function token_creator to tokenized name and enter it as token field in
alias table
* Add function refresh_mv which refreshes all materialized views linked with
FTS - search_mv and search_words_mv
* Add triggers for insert/update on each entity_header to call the refresh_mv
function each time a new entity is inserted or updated (master revision).
* Add trigger for insert on alias to call function token_creator.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Migration script for making necessary changes to support Postgres FTS.
@LordSputnik Open for review.