1<?php
2
3namespace Elastica\Rescore;
4
5use Elastica\Param;
6
7/**
8 * Abstract rescore object. Should be extended by all rescorers.
9 *
10 * @author Jason Hu <mjhu91@gmail.com>
11 *
12 * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-rescore.html
13 */
14abstract class AbstractRescore extends Param
15{
16    /**
17     * Overridden to return rescore as name.
18     *
19     * @return string name
20     */
21    protected function _getBaseName(): string
22    {
23        return 'rescore';
24    }
25
26    /**
27     * Sets window_size.
28     *
29     * @param int $size
30     *
31     * @return $this
32     */
33    public function setWindowSize(int $size): AbstractRescore
34    {
35        return $this->setParam('window_size', $size);
36    }
37}
38