You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We want to be able to query the catalogue based on specific attributes existing in the DDO. Example: list only DDOs that have a Gaia-X service credential connected.
Solution
We need a new filter function that allows dynamically adding these filters via the filters.config.js file. Something like:
{filters: [// move existing filter config into this file, so it is all in one location{id: 'serviceType',label: 'Service Type',type: 'filterList',// add a "global" query path that gets used as fallback if options have none definedqueryPath: 'metadata.type',options: [{label: 'datasets',value: FilterByTypeOptions.Data},{label: 'algorithms',value: FilterByTypeOptions.Algorithm},{label: 'saas',value: FilterByTypeOptions.Saas}]},{id: 'gaiax',label: 'Gaia-X Service',type: 'filterList',options: [// a new filter value for a MUST_EXIST type could be added to handle this new functionality{label: "Service SD",value: FilterValues.MUST_EXIST,queryPath: "additionalInformation.gaiaXInformation.serviceSd.url"},// options can have their own queryPath defined that gets validated against the defined value{label: "Terms and Conditions",value: true,queryPath: "additionalInformation.gaiaXInformation.termsAndConditions"}// options can have their own queryPath defined that gets validated against the defined value{label: "Verified",value: true,queryPath: "additionalInformation.gaiaXInformation.serviceSd.isValid"}]}]}
It is probably necessary to wrap the src/utils/aquarius/index.ts:getFilterTerm() function in a new getFilter() fucntion and then decide based on the value to filter for what to generate, e.g. (pseudo-code):
var filter {}
if value is MUST_EXIST or MUST_EXIST_AND_NON_EMPTY:
filter = {...filter, bool: { ...filter.bool, ...getMustExistQuery(field) } }
if value is MUST_EXIST_AND_NON_EMPTY:
filter = {...filter, bool: { ...filter.bool, ...getNotEmptyQuery(field) } }
// check other potential pre-defined values
else:
filter = getFilterTerm(field, value, key)
The text was updated successfully, but these errors were encountered:
Motivation / Problem
We want to be able to query the catalogue based on specific attributes existing in the DDO. Example: list only DDOs that have a Gaia-X service credential connected.
Solution
We need a new filter function that allows dynamically adding these filters via the
filters.config.js
file. Something like:Additional context
We will need to handle filters based on the
value
that should be checked. In cases where the value is any user defined string, such as specific tags or search queries, we want to use the existing filter approach: https://www.elastic.co/guide/en/elasticsearch/reference/current/query-filter-context.html#filter-contextWhen handling the to be added
MUST_EXIST
filters, we need to change to a elasticsearchbool
context, viaexists
:https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-exists-query.html
Example query:
It is probably necessary to wrap the
src/utils/aquarius/index.ts:getFilterTerm()
function in a newgetFilter()
fucntion and then decide based on thevalue
to filter for what to generate, e.g. (pseudo-code):The text was updated successfully, but these errors were encountered: