Search in sources :

Example 1 with ExplicitTextSearch

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);
}
Also used : QueryFilter(org.locationtech.geowave.core.store.query.filter.QueryFilter) ExpressionQueryFilter(org.locationtech.geowave.core.store.query.filter.ExpressionQueryFilter) ExplicitTextSearch(org.locationtech.geowave.core.index.text.ExplicitTextSearch) IndexFilter(org.locationtech.geowave.core.store.index.IndexFilter) QueryFilter(org.locationtech.geowave.core.store.query.filter.QueryFilter) Filter(org.locationtech.geowave.core.store.query.filter.expression.Filter) ExpressionQueryFilter(org.locationtech.geowave.core.store.query.filter.ExpressionQueryFilter) List(java.util.List) ExpressionQueryFilter(org.locationtech.geowave.core.store.query.filter.ExpressionQueryFilter) CustomIndex(org.locationtech.geowave.core.store.index.CustomIndex)

Aggregations

List (java.util.List)1 ExplicitTextSearch (org.locationtech.geowave.core.index.text.ExplicitTextSearch)1 CustomIndex (org.locationtech.geowave.core.store.index.CustomIndex)1 IndexFilter (org.locationtech.geowave.core.store.index.IndexFilter)1 ExpressionQueryFilter (org.locationtech.geowave.core.store.query.filter.ExpressionQueryFilter)1 QueryFilter (org.locationtech.geowave.core.store.query.filter.QueryFilter)1 Filter (org.locationtech.geowave.core.store.query.filter.expression.Filter)1