Akonadi::Search::Query
#include <query.h>
Public Types | |
enum | SortingOption { SortNone , SortAuto , SortProperty } |
Public Member Functions | |
Query (const Query &rhs) | |
Query (const Term &t) | |
void | addCustomOption (const QString &option, const QVariant &value) |
void | addType (const QString &type) |
void | addTypes (const QStringList &typeList) |
QVariant | customOption (const QString &option) const |
QVariantMap | customOptions () const |
int | dayFilter () const |
ResultIterator | exec () |
uint | limit () const |
int | monthFilter () const |
uint | offset () const |
Query & | operator= (const Query &rhs) |
bool | operator== (const Query &rhs) const |
void | removeCustomOption (const QString &option) |
QString | searchString () const |
void | setDateFilter (int year, int month=-1, int day=-1) |
void | setLimit (uint limit) |
void | setOffset (uint offset) |
void | setSearchString (const QString &str) |
void | setSortingOption (SortingOption option) |
void | setSortingProperty (const QString &property) |
void | setTerm (const Term &t) |
void | setType (const QString &type) |
void | setTypes (const QStringList &types) |
SortingOption | sortingOption () const |
QString | sortingProperty () const |
Term | term () const |
QByteArray | toJSON () const |
QUrl | toSearchUrl (const QString &title=QString()) |
QStringList | types () const |
int | yearFilter () const |
Static Public Member Functions | |
static Query | fromJSON (const QByteArray &arr) |
static Query | fromSearchUrl (const QUrl &url) |
static QString | titleFromQueryUrl (const QUrl &url) |
Detailed Description
Search query.
Definition at line 26 of file core/query.h.
Member Enumeration Documentation
◆ SortingOption
Enumerator | |
---|---|
SortNone | The results are returned in the most efficient order. They can be returned in any order. |
SortAuto | The results are returned in the order the SearchStore decides should be ideal. This criteria could be based on any factors. Read the documentation for the corresponding search store. |
SortProperty | The results are returned based on the explicit property specified. The implementation of this depends on the search store. |
Definition at line 88 of file core/query.h.
Constructor & Destructor Documentation
◆ Query() [1/3]
Query::Query | ( | ) |
Definition at line 47 of file core/query.cpp.
◆ Query() [2/3]
Query::Query | ( | const Term & | t | ) |
Definition at line 52 of file core/query.cpp.
◆ Query() [3/3]
Query::Query | ( | const Query & | rhs | ) |
Definition at line 58 of file core/query.cpp.
Member Function Documentation
◆ addCustomOption()
Adds a custom option which any search backend could use to configure the query result.
Each backend has their own custom options which should be looked up in their corresponding documentation
Definition at line 176 of file core/query.cpp.
◆ addType()
void Query::addType | ( | const QString & | type | ) |
Add a type to the results of the query.
Each Item in the result must contain one of the types. This is generally used to filter only Files, Emails, Tags, etc
One can add multiple types in one go by separating individual types with a '/'. Eg - "File/Audio".
Please note that the types are ANDed together. So searching for "Image" and "Video" will probably never return any results. Have a look at KFileMetaData::TypeInfo for a list of type names.
Definition at line 75 of file core/query.cpp.
◆ addTypes()
void Query::addTypes | ( | const QStringList & | typeList | ) |
Definition at line 80 of file core/query.cpp.
◆ customOption()
Definition at line 181 of file core/query.cpp.
◆ customOptions()
|
nodiscard |
Definition at line 186 of file core/query.cpp.
◆ dayFilter()
|
nodiscard |
Definition at line 150 of file core/query.cpp.
◆ fromJSON()
|
static |
Definition at line 283 of file core/query.cpp.
◆ fromSearchUrl()
Definition at line 354 of file core/query.cpp.
◆ limit()
|
nodiscard |
Definition at line 113 of file core/query.cpp.
◆ monthFilter()
|
nodiscard |
Definition at line 145 of file core/query.cpp.
◆ offset()
|
nodiscard |
Definition at line 123 of file core/query.cpp.
◆ operator=()
Definition at line 392 of file core/query.cpp.
◆ operator==()
bool Query::operator== | ( | const Query & | rhs | ) | const |
Definition at line 371 of file core/query.cpp.
◆ removeCustomOption()
void Query::removeCustomOption | ( | const QString & | option | ) |
Definition at line 191 of file core/query.cpp.
◆ searchString()
|
nodiscard |
Definition at line 103 of file core/query.cpp.
◆ setDateFilter()
void Query::setDateFilter | ( | int | year, |
int | month = -1, | ||
int | day = -1 ) |
Filter the results in the specified date range.
The year/month/day may be set to -1 in order to ignore it.
Definition at line 133 of file core/query.cpp.
◆ setLimit()
void Query::setLimit | ( | uint | limit | ) |
Only a maximum of limit
results will be returned.
By default the limit is 100000.
Definition at line 118 of file core/query.cpp.
◆ setOffset()
void Query::setOffset | ( | uint | offset | ) |
Definition at line 128 of file core/query.cpp.
◆ setSearchString()
void Query::setSearchString | ( | const QString & | str | ) |
Set some text which should be used to search for Items.
This contain a single word or an entire sentence.
Each search backend will interpret it in its own way, and try to give the best possible results.
Definition at line 108 of file core/query.cpp.
◆ setSortingOption()
void Query::setSortingOption | ( | Query::SortingOption | option | ) |
Definition at line 155 of file core/query.cpp.
◆ setSortingProperty()
void Query::setSortingProperty | ( | const QString & | property | ) |
Sets the property that should be used for sorting.
This automatically set the sorting mechanism to SortProperty
Definition at line 165 of file core/query.cpp.
◆ setTerm()
void Query::setTerm | ( | const Term & | t | ) |
Definition at line 65 of file core/query.cpp.
◆ setType()
void Query::setType | ( | const QString & | type | ) |
Definition at line 87 of file core/query.cpp.
◆ setTypes()
void Query::setTypes | ( | const QStringList & | types | ) |
Definition at line 93 of file core/query.cpp.
◆ sortingOption()
|
nodiscard |
Definition at line 160 of file core/query.cpp.
◆ sortingProperty()
|
nodiscard |
Definition at line 171 of file core/query.cpp.
◆ term()
|
nodiscard |
Definition at line 70 of file core/query.cpp.
◆ titleFromQueryUrl()
Definition at line 365 of file core/query.cpp.
◆ toJSON()
|
nodiscard |
Definition at line 231 of file core/query.cpp.
◆ toSearchUrl()
Definition at line 338 of file core/query.cpp.
◆ types()
|
nodiscard |
Definition at line 98 of file core/query.cpp.
◆ yearFilter()
|
nodiscard |
Definition at line 140 of file core/query.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 4 2024 16:37:50 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.