-
Notifications
You must be signed in to change notification settings - Fork 4
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
Add filters to the search function #3074
Comments
I did some investigation to figure out what names can be passed in as filters In the default frontend, these are the allowed filter fields:
Note ENTITY_SUB_TYPE_FILTER_NAME is a special case, where two filters on the backend are presented as one on the frontend. In the query parameter the two fields are encoded using 0x1e record separator characters, and then these are converted into two combined filters by the generateInputWithNestedFilters function. Presumably any field that is part of the elasticsearch document structure can be used. From slack I got an example of a customProperty filter. This includes the customer property key as part of the value: If we just want to filter on the existence of a customProperty, then we can pass the custom property key as the value instead: https://datahubproject.io/docs/how/search#graphql:~:text=Find%20a%20dataset%20with%20a%20property%2C%20encoding Based on this, I've allowed passing in domains, tags, and customProperties as valid filters. Anything else will be rejected. Note that the domains value is a list of IDs, so we need to know the IDs of each domain. |
Context
We have a UI component for filters from https://design-patterns.service.justice.gov.uk/components/filter/
Currently we are just showing the example and it doesn't do anything. So we should make it possible to apply the filters when calling the search method of the catalogue client.
In scope
Out of scope for now
The text was updated successfully, but these errors were encountered: