xapian-core  1.5.0
Public Member Functions | List of all members
Xapian::UnitRangeProcessor Class Reference

Handle a byte unit range. More...

+ Inheritance diagram for Xapian::UnitRangeProcessor:

Public Member Functions

 UnitRangeProcessor (Xapian::valueno slot_, const std::string &str_=std::string())
 Constructor. More...
 
Xapian::Query operator() (const std::string &begin, const std::string &end)
 Check for a valid byte value range. More...
 
- Public Member Functions inherited from Xapian::RangeProcessor
 RangeProcessor ()
 Default constructor.
 
 RangeProcessor (Xapian::valueno slot_, const std::string &str_=std::string(), unsigned flags_=0)
 Constructor. More...
 
virtual ~RangeProcessor ()
 Destructor.
 
Xapian::Query check_range (const std::string &b, const std::string &e)
 Check prefix/suffix on range. More...
 
RangeProcessorrelease ()
 Start reference counting this object. More...
 
const RangeProcessorrelease () const
 Start reference counting this object. More...
 

Additional Inherited Members

- Protected Attributes inherited from Xapian::RangeProcessor
Xapian::valueno slot
 The value slot to process. More...
 
std::string str
 The prefix (or suffix with RP_SUFFIX) string to look for.
 
unsigned flags
 Flags. More...
 

Detailed Description

Handle a byte unit range.

This class must be used on values which have been encoded using Xapian::sortable_serialise() which turns numbers into strings which will sort in the same order as the numbers (the same values can be used to implement a numeric sort).

Constructor & Destructor Documentation

◆ UnitRangeProcessor()

Xapian::UnitRangeProcessor::UnitRangeProcessor ( Xapian::valueno  slot_,
const std::string &  str_ = std::string() 
)
inline

Constructor.

Parameters
slot_The value slot number to query.
str_A string to look for to recognise values as belonging to this numeric range.

The string supplied in str_ is the prefix plus ":" that defines the field upon which the range query is performed.

For example, if str_ is "size:", and the range processor has been added to the queryparser, the queryparser will accept "size:3K..10K" as a valid range.

Member Function Documentation

◆ operator()()

Xapian::Query Xapian::UnitRangeProcessor::operator() ( const std::string &  begin,
const std::string &  end 
)
virtual

Check for a valid byte value range.

If BEGIN..END is a valid numeric byte range with the specified prefix the prefix is removed, the string converted to a number, unit normalized and encoded with Xapian::sortable_serialise(), and a value range query is built.

Parameters
beginThe start of the range as specified in the query string by the user.
endThe end of the range as specified in the query string by the user.

Reimplemented from Xapian::RangeProcessor.


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