VectorQuery
in package
Table of Contents
- $base64VectorQuery : string|null
- $boost : float|null
- $numCandidates : int
- $vectorFieldName : string
- $vectorQuery : array<string|int, mixed>|null
- __construct() : mixed
- boost() : VectorQuery
- Sets the boost for this query.
- build() : VectorQuery
- Static helper to keep code more readable
- numCandidates() : VectorQuery
- Sets the number of results that will be returned from this vector query. Defaults to 3.
Properties
$base64VectorQuery
private
string|null
$base64VectorQuery
= null
$boost
private
float|null
$boost
= null
$numCandidates
private
int
$numCandidates
$vectorFieldName
private
string
$vectorFieldName
$vectorQuery
private
array<string|int, mixed>|null
$vectorQuery
= null
Methods
__construct()
public
__construct(string $vectorFieldName, array<string|int, float>|string $vectorQuery) : mixed
Parameters
- $vectorFieldName : string
-
the document field that contains the vector
- $vectorQuery : array<string|int, float>|string
-
the vector query to run. Cannot be empty. Either a vector array, or a base64-encoded sequence of little-endian IEEE 754 floats.
Tags
Return values
mixed —boost()
Sets the boost for this query.
public
boost(float $boost) : VectorQuery
Parameters
- $boost : float
-
the boost value to use.
Tags
Return values
VectorQuery —build()
Static helper to keep code more readable
public
static build(string $vectorFieldName, array<string|int, float>|string $vectorQuery) : VectorQuery
Parameters
- $vectorFieldName : string
-
the document field that contains the vector
- $vectorQuery : array<string|int, float>|string
-
the vector query to run. Cannot be empty. Either a vector array, or the vector query encoded into a base64 string.
Tags
Return values
VectorQuery —numCandidates()
Sets the number of results that will be returned from this vector query. Defaults to 3.
public
numCandidates(int $numCandidates) : VectorQuery
Parameters
- $numCandidates : int
-
the number of results returned.