Skip to content
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

11477 refactor append dsl #11481

Draft
wants to merge 14 commits into
base: dev/8.0.x
Choose a base branch
from
Draft

Conversation

whatisgalen
Copy link
Member

@whatisgalen whatisgalen commented Sep 20, 2024

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Description of Change

The append_dsl method on search filter classes has been used historically to both evaluate search logic and create Elasticsearch DSL query objects, as well as mutate the central Query object. This PR divorces the functionality into two methods: the latter remains in append_dsl but the former now lives in generate_dsl methods to create the dsl first. This creates an intermediate point where custom indexes can hook into the search filter, examine dsl = self.generate_dsl() and mutate this before it gets added to search_query_object["query"].

Additionaly, because the search-results filter was applying a policy-type of logic, this was moved into its own search filter named permitted_graphs_policy with an accompanying migration.

Issues Solved

Closes #11477

Checklist

  • I targeted one of these branches:

    • dev/8.0.x (under development): features, bugfixes not covered below
    • dev/7.6.x (under development): features, bugfixes not covered below
  • I added a changelog in arches/releases

  • I submitted a PR to arches-docs (if appropriate)

  • Unit tests pass locally with my changes

  • I added tests that prove my fix is effective or that my feature works

  • My test fails on the target branch

Accessibility Checklist

Developer Guide

Topic Changed Retested
Color contrast
Form fields
Headings
Links
Keyboard
Responsive Design
HTML validation
Screen reader

Ticket Background

  • Sponsored by:
  • Found by: @
  • Tested by: @
  • Designed by: @

Further comments

@whatisgalen whatisgalen linked an issue Sep 20, 2024 that may be closed by this pull request
2 tasks
@whatisgalen whatisgalen marked this pull request as draft October 28, 2024 00:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Refactor search filters
1 participant