diff options
Diffstat (limited to 'common/datastorequery.cpp')
-rw-r--r-- | common/datastorequery.cpp | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/common/datastorequery.cpp b/common/datastorequery.cpp index f1b0ed2..f3343f3 100644 --- a/common/datastorequery.cpp +++ b/common/datastorequery.cpp | |||
@@ -119,7 +119,7 @@ class Filter : public FilterBase { | |||
119 | public: | 119 | public: |
120 | typedef QSharedPointer<Filter> Ptr; | 120 | typedef QSharedPointer<Filter> Ptr; |
121 | 121 | ||
122 | QHash<QByteArray, Sink::QueryBase::Comparator> propertyFilter; | 122 | QHash<QByteArrayList, Sink::QueryBase::Comparator> propertyFilter; |
123 | 123 | ||
124 | Filter(FilterBase::Ptr source, DataStoreQuery *store) | 124 | Filter(FilterBase::Ptr source, DataStoreQuery *store) |
125 | : FilterBase(source, store) | 125 | : FilterBase(source, store) |
@@ -158,7 +158,16 @@ public: | |||
158 | 158 | ||
159 | bool matchesFilter(const ApplicationDomain::ApplicationDomainType &entity) { | 159 | bool matchesFilter(const ApplicationDomain::ApplicationDomainType &entity) { |
160 | for (const auto &filterProperty : propertyFilter.keys()) { | 160 | for (const auto &filterProperty : propertyFilter.keys()) { |
161 | const auto property = entity.getProperty(filterProperty); | 161 | QVariant property; |
162 | if (filterProperty.size() == 1) { | ||
163 | property = entity.getProperty(filterProperty[0]); | ||
164 | } else { | ||
165 | QVariantList propList; | ||
166 | for (const auto &propName : filterProperty) { | ||
167 | propList.push_back(entity.getProperty(propName)); | ||
168 | } | ||
169 | property = propList; | ||
170 | } | ||
162 | const auto comparator = propertyFilter.value(filterProperty); | 171 | const auto comparator = propertyFilter.value(filterProperty); |
163 | //We can't deal with a fulltext filter | 172 | //We can't deal with a fulltext filter |
164 | if (comparator.comparator == QueryBase::Comparator::Fulltext) { | 173 | if (comparator.comparator == QueryBase::Comparator::Fulltext) { |
@@ -415,7 +424,7 @@ public: | |||
415 | })) | 424 | })) |
416 | {} | 425 | {} |
417 | mBloomed = true; | 426 | mBloomed = true; |
418 | propertyFilter.insert(mBloomProperty, mBloomValue); | 427 | propertyFilter.insert({mBloomProperty}, mBloomValue); |
419 | return foundValue; | 428 | return foundValue; |
420 | } else { | 429 | } else { |
421 | //Filter on bloom value | 430 | //Filter on bloom value |
@@ -593,7 +602,7 @@ void DataStoreQuery::setupQuery(const Sink::QueryBase &query_) | |||
593 | //We have a set of ids as a starting point | 602 | //We have a set of ids as a starting point |
594 | return Source::Ptr::create(query.ids().toVector(), this); | 603 | return Source::Ptr::create(query.ids().toVector(), this); |
595 | } else { | 604 | } else { |
596 | QSet<QByteArray> appliedFilters; | 605 | QSet<QByteArrayList> appliedFilters; |
597 | auto resultSet = mStore.indexLookup(mType, query, appliedFilters, appliedSorting); | 606 | auto resultSet = mStore.indexLookup(mType, query, appliedFilters, appliedSorting); |
598 | if (!appliedFilters.isEmpty()) { | 607 | if (!appliedFilters.isEmpty()) { |
599 | //We have an index lookup as starting point | 608 | //We have an index lookup as starting point |