xapian-core  1.4.21
Public Member Functions | Private Attributes | List of all members
Xapian::ValueSetMatchDecider Class Reference

MatchDecider filtering results based on whether document values are in a user-defined set. More...

#include <valuesetmatchdecider.h>

+ Inheritance diagram for Xapian::ValueSetMatchDecider:
+ Collaboration diagram for Xapian::ValueSetMatchDecider:

Public Member Functions

 ValueSetMatchDecider (Xapian::valueno slot, bool inclusive_)
 Construct a ValueSetMatchDecider. More...
 
void add_value (const std::string &value)
 Add a value to the test set. More...
 
void remove_value (const std::string &value)
 Remove a value from the test set. More...
 
bool operator() (const Xapian::Document &doc) const
 Decide whether we want a particular document to be in the MSet. More...
 
- Public Member Functions inherited from Xapian::MatchDecider
 MatchDecider ()
 Default constructor. More...
 
virtual ~MatchDecider ()
 Destructor. More...
 

Private Attributes

std::set< std::string > testset
 Set of values to test for. More...
 
valueno valuenum
 The value slot to look in. More...
 
bool inclusive
 Whether to include or exclude documents with the specified values. More...
 

Detailed Description

MatchDecider filtering results based on whether document values are in a user-defined set.

Definition at line 44 of file valuesetmatchdecider.h.

Constructor & Destructor Documentation

◆ ValueSetMatchDecider()

Xapian::ValueSetMatchDecider::ValueSetMatchDecider ( Xapian::valueno  slot,
bool  inclusive_ 
)
inline

Construct a ValueSetMatchDecider.

Parameters
slotThe value slot number to look in.
inclusive_If true, match decider accepts documents which have a value in the specified slot which is a member of the test set; if false, match decider accepts documents which do not have a value in the specified slot.

Definition at line 68 of file valuesetmatchdecider.h.

Member Function Documentation

◆ add_value()

void Xapian::ValueSetMatchDecider::add_value ( const std::string &  value)
inline

Add a value to the test set.

Parameters
valueThe value to add to the test set.

Definition at line 75 of file valuesetmatchdecider.h.

Referenced by DEFINE_TESTCASE().

◆ operator()()

bool Xapian::ValueSetMatchDecider::operator() ( const Xapian::Document doc) const
virtual

Decide whether we want a particular document to be in the MSet.

Parameters
docThe document to test.
Returns
true if the document is acceptable, or false if the document should be excluded from the MSet.

Implements Xapian::MatchDecider.

Definition at line 34 of file valuesetmatchdecider.cc.

References Xapian::Document::get_value().

◆ remove_value()

void Xapian::ValueSetMatchDecider::remove_value ( const std::string &  value)
inline

Remove a value from the test set.

Parameters
valueThe value to remove from the test set.

Definition at line 84 of file valuesetmatchdecider.h.

Referenced by DEFINE_TESTCASE().

Member Data Documentation

◆ inclusive

bool Xapian::ValueSetMatchDecider::inclusive
private

Whether to include or exclude documents with the specified values.

If true, documents with a value in the set are returned. If false, documents with a value not in the set are returned.

Definition at line 56 of file valuesetmatchdecider.h.

◆ testset

std::set<std::string> Xapian::ValueSetMatchDecider::testset
private

Set of values to test for.

Definition at line 46 of file valuesetmatchdecider.h.

◆ valuenum

valueno Xapian::ValueSetMatchDecider::valuenum
private

The value slot to look in.

Definition at line 49 of file valuesetmatchdecider.h.


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