summaryrefslogtreecommitdiffstats
path: root/common/typeindex.cpp
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2016-05-01 16:22:55 +0200
committerChristian Mollekopf <chrigi_1@fastmail.fm>2016-05-01 16:22:55 +0200
commit096d14f20f4dc39d20d35d605ca755b66bd48cf9 (patch)
tree4b28dd3b310ebcfa9cefa1b41992eeefa5456764 /common/typeindex.cpp
parentc1475df297975b403d991f69ef9436cd576c1e46 (diff)
downloadsink-096d14f20f4dc39d20d35d605ca755b66bd48cf9.tar.gz
sink-096d14f20f4dc39d20d35d605ca755b66bd48cf9.zip
Account filter for resources and contains comparator in query
Diffstat (limited to 'common/typeindex.cpp')
-rw-r--r--common/typeindex.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/common/typeindex.cpp b/common/typeindex.cpp
index 1321469..fca083c 100644
--- a/common/typeindex.cpp
+++ b/common/typeindex.cpp
@@ -143,7 +143,7 @@ ResultSet TypeIndex::query(const Sink::Query &query, QSet<QByteArray> &appliedFi
143 for (auto it = mSortedProperties.constBegin(); it != mSortedProperties.constEnd(); it++) { 143 for (auto it = mSortedProperties.constBegin(); it != mSortedProperties.constEnd(); it++) {
144 if (query.propertyFilter.contains(it.key()) && query.sortProperty == it.value()) { 144 if (query.propertyFilter.contains(it.key()) && query.sortProperty == it.value()) {
145 Index index(indexName(it.key(), it.value()), transaction); 145 Index index(indexName(it.key(), it.value()), transaction);
146 const auto lookupKey = getByteArray(query.propertyFilter.value(it.key())); 146 const auto lookupKey = getByteArray(query.propertyFilter.value(it.key()).value);
147 Trace() << "looking for " << lookupKey; 147 Trace() << "looking for " << lookupKey;
148 index.lookup(lookupKey, [&](const QByteArray &value) { keys << value; }, 148 index.lookup(lookupKey, [&](const QByteArray &value) { keys << value; },
149 [it](const Index::Error &error) { Warning() << "Error in index: " << error.message << it.key() << it.value(); }, true); 149 [it](const Index::Error &error) { Warning() << "Error in index: " << error.message << it.key() << it.value(); }, true);
@@ -156,7 +156,7 @@ ResultSet TypeIndex::query(const Sink::Query &query, QSet<QByteArray> &appliedFi
156 for (const auto &property : mProperties) { 156 for (const auto &property : mProperties) {
157 if (query.propertyFilter.contains(property)) { 157 if (query.propertyFilter.contains(property)) {
158 Index index(indexName(property), transaction); 158 Index index(indexName(property), transaction);
159 const auto lookupKey = getByteArray(query.propertyFilter.value(property)); 159 const auto lookupKey = getByteArray(query.propertyFilter.value(property).value);
160 index.lookup( 160 index.lookup(
161 lookupKey, [&](const QByteArray &value) { keys << value; }, [property](const Index::Error &error) { Warning() << "Error in index: " << error.message << property; }); 161 lookupKey, [&](const QByteArray &value) { keys << value; }, [property](const Index::Error &error) { Warning() << "Error in index: " << error.message << property; });
162 appliedFilters << property; 162 appliedFilters << property;