summaryrefslogtreecommitdiff
path: root/vendor/ruflin/elastica/lib/Elastica/Facet/Query.php
blob: d43a2375dfe182382b9046b6c3dd1683a883b128 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<?php

namespace Elastica\Facet;

use Elastica\Query\AbstractQuery;

/**
 * Query facet
 *
 * @category Xodoa
 * @package Elastica
 * @author Nicolas Ruflin <spam@ruflin.com>
 * @link http://www.elasticsearch.org/guide/reference/api/search/facets/query-facet.html
 */
class Query extends AbstractFacet
{
    /**
     * Set the query for the facet.
     *
     * @param  \Elastica\Query\AbstractQuery $query
     * @return \Elastica\Facet\Query
     */
    public function setQuery(AbstractQuery $query)
    {
        return $this->_setFacetParam('query', $query->toArray());
    }
}