summaryrefslogtreecommitdiffstats
path: root/common/typeindex.h
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2016-10-13 18:38:35 +0200
committerChristian Mollekopf <chrigi_1@fastmail.fm>2018-02-11 23:03:17 +0100
commit6051c1247cde61bcc8e483eb4166e5a297c0ecc6 (patch)
treedf3aba1ef4011f2640b17c8cf7a9b106933231ab /common/typeindex.h
parent8740a007515dcf1b315d69ab5c64fcfd40ec980c (diff)
downloadsink-6051c1247cde61bcc8e483eb4166e5a297c0ecc6.tar.gz
sink-6051c1247cde61bcc8e483eb4166e5a297c0ecc6.zip
Xapian based fulltext indexing
This cuts into the sync performance by about 40%, but gives us fast fulltext searching for all local content.
Diffstat (limited to 'common/typeindex.h')
-rw-r--r--common/typeindex.h11
1 files changed, 7 insertions, 4 deletions
diff --git a/common/typeindex.h b/common/typeindex.h
index 890c3db..b8b4d52 100644
--- a/common/typeindex.h
+++ b/common/typeindex.h
@@ -71,10 +71,10 @@ public:
71 mCustomIndexer << CustomIndexer::Ptr::create(); 71 mCustomIndexer << CustomIndexer::Ptr::create();
72 } 72 }
73 73
74 void add(const QByteArray &identifier, const Sink::ApplicationDomain::ApplicationDomainType &entity, Sink::Storage::DataStore::Transaction &transaction); 74 void add(const QByteArray &identifier, const Sink::ApplicationDomain::ApplicationDomainType &entity, Sink::Storage::DataStore::Transaction &transaction, const QByteArray &resourceInstanceId);
75 void remove(const QByteArray &identifier, const Sink::ApplicationDomain::ApplicationDomainType &entity, Sink::Storage::DataStore::Transaction &transaction); 75 void remove(const QByteArray &identifier, const Sink::ApplicationDomain::ApplicationDomainType &entity, Sink::Storage::DataStore::Transaction &transaction, const QByteArray &resourceInstanceId);
76 76
77 QVector<QByteArray> query(const Sink::QueryBase &query, QSet<QByteArray> &appliedFilters, QByteArray &appliedSorting, Sink::Storage::DataStore::Transaction &transaction); 77 QVector<QByteArray> query(const Sink::QueryBase &query, QSet<QByteArray> &appliedFilters, QByteArray &appliedSorting, Sink::Storage::DataStore::Transaction &transaction, const QByteArray &resourceInstanceId);
78 QVector<QByteArray> lookup(const QByteArray &property, const QVariant &value, Sink::Storage::DataStore::Transaction &transaction); 78 QVector<QByteArray> lookup(const QByteArray &property, const QVariant &value, Sink::Storage::DataStore::Transaction &transaction);
79 79
80 template <typename Left, typename Right> 80 template <typename Left, typename Right>
@@ -104,10 +104,13 @@ public:
104 template <typename LeftType, typename RightType> 104 template <typename LeftType, typename RightType>
105 void unindex(const QByteArray &leftName, const QByteArray &rightName, const QVariant &leftValue, const QVariant &rightValue, Sink::Storage::DataStore::Transaction &transaction); 105 void unindex(const QByteArray &leftName, const QByteArray &rightName, const QVariant &leftValue, const QVariant &rightValue, Sink::Storage::DataStore::Transaction &transaction);
106 106
107 void commitTransaction();
108 void abortTransaction();
109
107 110
108private: 111private:
109 friend class Sink::Storage::EntityStore; 112 friend class Sink::Storage::EntityStore;
110 void updateIndex(bool add, const QByteArray &identifier, const Sink::ApplicationDomain::ApplicationDomainType &entity, Sink::Storage::DataStore::Transaction &transaction); 113 void updateIndex(bool add, const QByteArray &identifier, const Sink::ApplicationDomain::ApplicationDomainType &entity, Sink::Storage::DataStore::Transaction &transaction, const QByteArray &resourceInstanceId);
111 QByteArray indexName(const QByteArray &property, const QByteArray &sortProperty = QByteArray()) const; 114 QByteArray indexName(const QByteArray &property, const QByteArray &sortProperty = QByteArray()) const;
112 Sink::Log::Context mLogCtx; 115 Sink::Log::Context mLogCtx;
113 QByteArray mType; 116 QByteArray mType;