RawAnalyzer implements AnalyzerOptions
Raw, type-agnostic analyzer options — carries a verbatim `type` discriminator and `properties` map instead of the named arguments of a typed value object ({@see TextAnalyzer}, {@see NormAnalyzer}, {@see StemAnalyzer}, {@see IdentityAnalyzer}).
It is the round-trip companion of the typed analyzers: where those build
their properties from named constructor arguments, a RawAnalyzer simply
re-emits a properties array obtained elsewhere — typically dumped from an
existing AnalyzerOptions::toArray(). That is what the
arango:analyzers --fix action writes into a repair migration, so the
migration body stays a flat literal (new RawAnalyzer( 'text' , [ … ] ))
instead of reconstructing the original typed constructor call.
Like IdentityAnalyzer, an empty properties map round-trips as an
empty object (}), the shape the server expects.
Example:
new RawAnalyzer( 'text' , [ 'locale' => 'fr.utf-8' , 'case' => 'lower' , 'accent' => false ] ) ;
Tags
Table of Contents
Interfaces
- AnalyzerOptions
- Common contract for every analyzer definition consumable by {@see \oihana\arango\clients\Database::createAnalyzer()} and {@see Analyzer::create()}.
Properties
- $properties : array<string|int, mixed>
- $type : string
Methods
- __construct() : mixed
- toArray() : array<string, mixed>
- Returns the `{ type, properties }` fragment of a `POST /_api/analyzer` body corresponding to this analyzer definition.
Properties
$properties
public
array<string|int, mixed>
$properties
= []
$type
public
string
$type
Methods
__construct()
public
__construct(string $type[, array<string, mixed> $properties = [] ]) : mixed
Parameters
- $type : string
-
The analyzer type discriminator (AnalyzerType).
- $properties : array<string, mixed> = []
-
The type-specific properties; an empty array round-trips as an empty object (
}).
toArray()
Returns the `{ type, properties }` fragment of a `POST /_api/analyzer` body corresponding to this analyzer definition.
public
toArray() : array<string, mixed>