This repository has been archived by the owner on Apr 4, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 27
Add an initial Postgres backend for search #82
Merged
Conversation
This file contains 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
cmc333333
force-pushed
the
475-pgsql
branch
2 times, most recently
from
August 8, 2017 14:06
be96e15
to
311e1c9
Compare
tadhg-ohiggins
approved these changes
Aug 10, 2017
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work—this review brought to you by the letters F and Q.
Thanks @tadhg-ohiggins! I'll rebase and then merge after tests run |
Given a user's search request, we need to query Postgres' vector-based search index. With the results, we then need to convert to the JSON format users of the endpoint expect.
When users search, they provide a document id ("regulation") and a version. We had not been able to filter by thus document id as that data's not a separate field. While it may make more sense to store this with the documents, in the short term, we can store it in the search index.
Also adds model_mommy for mocking data, which, in turn, requires the contenttypes app be included.
The pgsql tests require `regcore_pgsql` be one of the installed apps. As we don't have that configuration in each test environment (at least, at the moment), specify which packages to test based on whether or not pgsql is part of the environment.
Breaking Changes * #79 "django.contrib.contenttypes" is now included in library's base settings. If copying these over, you'll need to deduplicate. New Features * #79 Allow search handler to be defined via `SEARCH_HANDLER` setting * #83 Allow search results page size to be requested * #82 Add Postgres backend for search. See README for details. Misc * #77 Allow ALLOWED_HOSTS to be set via env vars * #78 Use webargs library for checking search input * #80 Test different backends in different tox envs * #81 Remove QuantifiedCode badge
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.
This adds search views and a search-index-building management command for populating a Postgres-backed, section-specific search. It builds off #80, #81, and #83, which make the diff more daunting than it should be. The bulk of the new lines are also tests :)