|
Albert
|
#include <albert/indexqueryhandler.h>
Index-based global query handler.
Convenience base class for global query handlers backed by a precomputed index. Query execution is performed against the index and provides fast, deterministic matching suitable for the global search. Implementations are responsible for providing the indexed items and keeping the index up to date when the underlying data changes.
Public Member Functions | |
| bool | supportsFuzzyMatching () const override |
Returns true | |
| void | setFuzzyMatching (bool enabled) override |
| Sets the fuzzy matching mode to enabled and triggers updateIndexItems(). | |
| std::vector< RankItem > | rankItems (QueryContext &context) override |
| Returns a list of scored matches for context using the index. | |
| virtual void | updateIndexItems ()=0 |
| Updates the index. | |
| void | setIndexItems (std::vector< IndexItem > &&index_items) |
| Sets the items of the index to index_items. | |
Public Member Functions inherited from albert::GlobalQueryHandler | |
| virtual std::vector< std::shared_ptr< Item > > | handleEmptyQuery () |
| Returns a list of special items that should show up on an emtpy query. | |
Public Member Functions inherited from albert::RankedQueryHandler | |
| ItemGenerator | items (QueryContext &context) override |
| Yields result of rankItems for context usage scored and lazily sorted. | |
Public Member Functions inherited from albert::QueryHandler | |
| virtual QString | synopsis (const QString &query) const |
| Returns the input hint for the given query. | |
| virtual bool | allowTriggerRemap () const |
Returns true if the user is allowed to set a custom trigger, otherwise returns false. | |
| virtual QString | defaultTrigger () const |
| Returns the default trigger. | |
Public Member Functions inherited from albert::Extension | |
| virtual QString | id () const =0 |
| Returns the extension identifier. | |
| virtual QString | name () const =0 |
| Returns the pretty, human readable extension name. | |
| virtual QString | description () const =0 |
| Returns the brief extension description. | |
Protected Member Functions | |
| IndexQueryHandler () | |
| Constructs an index query handler. | |
| ~IndexQueryHandler () override | |
| Destructs the index query handler. | |
Protected Member Functions inherited from albert::GlobalQueryHandler | |
| ~GlobalQueryHandler () override | |
| Destructs the handler. | |
Protected Member Functions inherited from albert::RankedQueryHandler | |
| ~RankedQueryHandler () override | |
| Destructs the handler. | |
Protected Member Functions inherited from albert::GeneratorQueryHandler | |
| ~GeneratorQueryHandler () override | |
| Destructs the handler. | |
| std::unique_ptr< QueryExecution > | execution (QueryContext &context) override |
| Returns a threaded synchronous generator query execution for context. | |
Protected Member Functions inherited from albert::QueryHandler | |
| ~QueryHandler () override | |
| Destructs the handler. | |
| virtual void | setTrigger (const QString &trigger) |
| Notifies that the user-defined trigger has changed to trigger. | |
Protected Member Functions inherited from albert::Extension | |
| virtual | ~Extension () |
| Destructs the extension. | |
Additional Inherited Members | |
Static Public Member Functions inherited from albert::RankedQueryHandler | |
| static ItemGenerator | lazySort (std::vector< RankItem > rank_items) |
| Yields rank_items lazily sorted. | |
|
protected |
Constructs an index query handler.
|
overrideprotected |
Destructs the index query handler.
|
overridevirtual |
Returns a list of scored matches for context using the index.
Implements albert::RankedQueryHandler.
|
overridevirtual |
Sets the fuzzy matching mode to enabled and triggers updateIndexItems().
Reimplemented from albert::QueryHandler.
| void albert::IndexQueryHandler::setIndexItems | ( | std::vector< IndexItem > && | index_items | ) |
Sets the items of the index to index_items.
|
overridevirtual |
Returns true
Reimplemented from albert::QueryHandler.
|
pure virtual |
Updates the index.
Called when the index needs to be updated, i.e. for initialization, on user changes to the index config (fuzzy, etc…) and probably by the client itself if the items changed. This function should call setIndexItems to update the index.