1<?php
2
3namespace Elastica\Query;
4
5/**
6 * Class Boosting.
7 *
8 * @author Balazs Nadasdi <yitsushi@gmail.com>
9 *
10 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-boosting-query.html
11 */
12class Boosting extends AbstractQuery
13{
14    const NEGATIVE_BOOST = 0.2;
15
16    /**
17     * Set the positive query for this Boosting Query.
18     *
19     * @param AbstractQuery $query
20     *
21     * @return $this
22     */
23    public function setPositiveQuery(AbstractQuery $query): self
24    {
25        return $this->setParam('positive', $query);
26    }
27
28    /**
29     * Set the negative query for this Boosting Query.
30     *
31     * @param AbstractQuery $query
32     *
33     * @return $this
34     */
35    public function setNegativeQuery(AbstractQuery $query): self
36    {
37        return $this->setParam('negative', $query);
38    }
39
40    /**
41     * Set the negative_boost parameter for this Boosting Query.
42     *
43     * @param float $negativeBoost
44     *
45     * @return $this
46     */
47    public function setNegativeBoost(float $negativeBoost): self
48    {
49        return $this->setParam('negative_boost', $negativeBoost);
50    }
51}
52