PhraseSearchQuery
in package
implements
JsonSerializable, SearchQuery
A FTS query that matches several terms (a "phrase") as is. The order of the terms mater and no further processing is applied to them, so they must appear in the index exactly as provided. Usually for debugging purposes, prefer MatchPhraseQuery.
Interfaces, Classes, Traits and Enums
- JsonSerializable
- SearchQuery
- Common interface for all classes, which could be used as a body of SearchQuery
Table of Contents
- $boost : float|null
- $field : string|null
- $terms : array<string|int, mixed>
- __construct() : mixed
- boost() : PhraseSearchQuery
- Sets the boost for this query.
- build() : PhraseSearchQuery
- Static helper to keep code more readable
- field() : PhraseSearchQuery
- Sets the field for this query.
Properties
$boost
private
float|null
$boost
= null
$field
private
string|null
$field
= null
$terms
private
array<string|int, mixed>
$terms
Methods
__construct()
public
__construct(string ...$terms) : mixed
Parameters
- $terms : string
Return values
mixed —boost()
Sets the boost for this query.
public
boost(float $boost) : PhraseSearchQuery
Parameters
- $boost : float
-
the boost value to use.
Tags
Return values
PhraseSearchQuery —build()
Static helper to keep code more readable
public
static build(string ...$terms) : PhraseSearchQuery
Parameters
- $terms : string
Tags
Return values
PhraseSearchQuery —field()
Sets the field for this query.
public
field(string $field) : PhraseSearchQuery
Parameters
- $field : string
-
the field to use.