Oihana PHP Arango

RawIndexDefinition implements IndexDefinition

Read onlyYes

Escape hatch for callers that hold the raw `POST /_api/index` body shape (typically built dynamically, deserialised from configuration, or produced by a legacy DTO).

Wraps an associative array and exposes it through the IndexDefinition contract so it can be passed to Collection::createIndex().

Prefer the typed DTOs (PersistentIndex, GeoIndex, TtlIndex, MDIIndex, VectorIndex, InvertedIndex, FulltextIndex) whenever the configuration is known at compile time — this class is intended for the edge cases where the body must remain a plain array.

Example:

$col->createIndex
(
    new RawIndexDefinition
    ([
        'type'   => 'persistent' ,
        'fields' => [ 'email' ] ,
        'unique' => true ,
    ])
) ;
Tags
author

Marc Alcaraz (ekameleon)

since
1.0.0

Table of Contents

Interfaces

IndexDefinition
Common contract for every index definition consumable by {@see \oihana\arango\clients\collection\Collection::createIndex()}.

Properties

$body  : array<string|int, mixed>

Methods

__construct()  : mixed
toArray()  : array<string, mixed>
Returns the wrapped body unchanged.

Properties

Methods

__construct()

public __construct(array<string, mixed> $body) : mixed
Parameters
$body : array<string, mixed>

Raw request body as expected by POST /_api/index.

toArray()

Returns the wrapped body unchanged.

public toArray() : array<string, mixed>
Return values
array<string, mixed>
On this page

Search results