public function prefix($key, $value, $bool = "must", $filter = false, array $params = []) {
        if (is_array($key)) {
            return $this->multiPrefix($key, $value, $bool, $filter, $params);
        }
        if (is_array($value)) {
            return $this->prefixs($key, $value, $bool, $filter, $params);
        }
        $this->addBool($this->makeFilteredQuery(["prefix" => [$key => $value]], $filter), $bool, $filter, $params);
        return $this;
    }
public function prefix($key, $value, $bool = "must", $filter = false, array $params = []) {
        if (is_array($key)) {
            return $this->multiPrefix($key, $value, $bool, $filter, $params);
        }
        if (is_array($value)) {
            return $this->prefixs($key, $value, $bool, $filter, $params);
        }
        $this->addBool($this->makeFilteredQuery(["prefix" => [$key => $value]], $filter), $bool, $filter, $params);
        return $this;
    }
public function prefix ( $ key , $ value , $ bool = "must" , $ filter = false , array $ params = [ ] ) { if ( is_array ( $ key ) ) { return $ this -> multiPrefix ( $ key , $ value , $ bool , $ filter , $ params ) ; } if ( is_array ( $ value ) ) { return $ this -> prefixs ( $ key , $ value , $ bool , $ filter , $ params ) ; } $ this -> addBool ( $ this -> makeFilteredQuery ( [ "prefix" => [ $ key => $ value ] ] , $ filter ) , $ bool , $ filter , $ params ) ; return $ this ; }
Creates a prefix query part.

It will automatically detect the $key and $value types to create the
required number of clauses, as follows:

$key         $value      result

single       single      {prefix:{$key:{prefix:$value}}}
single       array       or:[prefix($key, $value[1]), ...]
array        single      or:[prefix($key[1], $value), ...]
array        array       or:[prefix($key[1], $value[1]),
prefix($key[1], $value[2]), ...
prefix($key[2], $value[1]), ... ]

If $filter is true, it will enclose the prefix query with `query`
filter and add it to the DSL query filter section instead the query
section.

@param string|string[] $key the key(s) to prefix search in.
@param string|string[] $value the value(s) to prefix search against.
@param string $bool severity of the query/filter. [must]|must_not|should
@param bool $filter if true, DSL query filter section will be used after
enclosing in a `query` filter.
@param array $params extra parameters for the query tool
@return QueryBuilder|static|self
Creates a prefix query part .