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    public const NEGATIVE_BOOST = 0.2;
15
16    /**
17     * Set the positive query for this Boosting Query.
18     *
19     * @return $this
20     */
21    public function setPositiveQuery(AbstractQuery $query): self
22    {
23        return $this->setParam('positive', $query);
24    }
25
26    /**
27     * Set the negative query for this Boosting Query.
28     *
29     * @return $this
30     */
31    public function setNegativeQuery(AbstractQuery $query): self
32    {
33        return $this->setParam('negative', $query);
34    }
35
36    /**
37     * Set the negative_boost parameter for this Boosting Query.
38     *
39     * @return $this
40     */
41    public function setNegativeBoost(float $negativeBoost): self
42    {
43        return $this->setParam('negative_boost', $negativeBoost);
44    }
45}
46