Akonadi Search

xapiantermgenerator.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 term generator. */
20 class AKONADI_SEARCH_XAPIAN_EXPORT XapianTermGenerator
21 {
22 public:
23  explicit XapianTermGenerator(Xapian::Document *doc);
24 
25  void indexText(const QString &text);
26  void indexText(const QString &text, const QString &prefix, int wdfInc = 1);
27 
28  void setPosition(int position);
29  [[nodiscard]] int position() const;
30 
31  void setDocument(Xapian::Document *doc);
32 
33  static QStringList termList(const QString &text);
34 
35 private:
36  Xapian::Document *m_doc = nullptr;
37  Xapian::TermGenerator m_termGen;
38 
39  int m_position = 1;
40 };
41 }
42 }
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.