ArangoSearchLink
Recursive value object describing a single link entry of an ArangoSearch view (either at the top level of the `links` map — one entry per indexed collection — or nested under the `fields` key of a parent link, for per-attribute analyzer chains).
The structure is self-referential: every link can carry its own
fields map, where each value is another ArangoSearchLink
describing the indexing strategy for that sub-attribute. The
recursion is unbounded server-side, but is typically limited to
one or two levels in practice.
Example — index the title and body fields of articles
with two different analyzers:
$link = new ArangoSearchLink
(
analyzers : [ 'identity' ] ,
fields :
[
'title' => new ArangoSearchLink( analyzers : [ 'text_en' ] ) ,
'body' => new ArangoSearchLink
(
analyzers : [ 'text_en' , 'stem_en' ] ,
trackListPositions : true ,
) ,
] ,
) ;
$db->createView( 'articles_view' , links : [ 'articles' => $link ] ) ;
Tags
Table of Contents
Properties
- $analyzers : array<string|int, mixed>|null
- $fields : array<string|int, mixed>|null
- $inBackground : bool|null
- $includeAllFields : bool|null
- $storeValues : string|null
- $trackListPositions : bool|null
Methods
- __construct() : mixed
- toArray() : array<string, mixed>
- Serialises this link (and recursively its `fields` children) into the array shape expected by `POST /_api/view` and the `PATCH|PUT /_api/view/{name}/properties` endpoints.
Properties
$analyzers
public
array<string|int, mixed>|null
$analyzers
= null
$fields
public
array<string|int, mixed>|null
$fields
= null
$inBackground
public
bool|null
$inBackground
= null
$includeAllFields
public
bool|null
$includeAllFields
= null
$storeValues
public
string|null
$storeValues
= null
$trackListPositions
public
bool|null
$trackListPositions
= null
Methods
__construct()
public
__construct([array<int, string>|null $analyzers = null ][, array<string, ArangoSearchLink>|null $fields = null ][, bool|null $includeAllFields = null ][, bool|null $trackListPositions = null ][, string|null $storeValues = null ][, bool|null $inBackground = null ]) : mixed
Parameters
- $analyzers : array<int, string>|null = null
-
List of analyzer names applied at this level. Defaults to
["identity"]server-side when omitted. - $fields : array<string, ArangoSearchLink>|null = null
-
Per-attribute nested link map. Each value is another ArangoSearchLink.
- $includeAllFields : bool|null = null
-
Whether every attribute of the document is indexed regardless of the
fieldswhitelist. Defaults tofalseserver-side. - $trackListPositions : bool|null = null
-
Whether the view records the ordinal position of each value in array attributes. Defaults to
falseserver-side. - $storeValues : string|null = null
-
Per-link / per-field
storeValuesstrategy — entries of StoreValues. Defaults to"none"server-side. - $inBackground : bool|null = null
-
Whether to build the index in the background, without blocking concurrent writes. Defaults to
falseserver-side. Top-level link only — ignored on nestedfieldsentries.
toArray()
Serialises this link (and recursively its `fields` children) into the array shape expected by `POST /_api/view` and the `PATCH|PUT /_api/view/{name}/properties` endpoints.
public
toArray() : array<string, mixed>
Null fields are omitted from the output so the server applies its own defaults — keeps the wire payload compact and round-trip-friendly.