SearchAliasView
Declarative definition of a `search-alias` view — the unit the view lifecycle tooling (`searchAliasViewDiff()` / `searchAliasViewSync()` and the `arango:views` action) reasons about. The federation counterpart of {@see \oihana\arango\db\options\analyzers\AnalyzerDefinition}.
A search-alias view is a thin alias over one inverted index per collection;
it owns no links. This value object bundles the name, the {collection, index}
entries, and any extra create options.
The indexes argument accepts two equivalent forms — normalized by
getIndexes() into the server-ready list of
{ collection, index } objects:
- Convenience map —
[ 'customers' => 'inv_search', 'products' => 'inv_search' ](collection name → inverted-index name), - Explicit list —
[ [ ViewField::COLLECTION => 'customers', ViewField::INDEX => 'inv_search' ], … ].
Example:
new SearchAliasView
(
'global_search' ,
[ 'customers' => 'inv_search' , 'products' => 'inv_search' ] ,
) ;
Tags
Table of Contents
Properties
Methods
- __construct() : mixed
- getIndexes() : array<int, array{collection: string, index: string}>
- Returns the `indexes` normalized to the server-ready list of `{ collection, index }` objects, accepting either declaration form (collection→index map or explicit list). Malformed entries are dropped.
Properties
$indexes
public
array<string|int, mixed>
$indexes
= []
$name
public
string
$name
$options
public
array<string|int, mixed>
$options
= []
Methods
__construct()
public
__construct(string $name[, array<string|int, mixed> $indexes = [] ][, array<string, mixed> $options = [] ]) : mixed
Parameters
- $name : string
-
The view name (local to the database).
- $indexes : array<string|int, mixed> = []
-
The
{collection, index}entries — acollection => indexmap or an explicit list of{collection, index}. - $options : array<string, mixed> = []
-
Extra create options forwarded verbatim to the server.
getIndexes()
Returns the `indexes` normalized to the server-ready list of `{ collection, index }` objects, accepting either declaration form (collection→index map or explicit list). Malformed entries are dropped.
public
getIndexes() : array<int, array{collection: string, index: string}>