Akonadi Search

xapiantermgenerator.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 term generator. */
20class AKONADI_SEARCH_XAPIAN_EXPORT XapianTermGenerator
21{
22public:
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 [[nodiscard]] static QStringList termList(const QString &text);
34
35private:
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-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:10:52 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.