summaryrefslogtreecommitdiffstats
path: root/common/mail/fulltextindexer.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/mail/fulltextindexer.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/mail/fulltextindexer.h')
-rw-r--r--common/mail/fulltextindexer.h39
1 files changed, 39 insertions, 0 deletions
diff --git a/common/mail/fulltextindexer.h b/common/mail/fulltextindexer.h
new file mode 100644
index 0000000..ef41455
--- /dev/null
+++ b/common/mail/fulltextindexer.h
@@ -0,0 +1,39 @@
1/*
2 * Copyright (C) 2015 Christian Mollekopf <chrigi_1@fastmail.fm>
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the
16 * Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 */
19#pragma once
20
21#include "indexer.h"
22
23class FulltextIndex;
24namespace Sink {
25
26class FulltextIndexer : public Indexer
27{
28public:
29 typedef QSharedPointer<FulltextIndexer> Ptr;
30 virtual void add(const ApplicationDomain::ApplicationDomainType &entity) Q_DECL_OVERRIDE;
31 virtual void remove(const ApplicationDomain::ApplicationDomainType &entity) Q_DECL_OVERRIDE;
32 virtual void commitTransaction() Q_DECL_OVERRIDE;
33 virtual void abortTransaction() Q_DECL_OVERRIDE;
34 static QMap<QByteArray, int> databases();
35private:
36 QSharedPointer<FulltextIndex> index;
37};
38
39}