use of org.locationtech.geowave.core.index.text.ExplicitTextSearch in project geowave by locationtech.
the class OptimalExpressionQuery method createQueryConstraints.
@SuppressWarnings({ "unchecked", "rawtypes" })
@Override
public QueryConstraints createQueryConstraints(final InternalDataAdapter<?> adapter, final Index index, final AdapterToIndexMapping indexMapping) {
if (!constraintCache.containsKey(adapter.getTypeName())) {
filter.prepare(adapter, indexMapping, index);
return new FilteredEverythingQuery(Lists.newArrayList(new ExpressionQueryFilter<>(filter, adapter, indexMapping)));
}
final Filter reduced = filter.removePredicatesForFields(constraintCache.get(adapter.getTypeName()).getExactConstrainedFields());
final List<QueryFilter> filterList;
if (reduced != null) {
reduced.prepare(adapter, indexMapping, index);
filterList = Lists.newArrayList(new ExpressionQueryFilter<>(reduced, adapter, indexMapping));
} else {
filterList = Lists.newArrayList();
}
if (index instanceof CustomIndex) {
return new CustomQueryConstraints(new ExplicitTextSearch((List) constraintCache.get(adapter.getTypeName()).getIndexData()), filterList);
}
return new ExplicitFilteredQuery((List) constraintCache.get(adapter.getTypeName()).getIndexData(), filterList);
}
Aggregations