summaryrefslogtreecommitdiffstats
path: root/common/datastorequery.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'common/datastorequery.cpp')
-rw-r--r--common/datastorequery.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/common/datastorequery.cpp b/common/datastorequery.cpp
index 34d2bae..0db59e1 100644
--- a/common/datastorequery.cpp
+++ b/common/datastorequery.cpp
@@ -152,7 +152,7 @@ public:
152 } 152 }
153}; 153};
154 154
155class Reduce : public FilterBase { 155class Reduce : public Filter {
156public: 156public:
157 typedef QSharedPointer<Reduce> Ptr; 157 typedef QSharedPointer<Reduce> Ptr;
158 158
@@ -198,7 +198,7 @@ public:
198 QList<Aggregator> mAggregators; 198 QList<Aggregator> mAggregators;
199 199
200 Reduce(const QByteArray &reductionProperty, const QByteArray &selectionProperty, QueryBase::Reduce::Selector::Comparator comparator, FilterBase::Ptr source, DataStoreQuery *store) 200 Reduce(const QByteArray &reductionProperty, const QByteArray &selectionProperty, QueryBase::Reduce::Selector::Comparator comparator, FilterBase::Ptr source, DataStoreQuery *store)
201 : FilterBase(source, store), 201 : Filter(source, store),
202 mReductionProperty(reductionProperty), 202 mReductionProperty(reductionProperty),
203 mSelectionProperty(selectionProperty), 203 mSelectionProperty(selectionProperty),
204 mSelectionComparator(comparator) 204 mSelectionComparator(comparator)
@@ -236,6 +236,11 @@ public:
236 236
237 for (const auto &r : results) { 237 for (const auto &r : results) {
238 readEntity(r, [&, this](const Sink::ApplicationDomain::ApplicationDomainType &entity, Sink::Operation operation) { 238 readEntity(r, [&, this](const Sink::ApplicationDomain::ApplicationDomainType &entity, Sink::Operation operation) {
239 //We need to apply all property filters that we have until the reduction, because the index lookup was unfiltered.
240 if (!matchesFilter(entity)) {
241 return;
242 }
243
239 Q_ASSERT(operation != Sink::Operation_Removal); 244 Q_ASSERT(operation != Sink::Operation_Removal);
240 for (auto &aggregator : mAggregators) { 245 for (auto &aggregator : mAggregators) {
241 if (!aggregator.property.isEmpty()) { 246 if (!aggregator.property.isEmpty()) {
@@ -553,6 +558,7 @@ void DataStoreQuery::setupQuery(const Sink::QueryBase &query_)
553 for (const auto &aggregator : filter->aggregators) { 558 for (const auto &aggregator : filter->aggregators) {
554 reduction->mAggregators << Reduce::Aggregator(aggregator.operation, aggregator.propertyToCollect, aggregator.resultProperty); 559 reduction->mAggregators << Reduce::Aggregator(aggregator.operation, aggregator.propertyToCollect, aggregator.resultProperty);
555 } 560 }
561 reduction->propertyFilter = query.getBaseFilters();
556 baseSet = reduction; 562 baseSet = reduction;
557 } else if (auto filter = stage.dynamicCast<Query::Bloom>()) { 563 } else if (auto filter = stage.dynamicCast<Query::Bloom>()) {
558 baseSet = Bloom::Ptr::create(filter->property, baseSet, this); 564 baseSet = Bloom::Ptr::create(filter->property, baseSet, this);