providing combination of "and" / "or" search criteria option in glare
providing the combination of "and" / "or" search criteria option in glare for search query options in list-artifact API.
- Why do we want to add this feature? The drive to make the change:
Right now during API call of artifacts/
field_name=
during this approach, all the fields which are sent in the query are joined in database layer with the _and operator. Right now it is restricting a user to search based on _or operator.
- Solution: Providing an additional field in query parameter which will define operator.
With a new approach, we will be adding a third portion of the query parameter value to define the operation combiner. which will give the user an option to choose between _and / _or.
now the query parameter will look like this:
field_name=
To maintain backward compatibility in case of absence of last parameter (and/or) it will be considered as "and" by default.
- Impacts :
There will be changes required in glare-client to accommodate this feature.
Example:
So for an example sample_artifact available in the glare. which contains multiple fields such as "int1" , "link1" , "bool1", "str1". So if anybody wants to filter the data based on the below where clause: |
> where int1=5 and link1="http://
So for corresponding where clause corresponding queryParams in glare will be:
int1=eq:
Validation for values :
In case Filter values for any field has colon(":") as part of values it is mandatory to include operator, else it will be considered as invalid filter value and 400 Bad request will be thrown.
- Limitation :
Currently, this feature supports only one set of "OR" condition group. All the filter variables which are separated by or will be taken as a whole and validated.
Blueprint information
- Status:
- Complete
- Approver:
- Mike Fedosin
- Priority:
- Undefined
- Drafter:
- Kushal Agrawal
- Direction:
- Needs approval
- Assignee:
- Kushal Agrawal
- Definition:
- Review
- Series goal:
- Proposed for trunk
- Implementation:
-
Implemented
- Milestone target:
- None
- Started by
- Kushal Agrawal
- Completed by
- Kushal Agrawal
Related branches
Related bugs
Sprints
Whiteboard
Gerrit topic: https:/
Addressed by: https:/
and/or query combiner for filter options
Addressed by: https:/
and/or query combiner for filter options