if (map==Mapping.STRING && titanPredicate.toString().startsWith("CONTAINS"))
throw new IllegalArgumentException("String mapped string values do not support CONTAINS queries: " + titanPredicate);
if (titanPredicate == Text.CONTAINS) {
value = ((String) value).toLowerCase();
return new TermsFilter(new Term(key, (String) value));
} else if (titanPredicate == Text.CONTAINS_PREFIX) {
value = ((String) value).toLowerCase();
return new PrefixFilter(new Term(key, (String) value));
} else if (titanPredicate == Text.PREFIX) {
return new PrefixFilter(new Term(key, (String) value));
// } else if (titanPredicate == Text.CONTAINS_REGEX) {
// 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);