Albert
|
#include <globalqueryhandler.h>
Global search query handler class.
A functional query handler returning scored items. Applicable for the global search. Use this if you want your results show up in the global search. Implements TriggeredQueryHandler.
Classes | |
class | GlobalQuery |
The query interface used by GlobalQueryHandler. More... | |
Public Member Functions | |
GlobalQueryHandler () | |
~GlobalQueryHandler () override | |
virtual std::vector< RankItem > | handleGlobalQuery (const GlobalQuery *) const =0 |
The query processing function. More... | |
void | applyUsageScore (std::vector< RankItem > *) const |
Takes rank items and modifies the score according to the users usage. More... | |
void | handleTriggerQuery (TriggerQuery *) const override |
Implements handleTriggerQuery(…). More... | |
Public Member Functions inherited from albert::TriggerQueryHandler | |
TriggerQueryHandler () | |
~TriggerQueryHandler () | |
QString | trigger () const |
The user configured trigger of this handler. More... | |
virtual QString | synopsis () const |
The synopsis, displayed on empty query. More... | |
virtual QString | defaultTrigger () const |
The default (not user defined) trigger. Default Extension::id(). More... | |
virtual bool | allowTriggerRemap () const |
Enable user remapping of the trigger. Default false. More... | |
virtual bool | supportsFuzzyMatching () const |
Fuzzy matching capability. Default false. More... | |
virtual bool | fuzzyMatching () const |
Fuzzy matching. Default false. More... | |
virtual void | setFuzzyMatching (bool enabled) |
Fuzzy matching behavior. Default does nothing. More... | |
virtual void | handleTriggerQuery (TriggerQuery *) const =0 |
The trigger query processing function. More... | |
Public Member Functions inherited from albert::Extension | |
Extension ()=default | |
virtual QString | id () const =0 |
The identifier of this extension. More... | |
virtual QString | name () const =0 |
Pretty, human readable name. More... | |
virtual QString | description () const =0 |
Brief description of this extension. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from albert::Extension | |
virtual | ~Extension ()=default |
albert::GlobalQueryHandler::GlobalQueryHandler | ( | ) |
|
override |
void albert::GlobalQueryHandler::applyUsageScore | ( | std::vector< RankItem > * | ) | const |
Takes rank items and modifies the score according to the users usage.
Use this if you want to reuse your global results in the trigger handler.
|
pure virtual |
The query processing function.
The match score should make sense and often (if not always) be the fraction matched chars (legth of query string / length of item title).
Implemented in albert::IndexQueryHandler.
|
overridevirtual |
Implements handleTriggerQuery(…).
Sort and batch add rankItems(…).
Implements albert::TriggerQueryHandler.