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();
209 #ifndef SWIG // SWIG doesn't need to know about the internal class 221 std::map<std::string, Xapian::doccount>
values;
238 : internal(new Internal(slot_)) {}
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;
297 #endif // XAPIAN_INCLUDED_MATCHSPY_H The Xapian namespace contains public interfaces for the Xapian library.
TermIterator values_end() const
End iterator corresponding to values_begin()
MatchSpy * release()
Start reference counting this object.
Abstract base class for match spies.
Compiler attribute macros.
size_t get_total() const
Return the total number of documents tallied.
#define XAPIAN_VISIBILITY_DEFAULT
Xapian::valueno slot
The slot to count.
MatchSpy()
Default constructor, needed by subclass constructors.
Class for iterating over a list of terms.
std::map< std::string, Xapian::doccount > values
The values seen so far, together with their frequency.
Define XAPIAN_VISIBILITY_* macros.
Registry for user subclasses.
ValueCountMatchSpy(Xapian::valueno slot_)
Construct a MatchSpy which counts the values in a particular slot.
Base class for objects managed by intrusive_ptr.
Base class for objects managed by opt_intrusive_ptr.
TermIterator top_values_end(size_t) const
End iterator corresponding to top_values_begin()
Xapian::doccount total
Total number of documents seen by the match spy.
Class for counting the frequencies of values in the matching documents.
Internal(Xapian::valueno slot_)
unsigned XAPIAN_DOCID_BASE_TYPE doccount
A count of documents.
unsigned valueno
The number for a value slot in a document.
ValueCountMatchSpy()
Construct an empty ValueCountMatchSpy.
const valueno BAD_VALUENO
Reserved value to indicate "no valueno".
A smart pointer that uses intrusive reference counting.
Class for iterating over a list of terms.
A handle representing a document in a Xapian database.
const MatchSpy * release() const
Start reference counting this object.