// value = ((String) value).toLowerCase();
// return new RegexpQuery(new Term(key,(String)value));
} else if (titanPredicate == Cmp.EQUAL) {
return new TermsFilter(new Term(key,(String)value));
} else if (titanPredicate == Cmp.NOT_EQUAL) {
BooleanFilter q = new BooleanFilter();
q.add(new TermsFilter(new Term(key,(String)value)), BooleanClause.Occur.MUST_NOT);
return q;
} else
throw new IllegalArgumentException("Relation is not supported for string value: " + titanPredicate);
} else if (value instanceof Geoshape) {
Preconditions.checkArgument(titanPredicate == Geo.WITHIN, "Relation is not supported for geo value: " + titanPredicate);
Shape shape = ((Geoshape) value).convert2Spatial4j();
SpatialArgs args = new SpatialArgs(SpatialOperation.IsWithin, shape);
return getSpatialStrategy(key).makeFilter(args);
} else throw new IllegalArgumentException("Unsupported type: " + value);
} else if (condition instanceof Not) {
BooleanFilter q = new BooleanFilter();
q.add(convertQuery(((Not) condition).getChild(),informations), BooleanClause.Occur.MUST_NOT);
return q;
} else if (condition instanceof And) {
BooleanFilter q = new BooleanFilter();
for (Condition c : condition.getChildren()) {
q.add(convertQuery(c,informations), BooleanClause.Occur.MUST);
}
return q;
} else if (condition instanceof Or) {
BooleanFilter q = new BooleanFilter();
for (Condition c : condition.getChildren()) {
q.add(convertQuery(c,informations), BooleanClause.Occur.SHOULD);
}
return q;
} else throw new IllegalArgumentException("Invalid condition: " + condition);
}