Commit 2e227d8b authored by Matija Obreza's avatar Matija Obreza

SGSV is a term

parent fb72d8f7
......@@ -180,16 +180,6 @@ public class ElasticsearchSearchServiceImpl implements ElasticService, Initializ
if (FilterConstants.ALIAS.equals(key)) {
// Nested
orFilter.add(FilterBuilders.nestedFilter("aliases", QueryBuilders.queryString("aliases.name" + ":(" + sb.toString() + ")")));
} else if (FilterConstants.SGSV.equals(key)) {
// Check if exists
if (filterValues.contains(true)) {
// true:
orFilter.add(FilterBuilders.notFilter(FilterBuilders.missingFilter(FilterConstants.SGSV)));
}
if (filterValues.contains(false)) {
// false:
orFilter.add(FilterBuilders.missingFilter(FilterConstants.SGSV));
}
} else {
orFilter.add(FilterBuilders.queryFilter(QueryBuilders.queryString(key + ":(" + sb.toString() + ")")));
}
......@@ -210,6 +200,16 @@ public class ElasticsearchSearchServiceImpl implements ElasticService, Initializ
if (!instCodes.isEmpty()) {
orFilter.add(FilterBuilders.termsFilter(FilterConstants.INSTCODE, instCodes).execution("or"));
}
} else if (FilterConstants.SGSV.equals(key)) {
// Check if exists
if (filterValues.contains(new LiteralValueFilter(true))) {
// true:
orFilter.add(FilterBuilders.notFilter(FilterBuilders.missingFilter(FilterConstants.SGSV)));
}
if (filterValues.contains(new LiteralValueFilter(false))) {
// false:
orFilter.add(FilterBuilders.missingFilter(FilterConstants.SGSV));
}
} else {
orFilter.add(FilterBuilders.termsFilter(key, literals).execution("or"));
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment