Public Types | Public Member Functions | List of all members
Xapian::MSet Class Reference

Class representing a list of search results. More...

Public Types

enum  { SNIPPET_BACKGROUND_MODEL = 1, SNIPPET_EXHAUSTIVE = 2 }
 

Public Member Functions

 MSet (const MSet &o)
 Copying is allowed. More...
 
MSetoperator= (const MSet &o)
 Copying is allowed. More...
 
 MSet ()
 Default constructor. More...
 
 ~MSet ()
 Destructor.
 
int convert_to_percent (double weight) const
 
int convert_to_percent (const MSetIterator &it) const
 
Xapian::doccount get_termfreq (const std::string &term) const
 
double get_termweight (const std::string &term) const
 
Xapian::doccount get_firstitem () const
 
Xapian::doccount get_matches_lower_bound () const
 
Xapian::doccount get_matches_estimated () const
 
Xapian::doccount get_matches_upper_bound () const
 
Xapian::doccount get_uncollapsed_matches_lower_bound () const
 
Xapian::doccount get_uncollapsed_matches_estimated () const
 
Xapian::doccount get_uncollapsed_matches_upper_bound () const
 
double get_max_attained () const
 
double get_max_possible () const
 
std::string snippet (const std::string &text, size_t length=500, const Xapian::Stem &stemmer=Xapian::Stem(), unsigned flags=SNIPPET_BACKGROUND_MODEL|SNIPPET_EXHAUSTIVE, const std::string &hi_start="<b>", const std::string &hi_end="</b>", const std::string &omit="...") const
 Generate a snippet. More...
 
void fetch (const MSetIterator &begin, const MSetIterator &end) const
 Prefetch hint a range of items. More...
 
void fetch (const MSetIterator &item) const
 Prefetch hint a single MSet item. More...
 
void fetch () const
 Prefetch hint the whole MSet. More...
 
Xapian::doccount size () const
 
bool empty () const
 
void swap (MSet &o)
 
MSetIterator begin () const
 
MSetIterator end () const
 
MSetIterator operator[] (Xapian::doccount i) const
 
MSetIterator back () const
 
std::string get_description () const
 Return a string describing this object.
 
Xapian::doccount max_size () const
 

Detailed Description

Class representing a list of search results.

Constructor & Destructor Documentation

Xapian::MSet::MSet ( const MSet o)

Copying is allowed.

The internals are reference counted, so copying is cheap.

Xapian::MSet::MSet ( )

Default constructor.

Creates an empty MSet, mostly useful as a placeholder.

Member Function Documentation

void Xapian::MSet::fetch ( const MSetIterator begin,
const MSetIterator end 
) const
inline

Prefetch hint a range of items.

For a remote database, this may start a pipelined fetched of the requested documents from the remote server.

For a disk-based database, this may send prefetch hints to the operating system such that the disk blocks the requested documents are stored in are more likely to be in the cache when we come to actually read them.

void Xapian::MSet::fetch ( const MSetIterator item) const
inline

Prefetch hint a single MSet item.

For a remote database, this may start a pipelined fetched of the requested documents from the remote server.

For a disk-based database, this may send prefetch hints to the operating system such that the disk blocks the requested documents are stored in are more likely to be in the cache when we come to actually read them.

References Xapian::MSetIterator::get_weight().

void Xapian::MSet::fetch ( ) const
inline

Prefetch hint the whole MSet.

For a remote database, this may start a pipelined fetched of the requested documents from the remote server.

For a disk-based database, this may send prefetch hints to the operating system such that the disk blocks the requested documents are stored in are more likely to be in the cache when we come to actually read them.

MSet& Xapian::MSet::operator= ( const MSet o)

Copying is allowed.

The internals are reference counted, so assignment is cheap.

std::string Xapian::MSet::snippet ( const std::string &  text,
size_t  length = 500,
const Xapian::Stem stemmer = Xapian::Stem(),
unsigned  flags = SNIPPET_BACKGROUND_MODEL|SNIPPET_EXHAUSTIVE,
const std::string &  hi_start = "<b>",
const std::string &  hi_end = "</b>",
const std::string &  omit = "..." 
) const

Generate a snippet.

This method selects a continuous run of words of less than about length bytes from text, based mainly on where the query matches (currently terms, exact phrases and wildcards are taken into account), but also on the non-query terms in the text.

The returned text can be escaped (by default, it is escaped to make it suitable for use in HTML), and matches with the query will be highlighted using hi_start and hi_end.

If the snippet seems to start or end mid-sentence, then omit is prepended or append (respectively) to indicate this.

The stemmer used to build the query should be specified in stemmer.

And flags contains flags controlling behaviour.

Added in 1.3.5.


The documentation for this class was generated from the following file:

Documentation for Xapian (version 1.4.0).
Generated on Wed Oct 12 2016 by Doxygen 1.8.11.