Commit 6e0cf966 authored by Matija Obreza's avatar Matija Obreza
Browse files

Merge branch...

Merge branch '453-request-failed-when-user-try-apply-not-specified-filter-on-the-accession-browser-page' into 'master'

Resolve "Request failed when user try apply "Not specified" filter on the "Accession browser" page"

Closes #453

See merge request genesys-pgr/genesys-server!417
parents ec792cf9 8b8ba80d
......@@ -9,6 +9,7 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.querydsl.core.types.OperationImpl;
import org.elasticsearch.index.query.BoolQueryBuilder;
import org.elasticsearch.index.query.MatchQueryBuilder;
import org.elasticsearch.index.query.QueryBuilder;
......@@ -106,21 +107,32 @@ public class ElasticQueryBuilder implements Visitor<Void, Void> {
expr.accept(self, null);
}
} else if (operator == Ops.EQ || operator == Ops.IN) {
LOG.debug("EQUALS: {}", args);
for (Expression<?> expr : args) {
printExpression("EQUALS.. ", expr);
if (Path.class.isAssignableFrom(args.get(0).getClass())) {
LOG.debug("EQUALS: {}", args);
for (Expression<?> expr : args) {
printExpression("EQUALS.. ", expr);
}
Path<?> a0 = (Path<?>) args.get(0);
Expression<?> a1 = args.get(1);
handleEquals(a0, a1);
} else {
Path<?> path = (Path<?>)((OperationImpl) args.get(0)).getArg(0);
PathMetadata pmd = path.getMetadata();
mustNotClauses.add(existsQuery(customizedPath(pmd.getParent().toString() + "." + pmd.getName())));
}
Path<?> a0 = (Path<?>) args.get(0);
Expression<?> a1 = args.get(1);
handleEquals(a0, a1);
} else if (operator == Ops.LOE || operator == Ops.GOE || operator == Ops.BETWEEN || operator == Ops.LT || operator == Ops.GT) {
LOG.debug("Range: {}", args);
for (Expression<?> expr : args) {
printExpression("LOE.. ", expr);
if (Path.class.isAssignableFrom(args.get(0).getClass())) {
LOG.debug("Range: {}", args);
for (Expression<?> expr : args) {
printExpression("LOE.. ", expr);
}
Path<?> a0 = (Path<?>) args.get(0);
handleRange(operator, a0, args.get(1), args.size() > 2 ? args.get(2) : null);
} else {
Path<?> path = (Path<?>)((OperationImpl) args.get(0)).getArg(0);
PathMetadata pmd = path.getMetadata();
mustClauses.add(existsQuery(customizedPath(pmd.getParent().toString() + "." + pmd.getName())));
}
Path<?> a0 = (Path<?>) args.get(0);
handleRange(operator, a0, args.get(1), args.size() > 2 ? args.get(2) : null);
} else if (operator == Ops.STRING_CONTAINS || operator == Ops.STARTS_WITH) {
LOG.debug("{}: {}", operator, args);
for (Expression<?> expr : args) {
......@@ -145,7 +157,7 @@ public class ElasticQueryBuilder implements Visitor<Void, Void> {
Path<?> path = (Path<?>) args.get(0);
PathMetadata pmd = path.getMetadata();
mustClauses.add(existsQuery(customizedPath(pmd.getParent().toString() + "." + pmd.getName())));
} else if (operator == Ops.IS_NULL) {
} else if (operator == Ops.IS_NULL || operator == Ops.COL_IS_EMPTY) {
LOG.debug("{}: {}", operator, args);
for (Expression<?> expr : args) {
printExpression(operator + ".. ", expr);
......
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