Akonadi Search

xapianqueryparser.h
1/*
2 * SPDX-FileCopyrightText: 2014 Vishesh Handa <me@vhanda.in>
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
15namespace Akonadi
16{
17namespace Search
18{
19/** Xapian query parser. */
20class AKONADI_SEARCH_XAPIAN_EXPORT XapianQueryParser
21{
22public:
24
25 void setDatabase(Xapian::Database *db);
26 [[nodiscard]] 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 [[nodiscard]] 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
39private:
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-2024 The KDE developers.
Generated on Mon Nov 4 2024 16:37:50 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.