Oihana PHP Arango

SearchAliasView

Read onlyYes

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
author

Marc Alcaraz (ekameleon)

since
1.3.0

Table of Contents

Properties

$indexes  : array<string|int, mixed>
$name  : string
$options  : array<string|int, mixed>

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

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 — a collection => index map 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}>
Return values
array<int, array{collection: string, index: string}>
On this page

Search results