Oihana PHP Arango

ArangoSearchLink

Read onlyYes

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
see
https://docs.arangodb.com/stable/index-and-search/arangosearch/arangosearch-views-reference/#link-properties
author

Marc Alcaraz (ekameleon)

since
1.0.0

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

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 fields whitelist. Defaults to false server-side.

$trackListPositions : bool|null = null

Whether the view records the ordinal position of each value in array attributes. Defaults to false server-side.

$storeValues : string|null = null

Per-link / per-field storeValues strategy — 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 false server-side. Top-level link only — ignored on nested fields entries.

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.

Return values
array<string, mixed>
On this page

Search results