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     * Sets window_size.
18     *
19     * @return $this
20     */
21    public function setWindowSize(int $size): AbstractRescore
22    {
23        return $this->setParam('window_size', $size);
24    }
25
26    /**
27     * Overridden to return rescore as name.
28     *
29     * @return string name
30     */
31    protected function _getBaseName(): string
32    {
33        return 'rescore';
34    }
35}
36