|
xapian-core
1.5.0_git3747
|
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. More... | |
| 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... | |
| RangeProcessor * | release () |
| Start reference counting this object. More... | |
| const RangeProcessor * | release () 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. More... | |
| unsigned | flags |
| Flags. More... | |
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).
|
inline |
Constructor.
| 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.
|
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.
| begin | The start of the range as specified in the query string by the user. |
| end | The end of the range as specified in the query string by the user. |
Reimplemented from Xapian::RangeProcessor.