scoped_search icon indicating copy to clipboard operation
scoped_search copied to clipboard

Add enhanced filter to autocomplete

Open Thorben-D opened this issue 8 months ago • 0 comments

This PR adds a new field, enhanced_filter to AutoCompleteBuilder. enhanced_filter takes the following arguments:

  • has_column - Name of the required column
  • filter - Predicate used for filtering

Iff in the table to be filtered, there exists a column <has_column>, the filter will be executed.

Consider the following example: image

Let's say the table Food is populated with a green apple and a red pepper. If I want to filter for green food, I would do value_filter: {color_id: <green_id>}. This works as long as a user doesn't try to filter this by type = . In that case, value_filter will be applied to the table Type, which doesn't have a color_id column, causing an exception. enhanced_filter prevents this by first checking for the existence of the required column before filtering.

Thorben-D avatar Jun 05 '24 09:06 Thorben-D