Skip to content

Commit

Permalink
refactor term_filter with generate_dsl, re #11477
Browse files Browse the repository at this point in the history
  • Loading branch information
whatisgalen committed Sep 20, 2024
1 parent bf9b8e1 commit 1d61adf
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions arches/app/search/components/term_filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@


class TermFilter(BaseSearchFilter):
def append_dsl(self, search_query_object, **kwargs):

def generate_dsl(self, search_query_object, **kwargs):
permitted_nodegroups = kwargs.get("permitted_nodegroups")
include_provisional = kwargs.get("include_provisional")
search_query = Bool()
Expand Down Expand Up @@ -148,8 +149,11 @@ def append_dsl(self, search_query_object, **kwargs):
search_query.must_not(nested_conceptid_filter)
else:
search_query.filter(nested_conceptid_filter)
return search_query

search_query_object["query"].add_query(search_query)
def append_dsl(self, search_query_object, **kwargs):
dsl = self.generate_dsl(search_query_object, **kwargs)
search_query_object["query"].add_query(dsl)


def _get_child_concepts(conceptid):
Expand Down

0 comments on commit 1d61adf

Please sign in to comment.