xapian :: Query :: Class Query |
[hide private]
[frames] | no frames]

# Class Query

    Class representing a query.

    Queries are represented as a tree of objects.

Instance Methods | [hide private]
__init__(self, *args) Construct a value range query on a document value. |
__iter__(self) Get an iterator over the terms in a query. |
__repr__(self) repr(x) |
__str__(...) Return a string describing this object. |
__swig_destroy__(...) Destructor. |
empty(...) Test if the query is empty (i.e. |
get_description(...) Return a string describing this object. |
get_length(...) Get the length of the query, used by some ranking formulae. |
get_terms_begin(...) Return a Xapian::TermIterator returning all the terms in the query, in order of termpos. |
get_terms_end(...) Return a Xapian::TermIterator to the end of the list of terms in the query. |
Inherited from `object`: `__delattr__`, `__getattribute__`, `__hash__`, `__new__`, `__reduce__`, `__reduce_ex__`, `__setattr__`

Class Variables | [hide private]
| OP_AND = `0`
| OP_AND_MAYBE = `4`
| OP_AND_NOT = `2`
| OP_ELITE_SET = `10`
| OP_FILTER = `5`
| OP_NEAR = `6`
| OP_OR = `1`
| OP_PHRASE = `7`
| OP_SCALE_WEIGHT = `9`
| OP_VALUE_RANGE = `8`
| OP_XOR = `3`

Properties | [hide private]
| thisown The membership flag
Inherited from `object`: `__class__`

Method Details | [hide private]

### __init__(self, *args) (Constructor) |
    Construct a value range query on a document value.

    Xapian::Query::Query(Query::op op_, Xapian::valueno valno, const
    std::string &begin, const std::string &end)

    A value range query matches those documents which have a value stored
    in the slot given by valno which is in the range specified by begin
    and end (in lexicographical order), including the endpoints.

    Parameters:
    -----------

    op_:  The operator to use for the query. Currently, must be
    OP_VALUE_RANGE.

    valno:  The slot number to get the value from.

    begin:  The start of the range.

    end:  The end of the range.
Overrides: object.__init__

### __iter__(self) |
    Get an iterator over the terms in a query.

    The iterator will return string objects.

### __repr__(self) (Representation operator) |
repr(x) Overrides: object.__repr__ (inherited documentation)

### __str__(...) (Informal representation operator) |
    Return a string describing this object.

    std::string Xapian::Query::get_description() const
Overrides: object.__str__

### __swig_destroy__(...) |
Destructor. Xapian::Query::~Query()

### empty(...) |
    Test if the query is empty (i.e.

    bool Xapian::Query::empty() const

    was constructed using the default ctor or with an empty iterator
    ctor).

### get_description(...) |
    Return a string describing this object.

    std::string Xapian::Query::get_description() const

### get_length(...) |
    Get the length of the query, used by some ranking formulae.

    Xapian::termcount Xapian::Query::get_length() const

    This value is calculated automatically - if you want to override it
    you can pass a different value to Enquire::set_query().

### get_terms_begin(...) |
    Return a Xapian::TermIterator returning all the terms in the query, in
    order of termpos.

    TermIterator Xapian::Query::get_terms_begin() const

    If multiple terms have the same term position, their order is
    unspecified. Duplicates (same term and termpos) will be removed.

### get_terms_end(...) |
    Return a Xapian::TermIterator to the end of the list of terms in the
    query.

    TermIterator Xapian::Query::get_terms_end() const

Property Details | [hide private]

### thisown
    The membership flag
Get Method: unreachable(x) Set Method: unreachable(x, v)