-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
## Understandings - Model filtering `Filtered()` - is not working as expected (not 100%) - this is implemented per-field (we see 40+ filters instead of 5) - Indexed fields are not being inherited across models - At query generation not index time - Interim mappings on indexed fields are not necessary - Model field name is not treated consistently ## Tasks - [x] Wagtail update to 5.2 (LTS) - [x] Update SearchFields - #499 - [x] RenamedField mixin to match Wagtail PR understandings - [x] `model_field_name` usage needs to be rationalised - [x] `fields.py`/`index.py` review and agree where things belong (taking inheritance into account) - [x] Strip out field_mapping, and use each Model's indexed fields - #502 - [x] Remove from index time - [x] Remove from query building - [x] Remove all functions from SearchFields - [x] Refactor out IndexManager #504 - [x] Move functionality out of the `ModelIndexManager` and into `Indexed` - [x] Review `IndexManager`/`QueryBuilder` relationship - [x] `get_indexed_models` and `is_class_indexed` - [x] Add django-silk for local python profiling #508 - [x] Add Nested Query support and resolve field naming inconsistencies #507 - [x] Add a single place / way to handle various forms of field naming, including for nested - [x] Update all existing places in the code (inc. compiler) to use these new methods - [x] Get Nested Query building working inc with parent_field_name - [x] Search for `}.{` and review - [x] Add ability to override a search field from parent classes in `get_search_fields` and `get_indexed_fields` #512 - [x] `Filtered` DSL is working as expected - [x] QueryBuilder uses `get_indexed_fields` - [ ] Testing - [x] review xfailing tests - [x] review full test suite, writing new tests as needed - [x] write new smoke tests for all main eventualities - [ ] write new playwright e2e tests for main eventualities - [ ] write smoke tests to cover all expected indexing - e.g. Person.network etc - [x] Optimisations #513 - [ ] See if we can't simplify output from `Or` where could be simpler (ie with combine_queries) - [ ] Verify generated ES DSL to see if any obvious stuff there - [x] Look into resource usage to check bottlenecks - [x] output settings as dict - [x] pre-cache built queries - [x] cache expensive model traversal methods - [x] prewarm caches - [x] check everything is in the right file and the files are in the right folders - [x] review `@TODO` --------- Co-authored-by: Marcel Kornblum <[email protected]> Co-authored-by: marcelkornblum <[email protected]> Co-authored-by: Cameron Lamb <[email protected]>
- Loading branch information
1 parent
8407f04
commit de2bd9c
Showing
64 changed files
with
4,507 additions
and
2,211 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -108,3 +108,5 @@ FEEDBACK_NOTIFICATION_EMAIL_RECIPIENTS="[email protected]," | |
|
||
# Search | ||
SEARCH_SHOW_INACTIVE_PROFILES_WITHIN_DAYS=90 | ||
# Manage apllication caching | ||
SEARCH_ENABLE_QUERY_CACHE=False |
Validating CODEOWNERS rules …
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Uses CodeOwners to ensure the relevant Tech Lead sees any relevant PRs | ||
# | ||
|
||
# Search: Marcel | ||
/src/extended_search/ @marcelkornblum | ||
/src/search/ @marcelkornblum | ||
|
||
# PeopleFinder: Cam | ||
/src/peoplefinder @CamLamb |
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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -99,7 +99,7 @@ vine==5.0.0 ; python_version >= "3.11" and python_version < "4.0" | |
wagtail-adminsortable @ git+https://github.com/uktrade/[email protected] ; python_version >= "3.11" and python_version < "4.0" | ||
wagtail-draftail-anchors==0.6.0 ; python_version >= "3.11" and python_version < "4.0" | ||
wagtail-generic-chooser==0.6 ; python_version >= "3.11" and python_version < "4.0" | ||
wagtail==5.1.3 ; python_version >= "3.11" and python_version < "4.0" | ||
wagtail==5.2 ; python_version >= "3.11" and python_version < "4.0" | ||
wagtailmedia==0.14.4 ; python_version >= "3.11" and python_version < "4.0" | ||
wagtailmenus==3.1.9 ; python_version >= "3.11" and python_version < "4.0" | ||
waitress==2.1.2 ; python_version >= "3.11" and python_version < "4.0" | ||
|
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,15 @@ | ||
import factory | ||
import wagtail_factories | ||
|
||
from content.models import ContentPage | ||
from peoplefinder.test.factories import PersonFactory | ||
|
||
|
||
class ContentPageFactory(factory.Factory): | ||
class ContentPageFactory(wagtail_factories.PageFactory): | ||
class Meta: | ||
model = ContentPage | ||
|
||
|
||
class ContentOwnerFactoryMixin: | ||
content_owner = factory.SubFactory(PersonFactory) | ||
content_contact_email = factory.Faker("email") |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,22 @@ | ||
from django.apps import AppConfig | ||
from django.conf import settings | ||
from django.conf import settings as django_settings | ||
|
||
|
||
class ExtendedSearchConfig(AppConfig): | ||
name = "extended_search" | ||
|
||
def ready(self): | ||
import extended_search.signals # noqa | ||
from extended_search.settings import extended_search_settings as search_settings | ||
from extended_search import query_builder, settings | ||
from extended_search.index import get_indexed_models | ||
|
||
search_settings.initialise_field_dict() | ||
search_settings.initialise_env_dict() | ||
if settings.APP_ENV not in ["test", "build"]: | ||
search_settings.initialise_db_dict() | ||
settings.settings_singleton.initialise_field_dict() | ||
settings.settings_singleton.initialise_env_dict() | ||
if django_settings.APP_ENV not in ["test", "build"]: | ||
settings.settings_singleton.initialise_db_dict() | ||
settings.extended_search_settings = settings.settings_singleton.to_dict() | ||
query_builder.extended_search_settings = settings.extended_search_settings | ||
|
||
for model_class in get_indexed_models(): | ||
if hasattr(model_class, "indexed_fields") and model_class.indexed_fields: | ||
query_builder.CustomQueryBuilder.build_search_query(model_class, True) |
Oops, something went wrong.