AnalyzerDefinition
Read onlyYes
Declarative definition of a custom ArangoSearch analyzer — the unit the analyzer lifecycle tooling (`analyzerDiff()` / `analyzerSync()`, the `arango:analyzers` action and the `doctor`) reasons about. The analyzer counterpart of {@see \oihana\arango\db\options\indexes\IndexOptions}.
It bundles the three pieces a POST /_api/analyzer body needs: the
server-side name, the type-specific options (one of
IdentityAnalyzer,
TextAnalyzer,
NormAnalyzer,
StemAnalyzer) and the optional
features (entries of AnalyzerFeature).
Example:
new AnalyzerDefinition
(
'text_fr_custom' ,
new TextAnalyzer( locale: 'fr.utf-8' , case: 'lower' , accent: false , stemming: true ) ,
[ AnalyzerFeature::FREQUENCY , AnalyzerFeature::POSITION , AnalyzerFeature::NORM ] ,
) ;
Tags
Table of Contents
Properties
- $features : array<string|int, mixed>
- $name : string
- $options : AnalyzerOptions
Methods
- __construct() : mixed
Properties
$features
public
array<string|int, mixed>
$features
= []
$name
public
string
$name
$options
public
AnalyzerOptions
$options
Methods
__construct()
public
__construct(string $name, AnalyzerOptions $options[, array<int, string> $features = [] ]) : mixed
Parameters
- $name : string
-
The server-side analyzer name (short form, without the
dbname::prefix). - $options : AnalyzerOptions
-
The type-specific analyzer options.
- $features : array<int, string> = []
-
Optional analyzer features (AnalyzerFeature).