Search in this section

Child pages
  • Where Element
Skip to end of metadata
Go to start of metadata


Table of contents

Description

The where element is responsible for defining the search criteria in a search query.

Structure

KeyOccursTypFormatDescription
key0 - 1String

The keyword

operator0 - 1enumOperatorType EnumThe comparison operator
value0 - 1String
The value contained within the keyword
and0 - 1String
"and" condition
or0 - 1String
"or" condition

XML Example

XML
<where>
    <key>name</key>
    <operator>eq</operator>
    <value>domain.com</value>
</where>
XML
<where>
    <and>
        <and>
            <key>name</key>
            <operator>eq</operator>
            <value>domain.com</value>
        </and>
        <and>
            <key>expire</key>
            <operator>gt</operator>
            <value>2018-12-31 00:00:00</value>
        </and>
    </and>
</where>

Code Example

Where Component Java
@XmlRootElement(name = "where")
public class Where {

    @XmlElement(name="key")
    private String key;

    @XmlElement(name="operator")
    private OperatorType operator;

    @XmlElement(name="value")
    private String value;

    /* Getter + Setter */

}
Where Component PHP
class Where {

    /**
     *
     * @var type String
     */
    public $key;

    /**
     *
     * @var type OperatorType
     */
    public $operator;

    /**
     *
     * @var type String
     */
    public $value;

    /* Getter + Setter */

}
Where Component C#
public class Where {

    private String key;

    private OperatorType operator;

    private String value;

    /* Getter + Setter */

}