Oihana PHP Arango

FederatedSearchParam uses ConstantsTrait

The init keys of the {@see \oihana\arango\search\FederatedSearch} service — the federated multi-collection search engine configuration.

Tags
author

Marc Alcaraz (ekameleon)

since
1.3.0

Table of Contents

Constants

COLLECTION  : string = 'collection'
The structured {@see REQUIRES} sub-key holding the permission subject(s) required to search the collection **at all** — level 1 of the cascade (a subject string or an OR-list). Absent means the collection itself is public; its types may still be gated by {@see MAP} / {@see FALLBACK}.
DEFAULT_DISCRIMINATOR  : string = 'additionalType'
The default discriminator field used by a composite {@see MODELS} entry when its {@see DISCRIMINATOR} sub-key is omitted — the schema.org `additionalType`.
DISCRIMINATOR  : string = 'key'
The composite {@see MODELS} sub-key naming the document field that discriminates a polymorphic collection (defaults to {@see DEFAULT_DISCRIMINATOR}).
FALLBACK  : string = 'default'
The composite {@see MODELS} sub-key holding the fallback model-service-id used when no mapped type matches; absent/null means the hit is dropped.
MAP  : string = 'map'
The composite {@see MODELS} sub-key holding the `type => model-service-id` mapping. Declaration order is the resolution priority for a document that carries several types.
MODELS  : string = 'models'
The collection → model registry. Each value is either a **model-service-id** string (`'customers' => 'model.customers'`) or, for a **polymorphic** collection, a composite spec routing by a discriminator field: `[ DISCRIMINATOR => 'additionalType', MAP => [ '<type>' => 'model.x', … ], FALLBACK => 'model.y' ]`.
REQUIRES  : string = 'requires'
The collection → required permission registry: a map declaring which permission a collection demands to be searchable. A collection absent from this map is **public** (searchable by everyone); the gate is evaluated by {@see \oihana\arango\models\helpers\isAuthorized()}.
SEARCHABLE  : string = 'searchable'
The federated search specification — what to search across the heterogeneous collections (the fields and the analyzer), reusing the {@see \oihana\arango\models\enums\Search} vocabulary.
SKIN  : string = 'skin'
The default skin (projection variant) applied when rebuilding the matched documents — overridden per request by `?skin=`, and itself defaulting to {@see \oihana\controllers\enums\Skin::DEFAULT} when unset.
VIEW  : string = 'view'
The name of the `search-alias` view to query (the view aggregating one inverted index per collection — see {@see \oihana\arango\db\options\views\SearchAliasView}).

Constants

COLLECTION

The structured {@see REQUIRES} sub-key holding the permission subject(s) required to search the collection **at all** — level 1 of the cascade (a subject string or an OR-list). Absent means the collection itself is public; its types may still be gated by {@see MAP} / {@see FALLBACK}.

public string COLLECTION = 'collection'

DEFAULT_DISCRIMINATOR

The default discriminator field used by a composite {@see MODELS} entry when its {@see DISCRIMINATOR} sub-key is omitted — the schema.org `additionalType`.

public string DEFAULT_DISCRIMINATOR = 'additionalType'

DISCRIMINATOR

The composite {@see MODELS} sub-key naming the document field that discriminates a polymorphic collection (defaults to {@see DEFAULT_DISCRIMINATOR}).

public string DISCRIMINATOR = 'key'

FALLBACK

The composite {@see MODELS} sub-key holding the fallback model-service-id used when no mapped type matches; absent/null means the hit is dropped.

public string FALLBACK = 'default'

MAP

The composite {@see MODELS} sub-key holding the `type => model-service-id` mapping. Declaration order is the resolution priority for a document that carries several types.

public string MAP = 'map'

MODELS

The collection → model registry. Each value is either a **model-service-id** string (`'customers' => 'model.customers'`) or, for a **polymorphic** collection, a composite spec routing by a discriminator field: `[ DISCRIMINATOR => 'additionalType', MAP => [ '<type>' => 'model.x', … ], FALLBACK => 'model.y' ]`.

public string MODELS = 'models'

REQUIRES

The collection → required permission registry: a map declaring which permission a collection demands to be searchable. A collection absent from this map is **public** (searchable by everyone); the gate is evaluated by {@see \oihana\arango\models\helpers\isAuthorized()}.

public string REQUIRES = 'requires'

Each value takes one of two forms:

  • Collection-level (mirroring Field::REQUIRES): a subject string or an OR-list — `'customers' => 'customers:list'`, `'users' => [ 'users:list', 'users:admin' ]`.
  • Structured cascade for a polymorphic collection (one already declared composite in MODELS): a level-1 collection gate plus a per-type level-2 gate, reusing the MAP / FALLBACK vocabulary — `'organizations' => [ COLLECTION => 'org:list', MAP => [ '' => 'cust:list', … ], FALLBACK => 'org:list'|true ]`. COLLECTION (string | OR-list | absent=public), MAP (`type => subjects`), FALLBACK governing the **unlisted** types (absent=hidden | subjects | `true`=public). The discriminator field is reused from the collection's composite MODELS entry — never redeclared.

SEARCHABLE

The federated search specification — what to search across the heterogeneous collections (the fields and the analyzer), reusing the {@see \oihana\arango\models\enums\Search} vocabulary.

public string SEARCHABLE = 'searchable'

SKIN

The default skin (projection variant) applied when rebuilding the matched documents — overridden per request by `?skin=`, and itself defaulting to {@see \oihana\controllers\enums\Skin::DEFAULT} when unset.

public string SKIN = 'skin'

VIEW

The name of the `search-alias` view to query (the view aggregating one inverted index per collection — see {@see \oihana\arango\db\options\views\SearchAliasView}).

public string VIEW = 'view'
On this page

Search results