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
Describe the bug A clear and concise description of what the bug is.
Currently, the "CONTAIN" filter condition is not supported in Search, because the getQueryBuilderFromCriterion in SearchUtils class explicitly does not support it.
final Condition condition = criterion.getCondition();
if (condition == Condition.EQUAL) {
if (criterion.getValue().startsWith("urn:li:")) {
return QueryBuilders.termsQuery(criterion.getField(), criterion.getValue().trim());
}
return QueryBuilders.termsQuery(criterion.getField(), criterion.getValue().trim().split("\\s*,\\s*"));
} else if (condition == Condition.GREATER_THAN) {
return QueryBuilders.rangeQuery(criterion.getField()).gt(criterion.getValue().trim());
} else if (condition == Condition.GREATER_THAN_OR_EQUAL_TO) {
return QueryBuilders.rangeQuery(criterion.getField()).gte(criterion.getValue().trim());
} else if (condition == Condition.LESS_THAN) {
return QueryBuilders.rangeQuery(criterion.getField()).lt(criterion.getValue().trim());
} else if (condition == Condition.LESS_THAN_OR_EQUAL_TO) {
return QueryBuilders.rangeQuery(criterion.getField()).lte(criterion.getValue().trim());
}
throw new UnsupportedOperationException("Unsupported condition: " + condition);
}```
(even though it exists in the Filter Condition enum.
#### To Reproduce
Steps to reproduce the behavior:
1. Deploy DataHub
2. Issue a Search Query with a specific "filter" criteria that has the condition "CONTAIN". You'll see a server error returned.
![image](https://user-images.githubusercontent.com/17549204/125294210-efdd4080-e2d8-11eb-8a0d-143f87c93453.png)
#### Expected behavior
Contains operator should work for substring of string fields.
As reported by Lal Rishav at Saxo Bank!
#### Screenshots If applicable, add screenshots to help explain your problem.
#### Desktop (please complete the following information):
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]
#### Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered:
Describe the bug A clear and concise description of what the bug is.
Currently, the "CONTAIN" filter condition is not supported in Search, because the
getQueryBuilderFromCriterion
inSearchUtils
class explicitly does not support it.The text was updated successfully, but these errors were encountered: