MatchSearchQuery
in package
implements
JsonSerializable, SearchQuery
A FTS query that matches a given term, applying further processing to it like analyzers, stemming and even #fuzziness(int).
Interfaces, Classes, Traits and Enums
- JsonSerializable
- SearchQuery
- Common interface for all classes, which could be used as a body of SearchQuery
Table of Contents
- OPERATOR_AND = "and"
- OPERATOR_OR = "or"
- $analyzer : string|null
- $boost : float|null
- $field : string|null
- $fuzziness : int|null
- $match : string
- $operator : string|null
- $prefixLength : int|null
- __construct() : mixed
- analyzer() : MatchSearchQuery
- Sets the analytics for this query.
- boost() : MatchSearchQuery
- Sets the boost for this query.
- build() : MatchSearchQuery
- Static helper to keep code more readable
- field() : MatchSearchQuery
- Sets the field for this query.
- fuzziness() : MatchSearchQuery
- Set the fuzziness for this query.
- operator() : MatchSearchQuery
- Set the operator for this query.
- prefixLength() : MatchSearchQuery
- Sets the prefix length for this query.
Constants
OPERATOR_AND
public
mixed
OPERATOR_AND
= "and"
OPERATOR_OR
public
mixed
OPERATOR_OR
= "or"
Properties
$analyzer
private
string|null
$analyzer
= null
$boost
private
float|null
$boost
= null
$field
private
string|null
$field
= null
$fuzziness
private
int|null
$fuzziness
= null
$match
private
string
$match
$operator
private
string|null
$operator
= null
$prefixLength
private
int|null
$prefixLength
= null
Methods
__construct()
public
__construct(string $match) : mixed
Parameters
- $match : string
Return values
mixed —analyzer()
Sets the analytics for this query.
public
analyzer(string $analyzer) : MatchSearchQuery
Parameters
- $analyzer : string
-
the analyzer to use for this query.
Tags
Return values
MatchSearchQuery —boost()
Sets the boost for this query.
public
boost(float $boost) : MatchSearchQuery
Parameters
- $boost : float
-
the boost value to use.
Tags
Return values
MatchSearchQuery —build()
Static helper to keep code more readable
public
static build(string $match) : MatchSearchQuery
Parameters
- $match : string
Tags
Return values
MatchSearchQuery —field()
Sets the field for this query.
public
field(string $field) : MatchSearchQuery
Parameters
- $field : string
-
the field to use.
Tags
Return values
MatchSearchQuery —fuzziness()
Set the fuzziness for this query.
public
fuzziness(int $fuzziness) : MatchSearchQuery
Parameters
- $fuzziness : int
-
the fuzziness to use.
Tags
Return values
MatchSearchQuery —operator()
Set the operator for this query.
public
operator(string $operator) : MatchSearchQuery
Parameters
- $operator : string
-
the operator to use.
Tags
Return values
MatchSearchQuery —prefixLength()
Sets the prefix length for this query.
public
prefixLength(int $prefixLength) : MatchSearchQuery
Parameters
- $prefixLength : int
-
the prefix length to use.