xapian-core  1.4.21
Classes | Functions
matchspy.cc File Reference

MatchSpy implementation. More...

#include <config.h>
#include <xapian/matchspy.h>
#include <xapian/document.h>
#include <xapian/error.h>
#include <xapian/queryparser.h>
#include <xapian/registry.h>
#include <map>
#include <string>
#include <vector>
#include "autoptr.h"
#include "debuglog.h"
#include "noreturn.h"
#include "omassert.h"
#include "net/length.h"
#include "stringutils.h"
#include "str.h"
#include "termlist.h"
#include <cfloat>
#include <cmath>
+ Include dependency graph for matchspy.cc:

Go to the source code of this file.


class  ValueCountTermList
 A termlist iterator over the contents of a ValueCountMatchSpy. More...
class  StringAndFrequency
 A string with a corresponding frequency. More...
class  StringAndFreqCmpByFreq
 Compare two StringAndFrequency objects. More...
class  StringAndFreqTermList
 A termlist iterator over a vector of StringAndFrequency objects. More...


static void unsupported_method ()
static void get_most_frequent_items (vector< StringAndFrequency > &result, const map< string, doccount > &items, size_t maxitems)
 Get the most frequent items from a map from string to frequency. More...

Detailed Description

MatchSpy implementation.

Definition in file matchspy.cc.

Function Documentation

◆ get_most_frequent_items()

static void get_most_frequent_items ( vector< StringAndFrequency > &  result,
const map< string, doccount > &  items,
size_t  maxitems 

Get the most frequent items from a map from string to frequency.

This takes input such as that in ValueCountMatchSpy::Internal::values and returns a vector of the most frequent items in the input.

resultA vector which will be filled with the most frequent items, in descending order of frequency. Items with the same frequency will be sorted in ascending alphabetical order.
itemsThe map from string to frequency, from which the most frequent items will be selected.
maxitemsThe maximum number of items to return.

Definition at line 265 of file matchspy.cc.

References Assert.

Referenced by Xapian::ValueCountMatchSpy::top_values_begin().

◆ unsupported_method()

static void unsupported_method ( )