Albert
Loading...
Searching...
No Matches
indexqueryhandler.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2025 Manuel Schneider
2// SPDX-License-Identifier: MIT
3
4#pragma once
5#include <QString>
7#include <albert/indexitem.h>
8#include <memory>
9#include <vector>
10
11namespace albert
12{
13
24class ALBERT_EXPORT IndexQueryHandler : public GlobalQueryHandler
25{
26public:
28 bool supportsFuzzyMatching() const override;
29
31 void setFuzzyMatching(bool enabled) override;
32
34 std::vector<RankItem> rankItems(QueryContext &context) override;
35
45 virtual void updateIndexItems() = 0;
46
48 void setIndexItems(std::vector<IndexItem> &&index_items);
49
50protected:
53
56
57private:
58 class Private;
59 std::unique_ptr<Private> d;
60
61};
62
63}
Query handler participating in the global search.
Definition globalqueryhandler.h:27
Index-based global query handler.
Definition indexqueryhandler.h:25
bool supportsFuzzyMatching() const override
Returns true
std::vector< RankItem > rankItems(QueryContext &context) override
Returns a list of scored matches for context using the index.
IndexQueryHandler()
Constructs an index query handler.
void setIndexItems(std::vector< IndexItem > &&index_items)
Sets the items of the index to index_items.
~IndexQueryHandler() override
Destructs the index query handler.
virtual void updateIndexItems()=0
Updates the index.
void setFuzzyMatching(bool enabled) override
Sets the fuzzy matching mode to enabled and triggers updateIndexItems().
Query interface.
Definition querycontext.h:19
Definition app.h:56