libept
0.5.25
|
#include <xapian.h>
Public Member Functions | |
Source () | |
Xapian::Database & | db () |
Access the Xapian database. More... | |
const Xapian::Database & | db () const |
Access the Xapian database. More... | |
void | open () const |
void | invalidate () |
time_t | timestamp () const |
Timestamp of when the Xapian database was last updated. More... | |
void | updateLeniently (AptDatabase &apt, OpProgress *op=0) |
void | update (OpProgress *op=0) |
bool | hasData () const |
Returns true if the index has data. More... | |
Query | query (const std::string &s, bool expand=true, int qualityCutoff=50) |
Query | partialQuery (const std::string &s) |
Xapian::docid | docidByName (const std::string &pkgname) const |
Returns true if the index is older than the Apt database information. More... | |
Xapian::Query | makeORQuery (const std::string &keywords) const |
Tokenize the string and build an OR query with the resulting keywords. More... | |
Xapian::Query | makePartialORQuery (const std::string &keywords) const |
Tokenize the string and build an OR query with the resulting keywords. More... | |
template<typename ITER > | |
Xapian::Query | makeORQuery (const ITER &begin, const ITER &end) const |
Build a query with the given keywords, specified as iterators of strings. More... | |
std::vector< std::string > | expand (Xapian::Enquire &enq) const |
Return a list of tag-based terms that can be used to expand an OR query. More... | |
Xapian::Query | makeRelatedQuery (const std::string &pkgname) const |
Create a query to look for packages similar to the given one. More... | |
double | getDoubleValue (const std::string &pkgname, Xapian::valueno val_id) const |
Get the integer value for. More... | |
int | getIntValue (const std::string &pkgname, Xapian::valueno val_id) const |
Get the integer value for. More... | |
Protected Member Functions | |
void | normalize_and_add (Xapian::Document &doc, const std::string &term, int &pos) const |
Add normalised tokens computed from the string to the document doc. More... | |
Static Protected Member Functions | |
static std::string | toLower (const std::string &str) |
Return a lowercased copy of the string. More... | |
Protected Attributes | |
Xapian::Database | m_db |
Xapian::Stem | m_stem |
bool | m_opened |
ept::core::xapian::Source::Source | ( | ) |
|
inline |
Access the Xapian database.
Referenced by getDoubleValue(), getIntValue(), and makeRelatedQuery().
|
inline |
Access the Xapian database.
Xapian::docid ept::core::xapian::Source::docidByName | ( | const std::string & | pkgname | ) | const |
Returns true if the index is older than the Apt database information.
References m_db.
Referenced by getDoubleValue(), and getIntValue().
std::vector<std::string> ept::core::xapian::Source::expand | ( | Xapian::Enquire & | enq | ) | const |
Return a list of tag-based terms that can be used to expand an OR query.
double ept::core::xapian::Source::getDoubleValue | ( | const std::string & | pkgname, |
Xapian::valueno | val_id | ||
) | const |
Get the integer value for.
References db(), and docidByName().
int ept::core::xapian::Source::getIntValue | ( | const std::string & | pkgname, |
Xapian::valueno | val_id | ||
) | const |
Get the integer value for.
References db(), and docidByName().
|
inline |
Returns true if the index has data.
|
inline |
Xapian::Query ept::core::xapian::Source::makeORQuery | ( | const std::string & | keywords | ) | const |
Tokenize the string and build an OR query with the resulting keywords.
|
inline |
Build a query with the given keywords, specified as iterators of strings.
Xapian::Query ept::core::xapian::Source::makePartialORQuery | ( | const std::string & | keywords | ) | const |
Tokenize the string and build an OR query with the resulting keywords.
The last token in keywords is considered to be typed only partially, to implement proper search-as-you-type.
Xapian::Query ept::core::xapian::Source::makeRelatedQuery | ( | const std::string & | pkgname | ) | const |
Create a query to look for packages similar to the given one.
References db().
|
protected |
void ept::core::xapian::Source::open | ( | ) | const |
References ept::textsearch::Path::index(), m_db, m_opened, and timestamp().
|
inline |
References ept::core::xapian::Query::addTerms().
|
inline |
time_t ept::core::xapian::Source::timestamp | ( | ) | const |
Timestamp of when the Xapian database was last updated.
References ept::textsearch::Path::indexTimestamp().
Referenced by open().
|
staticprotected |
Return a lowercased copy of the string.
Referenced by normalize_and_add().
|
inline |
|
inline |
References ept::core::AptDatabase::timestamp().
|
mutableprotected |
Referenced by docidByName(), and open().
|
mutableprotected |
Referenced by open().
|
protected |
Referenced by normalize_and_add().