Open bferguso opened 1 day ago
Just to add to this, from a high level:
the append_dsl
method on a search filter not only appends dsl to a query object, it generates the dsl according to the logic of the search filter. Given these two distinct functionalities and that the dsl is essentially immutable after it's added to the query object, we proposed that one method generate_dsl
be created for a search filter's logic, leaving the append_dsl
method to do what its name implies: check for custom index mapping hooks to further modify the dsl, then finally add the dsl to the main query object.
As part of the PR #10999 disucssion, the group identified that the search filter logic should be refactored, and the
es_mapping_modifier
hook be applied to all search filters, not just the search_term filter. Time constraints stopped these changes from targeting version 7.6.x so it was decided to target 8.0.x for these changes.Currently the
append_dsl
method does several things:es_mapping_modifier.add_search_filter
method if it is configuredsearch_query_object
It was determined that these 3 steps should be broken into separate methods within each search filter to allow individual parts of the logic to be overriden. Also, the
add_search_filter
call should be added to the remaining filters.High level tasks for this are:
es_mapping_modifier.add_search_filter
such that it has the conext from which it is being called (eg what filter type is calling it -term_filter
,time_filter
, etc)The PR should target version dev/8.0.x