#include <query.h>
Public Types | |
enum | op { OP_AND, OP_OR, OP_AND_NOT, OP_XOR, OP_AND_MAYBE, OP_FILTER, OP_NEAR, OP_PHRASE, OP_WEIGHT_CUTOFF, OP_ELITE_SET } |
Enum of possible query operations. More... | |
Public Methods | |
Query (const Query ©me) | |
Copy constructor. More... | |
Query & | operator= (const Query ©me) |
Assignment. More... | |
Query () | |
Default constructor: makes an undefined query which can't be used directly. More... | |
~Query () | |
Destructor. More... | |
Query (const termname &tname, termcount wqf=1, termpos term_pos=0) | |
A query consisting of a single term. More... | |
Query (Query::op op_, const Query &left, const Query &right) | |
A query consisting of two subqueries, opp-ed together. More... | |
Query (Query::op op_, const termname &left, const termname &right) | |
A query consisting of two termnames opp-ed together. More... | |
template<class Iterator> | Query (Query::op op_, Iterator qbegin, Iterator qend) |
A set of Query's, merged together with specified operator. More... | |
template<class SubQ> | Query (Query::op op_, SubQ q) |
A single Query, modified by a specified operator. More... | |
void | set_window (termpos window) |
Set the window size, for a NEAR or PHRASE query. More... | |
void | set_cutoff (weight cutoff) |
Set the cutoff parameter, for a WEIGHT_CUTOFF query. More... | |
void | set_elite_set_size (termcount size) |
Set the elite set size, for ELITE_SET queries. More... | |
termcount | get_length () const |
Get the length of the query, used by some ranking formulae. More... | |
termcount | set_length (termcount qlen) |
Set the length of the query. More... | |
TermIterator | get_terms_begin () const |
Return an TermIterator returning all the terms in the query, in order of termpos. More... | |
TermIterator | get_terms_end () const |
Return an TermIterator to the end of the list of terms in the query. More... | |
bool | is_empty () const |
Test is the query is empty (i.e. was set using Query() or with. More... | |
std::string | get_description () const |
Returns a string representing the query. More... | |
Public Attributes | |
Internal * | internal |
Queries are represented as a hierarchy of classes.
|
|
Copy constructor.
|
|
Default constructor: makes an undefined query which can't be used directly. Such queries should be thought of as placeholders: they are provided merely for convenience. An exception will be thrown if an attempt is made to run an undefined query, or to use an undefined query when building up a composite query. |
|
Destructor.
|
|
A query consisting of a single term.
|
|
A query consisting of two subqueries, opp-ed together.
|
|
A query consisting of two termnames opp-ed together.
|
|
A set of Query's, merged together with specified operator. (Takes begin and end iterators). AND, OR, NEAR and PHRASE can take any number of subqueries. WEIGHT_CUTOFF takes only one subquery. If the operator is anything else then there must be exactly two subqueries. The iterators may be to any of: Query objects, pointers to Query objects, or termnames (ie, strings). |
|
A single Query, modified by a specified operator. The subquery may be any of: an Query object, Query pointer, or termname. |
|
Returns a string representing the query. Introspection method. |
|
Get the length of the query, used by some ranking formulae. This value is calculated automatically, but may be overridden using set_length(). |
|
Return an TermIterator returning all the terms in the query, in order of termpos. If multiple terms have the same term position, their order is unspecified. Duplicates (same term and termpos) will be removed. |
|
Return an TermIterator to the end of the list of terms in the query.
|
|
Test is the query is empty (i.e. was set using Query() or with.
|
|
Assignment.
|
|
Set the cutoff parameter, for a WEIGHT_CUTOFF query.
|
|
Set the elite set size, for ELITE_SET queries.
|
|
Set the length of the query. This overrides the automatically calculated value, which may be desirable in some situations. Returns the old value of the query length. |
|
Set the window size, for a NEAR or PHRASE query.
|