• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

predis / predis / 19267225388

11 Nov 2025 01:31PM UTC coverage: 92.742% (-0.5%) from 93.197%
19267225388

push

github

web-flow
Added experimental support for FT.HYBRID (#1607)

* Added basic structures and test coverage

* Added most of the test coverage

* Added more test coverage

* Codestyle fixes

* Fixed static analysis

* ANother static analysis fix

* Codestyle fixes

* Fixed version constraints

* Added missing annotations

* Use class context

* Added more test coverage

* Codestyle fixes

* Added experimental mentioning

181 of 236 new or added lines in 12 files covered. (76.69%)

7948 of 8570 relevant lines covered (92.74%)

109.64 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

90.91
/src/Command/Argument/Search/HybridSearch/VectorSearch/BaseVectorSearchConfig.php
1
<?php
2

3
/*
4
 * This file is part of the Predis package.
5
 *
6
 * (c) 2009-2020 Daniele Alessandri
7
 * (c) 2021-2025 Till Krüss
8
 *
9
 * For the full copyright and license information, please view the LICENSE
10
 * file that was distributed with this source code.
11
 */
12

13
namespace Predis\Command\Argument\Search\HybridSearch\VectorSearch;
14

15
use Predis\Command\Argument\ArrayableArgument;
16
use Predis\Command\Redis\Utils\VectorUtility;
17

18
abstract class BaseVectorSearchConfig implements ArrayableArgument
19
{
20
    public const POLICY_ADHOC = 'ADHOC';
21
    public const POLICY_BATCHES = 'BATCHES';
22
    public const POLICY_ACORN = 'ACORN';
23

24
    /**
25
     * @var array
26
     */
27
    protected $vector = [];
28

29
    /**
30
     * @var array
31
     */
32
    protected $filter = [];
33

34
    /**
35
     * @var array
36
     */
37
    protected $as = [];
38

39
    /**
40
     * @var array
41
     */
42
    protected $arguments = ['VSIM'];
43

44
    /**
45
     * Vector to perform search against.
46
     *
47
     * @param  string         $field The vector field name to search against. Must start with "@".
48
     * @param  string|float[] $value Binary vector representation or array of floats as vector.
49
     * @return self
50
     */
51
    public function vector(string $field, $value): self
1✔
52
    {
53
        if (is_array($value)) {
1✔
54
            array_push($this->vector, $field, VectorUtility::toBlob($value));
1✔
55
        } else {
NEW
56
            array_push($this->vector, $field, $value);
×
57
        }
58

59
        return $this;
1✔
60
    }
61

62
    /**
63
     * @param  string $expression
64
     * @return $this
65
     */
66
    public function filter(string $expression): self
2✔
67
    {
68
        array_push($this->filter, 'FILTER', $expression);
2✔
69

70
        return $this;
2✔
71
    }
72

73
    /**
74
     * @param  string $alias
75
     * @return $this
76
     */
77
    public function as(string $alias): self
3✔
78
    {
79
        array_push($this->as, 'YIELD_SCORE_AS', $alias);
3✔
80

81
        return $this;
3✔
82
    }
83

84
    abstract public function toArray(): array;
85
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc