-
Notifications
You must be signed in to change notification settings - Fork 93
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
Registry records manager: Able to search record by keywords & records list #3480
Comments
Based on tests, full text search feature seems provide reasonable result (at the same level as GIN with
Index creation: CREATE INDEX idx_data_full_text ON recordaspects
USING GIN ((
to_tsvector('english', recordid) ||
to_tsvector('english', aspectid) ||
jsonb_to_tsvector('english', data, '["string"]')
)) Query would be similar to: select * from recordaspects where (
to_tsvector('english', recordid) ||
to_tsvector('english', aspectid) ||
jsonb_to_tsvector('english', data, '["string"]')
) @@ websearch_to_tsquery('english', 'my search keywords')
|
To make sure recordId & aspectId can be "exactly" matched via the full text search query API interface, we need to alter the index creation as: CREATE INDEX idx_data_full_text ON recordaspects
USING GIN (jsonb_to_tsvector('english'::regconfig, data, '["string"]')) And Search would be similar to : select * from recordaspects where (
jsonb_to_tsvector('english'::regconfig, data, '["string"]') @@ websearch_to_tsquery('english'::regconfig, 'my search keywords')
OR recordid = 'my search keywords'
OR aspectid = 'my search keywords'
) |
closed via #3485 |
Registry Records Manager: Able to search record by keywords & records list
To make the registry record manager more useful for people, we will need offer the basic keyword based searching functionality.
It should come with a record list and quick preview feature as well.
Technical notes:
pg_trgm
extension with Gin indexjsonb_to_tsvector
: can generate lexemes for values only (excluding keys)english
)The text was updated successfully, but these errors were encountered: