Skip to content
This repository has been archived by the owner on Apr 4, 2023. It is now read-only.

Add an initial Postgres backend for search #82

Merged
merged 9 commits into from
Aug 10, 2017
Merged

Add an initial Postgres backend for search #82

merged 9 commits into from
Aug 10, 2017

Conversation

cmc333333
Copy link
Member

@cmc333333 cmc333333 commented Aug 4, 2017

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 :)

@coveralls
Copy link

Coverage Status

Coverage increased (+0.3%) to 93.601% when pulling 7504867 on 475-pgsql into 63a9b91 on master.

@cmc333333 cmc333333 force-pushed the 475-pgsql branch 2 times, most recently from be96e15 to 311e1c9 Compare August 8, 2017 14:06
@coveralls
Copy link

Coverage Status

Coverage increased (+0.3%) to 93.643% when pulling 311e1c9 on 475-pgsql into 63a9b91 on master.

Copy link
Contributor

@tadhg-ohiggins tadhg-ohiggins left a 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.

@cmc333333
Copy link
Member Author

Thanks @tadhg-ohiggins! I'll rebase and then merge after tests run

CM Lubinski added 9 commits August 10, 2017 09:54
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
@coveralls
Copy link

Coverage Status

Coverage increased (+0.2%) to 93.643% when pulling 485ecad on 475-pgsql into c4e7404 on master.

@cmc333333 cmc333333 merged commit 02522aa into master Aug 10, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants