23 #ifndef XAPIAN_INCLUDED_MATCHSPY_H
24 #define XAPIAN_INCLUDED_MATCHSPY_H
26 #if !defined XAPIAN_IN_XAPIAN_H && !defined XAPIAN_LIB_BUILD
27 # error Never use <xapian/matchspy.h> directly; include <xapian.h> instead.
112 virtual std::string
name()
const;
120 virtual std::string serialise()
const;
143 virtual MatchSpy * unserialise(
const std::string & serialised,
152 virtual std::string serialise_results()
const;
166 virtual void merge_results(
const std::string & serialised);
175 virtual std::string get_description()
const;
185 opt_intrusive_base::release();
197 opt_intrusive_base::release();
211 struct XAPIAN_VISIBILITY_DEFAULT Internal
221 std::map<std::string, Xapian::doccount>
values;
242 return internal.get() ?
internal->total : 0;
286 virtual std::string
name()
const;
287 virtual std::string serialise()
const;
288 virtual MatchSpy * unserialise(
const std::string & serialised,
290 virtual std::string serialise_results()
const;
291 virtual void merge_results(
const std::string & serialised);
292 virtual std::string get_description()
const;
Compiler attribute macros.
A handle representing a document in a Xapian database.
Base class for objects managed by intrusive_ptr.
A smart pointer that uses intrusive reference counting.
Base class for objects managed by opt_intrusive_ptr.
Abstract base class for match spies.
virtual void operator()(const Xapian::Document &doc, double wt)=0
Register a document with the match spy.
MatchSpy(const MatchSpy &)
Don't allow copying.
MatchSpy()
Default constructor, needed by subclass constructors.
void operator=(const MatchSpy &)
Don't allow assignment.
const MatchSpy * release() const
Start reference counting this object.
MatchSpy * release()
Start reference counting this object.
Registry for user subclasses.
Class for iterating over a list of terms.
Class for counting the frequencies of values in the matching documents.
TermIterator values_end() const
End iterator corresponding to values_begin()
ValueCountMatchSpy()
Construct an empty ValueCountMatchSpy.
TermIterator top_values_end(size_t) const
End iterator corresponding to top_values_begin()
ValueCountMatchSpy(Xapian::valueno slot_)
Construct a MatchSpy which counts the values in a particular slot.
size_t get_total() const
Return the total number of documents tallied.
The Xapian namespace contains public interfaces for the Xapian library.
const valueno BAD_VALUENO
Reserved value to indicate "no valueno".
unsigned valueno
The number for a value slot in a document.
unsigned XAPIAN_DOCID_BASE_TYPE doccount
A count of documents.
Internal(Xapian::valueno slot_)
Xapian::valueno slot
The slot to count.
std::map< std::string, Xapian::doccount > values
The values seen so far, together with their frequency.
Xapian::doccount total
Total number of documents seen by the match spy.
Class for iterating over a list of terms.
Define XAPIAN_VISIBILITY_* macros.
#define XAPIAN_VISIBILITY_DEFAULT