Akonadi Search

xapianqueryparser.h
1 /*
2  * SPDX-FileCopyrightText: 2014 Vishesh Handa <[email protected]>
3  *
4  * SPDX-License-Identifier: LGPL-2.1-or-later
5  *
6  */
7 
8 #pragma once
9 
10 #include <xapian.h>
11 
12 #include "search_xapian_export.h"
13 #include <QString>
14 
15 namespace Akonadi
16 {
17 namespace Search
18 {
19 /** Xapian query parser. */
20 class AKONADI_SEARCH_XAPIAN_EXPORT XapianQueryParser
21 {
22 public:
24 
25  void setDatabase(Xapian::Database *db);
26  Xapian::Query parseQuery(const QString &str, const QString &prefix = QString());
27 
28  /**
29  * Expands word to every possible option which it can be expanded to.
30  */
31  Xapian::Query expandWord(const QString &word, const QString &prefix = QString());
32 
33  /**
34  * Set if each word in the string should be treated as a partial word
35  * and should be expanded to every possible word.
36  */
37  void setAutoExapand(bool autoexpand);
38 
39 private:
40  Xapian::Database *m_db = nullptr;
41  bool m_autoExpand = true;
42 };
43 }
44 }
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Tue Dec 5 2023 04:11:35 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.