ept::core::xapian::Source Struct Reference

#include <xapian.h>

List of all members.

Public Member Functions

 Source ()
Xapian::Database & db ()
 Access the Xapian database.
const Xapian::Database & db () const
 Access the Xapian database.
time_t timestamp () const
 Timestamp of when the Xapian database was last updated.
bool hasData () const
 Returns true if the index has data.
List query (const std::string &s, int qualityCutoff=50)
List 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.
Xapian::Query makeORQuery (const std::string &keywords) const
 Tokenize the string and build an OR query with the resulting keywords.
Xapian::Query makePartialORQuery (const std::string &keywords) const
 Tokenize the string and build an OR query with the resulting keywords.
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.
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.
Xapian::Query makeRelatedQuery (const std::string &pkgname) const
 Create a query to look for packages similar to the given one.
double getDoubleValue (const std::string &pkgname, Xapian::valueno val_id) const
 Get the integer value for.
int getIntValue (const std::string &pkgname, Xapian::valueno val_id) const
 Get the integer value for.

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.

Static Protected Member Functions

static std::string toLower (const std::string &str)
 Return a lowercased copy of the string.

Protected Attributes

time_t m_timestamp
Xapian::Database m_db
Xapian::Stem m_stem


Constructor & Destructor Documentation

ept::core::xapian::Source::Source (  ) 


Member Function Documentation

std::string ept::core::xapian::Source::toLower ( const std::string &  str  )  [static, protected]

Return a lowercased copy of the string.

Referenced by makeORQuery(), and normalize_and_add().

void ept::core::xapian::Source::normalize_and_add ( Xapian::Document &  doc,
const std::string &  term,
int &  pos 
) const [protected]

Add normalised tokens computed from the string to the document doc.

pos is used as a sequence generator for entering the token position in the document.

References m_stem, and toLower().

Xapian::Database& ept::core::xapian::Source::db (  )  [inline]

Access the Xapian database.

References m_db.

Referenced by getDoubleValue(), getIntValue(), makeRelatedQuery(), partialQuery(), and query().

const Xapian::Database& ept::core::xapian::Source::db (  )  const [inline]

Access the Xapian database.

References m_db.

time_t ept::core::xapian::Source::timestamp (  )  const [inline]

Timestamp of when the Xapian database was last updated.

References m_timestamp.

bool ept::core::xapian::Source::hasData (  )  const [inline]

Returns true if the index has data.

References m_timestamp.

List ept::core::xapian::Source::query ( const std::string &  s,
int  qualityCutoff = 50 
) [inline]

References db(), and makeORQuery().

Referenced by TestXapian::query().

List ept::core::xapian::Source::partialQuery ( const std::string &  s  )  [inline]

References db(), and makePartialORQuery().

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().

Xapian::Query ept::core::xapian::Source::makeORQuery ( const std::string &  keywords  )  const

Tokenize the string and build an OR query with the resulting keywords.

Referenced by makePartialORQuery(), query(), and TestXapian::TestXapian().

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.

References m_db, and makeORQuery().

Referenced by partialQuery().

template<typename ITER>
Xapian::Query ept::core::xapian::Source::makeORQuery ( const ITER &  begin,
const ITER &  end 
) const [inline]

Build a query with the given keywords, specified as iterators of strings.

References m_stem, and toLower().

vector< 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.

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().

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().


Member Data Documentation

Referenced by hasData(), and timestamp().

Xapian::Database ept::core::xapian::Source::m_db [protected]

Xapian::Stem ept::core::xapian::Source::m_stem [protected]

Referenced by makeORQuery(), and normalize_and_add().


The documentation for this struct was generated from the following files:

Generated on Sat Jul 26 14:10:19 2008 for libept by  doxygen 1.5.6