Oihana PHP Arango

VectorIndexOptions extends IndexOptions

The options of a vector index.

Table of Contents

Constants

CACHE_ENABLED  : string = 'cacheEnabled'
DEDUPLICATE  : string = 'deduplicate'
ESTIMATES  : string = 'estimates'
EXPIRE_AFTER  : string = 'expireAfter'
FIELD_VALUE_TYPES  : string = 'fieldValueTypes'
FIELDS  : string = 'fields'
GEO_JSON  : string = 'geoJson'
IN_BACKGROUND  : string = 'inBackground'
LEGACY_POLYGONS  : string = 'legacyPolygons'
NAME  : string = 'name'
PARALLELISM  : string = 'parallelism'
PARAMS  : string = 'params'
PREFIX_FIELDS  : string = 'prefixFields'
SPARSE  : string = 'sparse'
STORED_VALUE  : string = 'storedValue'
TYPE  : string = 'type'
UNIQUE  : string = 'unique'

Properties

$fields  : array<string|int, mixed>
An array of attribute paths, containing the document attributes (or sub-attributes) to be indexed.
$geoJson  : bool
If you create a geo-spatial index over a single attribute and geoJson is true, then the coordinate order within the attribute’s array is longitude followed by latitude.
$inBackground  : bool
Set this option to true to keep the collection/shards available for write operations by not using an exclusive write lock for the duration of the index creation.
$name  : string
An easy-to-remember name for the index to look it up or refer to it in index hints.
$parallelism  : int
The number of threads to use for indexing.
$params  : array<string|int, mixed>
The parameters as used by the Faiss library.
$sparse  : bool
Can be true or false.
$storedValues  : array<string|int, mixed>
The optional storedValues attribute can contain an array of paths to additional attributes to store in the index.
$type  : string
Can be one of the following values: - "persistent": persistent (array) index, including vertex-centric index - "inverted": inverted index - "ttl": time-to-live index - "fulltext": full-text index (deprecated from ArangoDB 3.10 onwards) - "geo": geo-spatial index, with one or two attributes - "mdi": multi-dimensional index - "mdi-prefixed": multi-dimensional index with search prefix, including vertex-centric index

Methods

__construct()  : mixed
Creates a new IndexOptions instance.
jsonSerialize()  : array<string|int, mixed>
Invoked to serialize the object with the json serializer.

Constants

Properties

$fields

An array of attribute paths, containing the document attributes (or sub-attributes) to be indexed.

public array<string|int, mixed> $fields = []

Some indexes allow using only a single path, and others allow multiple. If multiple attributes are used, their order matters.

The '.' character denotes sub-attributes in attribute paths.

Attributes with literal '.' in their name cannot be indexed. Attributes with the name _id cannot be indexed either, neither as a top-level attribute nor as a sub-attribute (except the inverted index type).

If an attribute path contains an [] extension (e.g. friends[].id), it means that the index attribute value is treated as an array and all array members are indexed separately.

This is possible with persistent and inverted indexes.

Tags
see
https://docs.arango.ai/arangodb/stable/develop/http-api/indexes/

$geoJson

If you create a geo-spatial index over a single attribute and geoJson is true, then the coordinate order within the attribute’s array is longitude followed by latitude.

public bool $geoJson = false

This corresponds to the format described in http://geojson.org/geojson-spec.html#positions

$inBackground

Set this option to true to keep the collection/shards available for write operations by not using an exclusive write lock for the duration of the index creation.

public bool $inBackground = false

$name

An easy-to-remember name for the index to look it up or refer to it in index hints.

public string $name

Index names are subject to the same character restrictions as collection names.

If omitted, a name is auto-generated so that it is unique with respect to the collection, e.g. idx_832910498.

$parallelism

The number of threads to use for indexing.

public int $parallelism = 2

$sparse

Can be true or false.

public bool $sparse = false

You can control the sparsity for persistent, mdi, and mdi-prefixed indexes.

The inverted, fulltext, and geo index types are sparse by definition.

$storedValues

The optional storedValues attribute can contain an array of paths to additional attributes to store in the index.

public array<string|int, mixed> $storedValues = []

These additional attributes cannot be used for index lookups or for sorting, but they can be used for projections. This allows an index to fully cover more queries and avoid extra document lookups.

The maximum number of attributes in storedValues is 32.

It is not possible to create multiple indexes with the same fields attributes and uniqueness but different storedValues attributes. That means the value of storedValues is not considered by index creation calls when checking if an index is already present or needs to be created.

In unique indexes, only the attributes in fields are checked for uniqueness, but the attributes in storedValues are not checked for their uniqueness.

Non-existing attributes are stored as null values inside storedValues.

$type

Can be one of the following values: - "persistent": persistent (array) index, including vertex-centric index - "inverted": inverted index - "ttl": time-to-live index - "fulltext": full-text index (deprecated from ArangoDB 3.10 onwards) - "geo": geo-spatial index, with one or two attributes - "mdi": multi-dimensional index - "mdi-prefixed": multi-dimensional index with search prefix, including vertex-centric index

public string $type = \oihana\arango\db\enums\IndexType::VECTOR

Methods

__construct()

Creates a new IndexOptions instance.

public __construct([array<string|int, mixed>|object|null $init = null ]) : mixed
Parameters
$init : array<string|int, mixed>|object|null = null

A generic object containing properties with which to populate the newly instance. If this argument is null, it is ignored.

jsonSerialize()

Invoked to serialize the object with the json serializer.

public jsonSerialize() : array<string|int, mixed>
Tags
throws
ReflectionException
Return values
array<string|int, mixed>
On this page

Search results