22 #ifndef XAPIAN_INCLUDED_MSET_H 23 #define XAPIAN_INCLUDED_MSET_H 25 #if !defined XAPIAN_IN_XAPIAN_H && !defined XAPIAN_LIB_BUILD 26 # error Never use <xapian/mset.h> directly; include <xapian.h> instead. 68 #ifdef XAPIAN_MOVE_SEMANTICS 96 int convert_to_percent(
double weight)
const;
126 double get_termweight(
const std::string & term)
const;
161 double get_max_attained()
const;
163 double get_max_possible()
const;
172 SNIPPET_BACKGROUND_MODEL = 1,
179 SNIPPET_EXHAUSTIVE = 2,
186 SNIPPET_EMPTY_WITHOUT_MATCH = 4,
211 SNIPPET_NGRAMS = 2048,
220 SNIPPET_CJK_NGRAM = SNIPPET_NGRAMS
252 std::string snippet(
const std::string & text,
255 unsigned flags = SNIPPET_BACKGROUND_MODEL|SNIPPET_EXHAUSTIVE,
256 const std::string & hi_start =
"<b>",
257 const std::string & hi_end =
"</b>",
258 const std::string & omit =
"...")
const;
300 bool empty()
const {
return size() == 0; }
318 std::string get_description()
const;
372 : mset(mset_), off_from_end(off_from_end_) { }
470 return difference_type(o.
off_from_end) - difference_type(off_from_end);
485 double get_weight()
const;
491 std::string get_collapse_key()
const;
518 std::string get_sort_key()
const;
536 std::string get_description()
const;
652 #endif // XAPIAN_INCLUDED_MSET_H Xapian::doccount max_size() const
The Xapian namespace contains public interfaces for the Xapian library.
Xapian::doccount size() const
Return number of items in this MSet object.
MSetIterator & operator-=(difference_type n)
Move the iterator back by n positions.
bool operator>=(const ESetIterator &a, const ESetIterator &b)
Inequality test for ESetIterator objects.
int convert_to_percent(double weight) const
Convert a weight to a percentage.
Class representing a stemming algorithm.
double weight
The weight of a document or term.
MSetIterator operator--(int)
Move the iterator to the previous position (postfix version).
bool empty() const
Return true if this MSet object is empty.
Xapian::Internal::intrusive_ptr< Internal > internal
Compiler attribute macros.
MSetIterator & operator++()
Advance the iterator to the next position.
Xapian::termcount_diff difference_type
bool operator!=(const ESetIterator &a, const ESetIterator &b)
Inequality test for ESetIterator objects.
Class representing a list of search results.
bool operator==(const ESetIterator &a, const ESetIterator &b)
Equality test for ESetIterator objects.
static Xapian::Stem stemmer
Xapian::doccount size_type
#define XAPIAN_VISIBILITY_DEFAULT
Xapian::MSetIterator iterator
bool operator<(const ESetIterator &a, const ESetIterator &b)
Inequality test for ESetIterator objects.
MSetIterator operator[](Xapian::doccount i) const
Return iterator pointing to the i-th object in this MSet.
MSetIterator(const Xapian::MSet &mset_, Xapian::doccount off_from_end_)
Xapian::MSetIterator value_type
Xapian::doccount get_firstitem() const
Rank of first item in this MSet.
bool operator<=(const ESetIterator &a, const ESetIterator &b)
Inequality test for ESetIterator objects.
MSetIterator()
Create an unpositioned MSetIterator.
XAPIAN_DOCID_BASE_TYPE doccount_diff
A signed difference between two counts of documents.
Iterator over a Xapian::MSet.
Define XAPIAN_VISIBILITY_* macros.
MSetIterator operator-(difference_type n) const
Return the iterator decremented by n positions.
bool operator>(const ESetIterator &a, const ESetIterator &b)
Inequality test for ESetIterator objects.
void swap(MSet &o)
Efficiently swap this MSet object with another.
MSetIterator begin() const
Return iterator pointing to the first item in this MSet.
MSetIterator end() const
Return iterator pointing to just after the last item in this MSet.
std::random_access_iterator_tag iterator_category
difference_type operator-(const MSetIterator &o) const
Return the number of positions between o and this iterator.
int get_percent() const
Convert the weight of the current iterator position to a percentage.
double get_weight() const
Get the weight for the current position.
Xapian::MSet::size_type off_from_end
XAPIAN_TERMCOUNT_BASE_TYPE termcount_diff
A signed difference between two counts of terms.
void fetch() const
Prefetch hint the whole MSet.
const Query operator*(double factor, const Query &q)
Scale a Xapian::Query object using OP_SCALE_WEIGHT.
unsigned XAPIAN_DOCID_BASE_TYPE doccount
A count of documents.
ESetIterator operator+(ESetIterator::difference_type n, const ESetIterator &it)
Return ESetIterator it incremented by n positions.
MSetIterator operator++(int)
Advance the iterator to the next position (postfix version).
MSetIterator & operator--()
Move the iterator to the previous position.
const value_type & const_reference
const value_type * const_pointer
Xapian::doccount_diff difference_type
MSetIterator & operator+=(difference_type n)
Move the iterator forwards by n positions.
unsigned XAPIAN_DOCID_BASE_TYPE docid
A unique identifier for a document.
API for working with documents.
Xapian::doccount get_rank() const
Return the MSet rank for the current position.
MSetIterator back() const
Return iterator pointing to the last object in this MSet.
A smart pointer that uses intrusive reference counting.
Xapian::MSetIterator const_iterator
A handle representing a document in a Xapian database.
MSetIterator operator+(difference_type n) const
Return the iterator incremented by n positions.