SearchOptions extends QueryOptions
The options of the AQL `SEARCH` operation (`SEARCH expression OPTIONS { … }`), hydrated by {@see \oihana\arango\db\operations\aqlSearch()} from the `AQL::SEARCH_OPTIONS` key. Null properties are omitted from the emitted `OPTIONS` object, so the server applies its own defaults.
Not to be confused with ForOptions — the FOR-level options
(indexHint, useCache, …) for collection iteration. The options below
only apply to a SEARCH against a View.
Tags
Table of Contents
Constants
- CACHE_ENABLED : string = 'cacheEnabled'
- DEDUPLICATE : string = 'deduplicate'
- DISABLE_INDEX : string = 'disableIndex'
- ESTIMATES : string = 'estimates'
- EXCLUSIVE : string = 'exclusive'
- EXPIRE_AFTER : string = 'expireAfter'
- FIELD_VALUE_TYPES : string = 'fieldValueTypes'
- FIELDS : string = 'fields'
- FORCE_INDEX_HINT : string = 'forceIndexHint'
- GEO_JSON : string = 'geoJson'
- IGNORE_ERRORS : string = 'ignoreErrors'
- IGNORE_REVS : string = 'ignoreRevs'
- IN_BACKGROUND : string = 'inBackground'
- INDEX_HINT : string = 'indexHint'
- KEEP_NULL : string = 'keepNull'
- LEGACY_POLYGONS : string = 'legacyPolygons'
- LOOKAHEAD : string = 'lookahead'
- MAX_PROJECTIONS : string = 'maxProjections'
- MERGE_OBJECTS : string = 'mergeObjects'
- METHOD : string = 'method'
- NAME : string = 'name'
- OVERWRITE_MODE : string = 'overwriteMode'
- PARALLELISM : string = 'parallelism'
- PARAMS : string = 'params'
- PREFIX_FIELDS : string = 'prefixFields'
- READ_OWN_WRITES : string = 'readOwnWrites'
- REFILL_INDEX_CACHES : string = 'refillIndexCaches'
- SPARSE : string = 'sparse'
- STORED_VALUE : string = 'storedValue'
- TYPE : string = 'type'
- UNIQUE : string = 'unique'
- USE_CACHE : string = 'useCache'
- WAIT_FOR_SYNC : string = 'waitForSync'
Properties
- $collections : array<string|int, mixed>|null
- Restrict the search to the given source collections of the View — an array of collection names. Documents from the View's other linked collections are ignored. The search expression itself is unrestricted (`true` matches every document of the selected collections).
- $conditionOptimization : string|null
- How the search criteria get optimized — one of the {@see \oihana\arango\db\enums\ConditionOptimization} constants: `'auto'` (server default: convert to disjunctive normal form and remove redundant or overlapping conditions) or `'none'` (search the index without optimizing the conditions).
- $countApproximate : string|null
- How the total row count is calculated when the `fullCount` query option is enabled or a `COLLECT WITH COUNT` clause is executed — one of the {@see \oihana\arango\db\enums\CountApproximate} constants: `'exact'` (server default: enumerate the rows) or `'cost'` (O(1) cost-based approximation, precise for an empty or single-term search condition).
- $parallelism : int|null
- Number of worker threads that may process the View's index segments in parallel. `1` disables parallelization; greater values are a hint, capped by the server's `--arangosearch.execution-threads-limit`. Omit to use the server's `--arangosearch.default-parallelism`.
Methods
- __construct() : mixed
- Creates a new QueryOptions instance.
- jsonSerialize() : array<string|int, mixed>
- Invoked to serialize the object with the json serializer.
Constants
CACHE_ENABLED
public
string
CACHE_ENABLED
= 'cacheEnabled'
DEDUPLICATE
public
string
DEDUPLICATE
= 'deduplicate'
DISABLE_INDEX
public
string
DISABLE_INDEX
= 'disableIndex'
ESTIMATES
public
string
ESTIMATES
= 'estimates'
EXCLUSIVE
public
string
EXCLUSIVE
= 'exclusive'
EXPIRE_AFTER
public
string
EXPIRE_AFTER
= 'expireAfter'
FIELD_VALUE_TYPES
public
string
FIELD_VALUE_TYPES
= 'fieldValueTypes'
FIELDS
public
string
FIELDS
= 'fields'
FORCE_INDEX_HINT
public
string
FORCE_INDEX_HINT
= 'forceIndexHint'
GEO_JSON
public
string
GEO_JSON
= 'geoJson'
IGNORE_ERRORS
public
string
IGNORE_ERRORS
= 'ignoreErrors'
IGNORE_REVS
public
string
IGNORE_REVS
= 'ignoreRevs'
IN_BACKGROUND
public
string
IN_BACKGROUND
= 'inBackground'
INDEX_HINT
public
string
INDEX_HINT
= 'indexHint'
KEEP_NULL
public
string
KEEP_NULL
= 'keepNull'
LEGACY_POLYGONS
public
string
LEGACY_POLYGONS
= 'legacyPolygons'
LOOKAHEAD
public
string
LOOKAHEAD
= 'lookahead'
MAX_PROJECTIONS
public
string
MAX_PROJECTIONS
= 'maxProjections'
MERGE_OBJECTS
public
string
MERGE_OBJECTS
= 'mergeObjects'
METHOD
public
string
METHOD
= 'method'
NAME
public
string
NAME
= 'name'
OVERWRITE_MODE
public
string
OVERWRITE_MODE
= 'overwriteMode'
PARALLELISM
public
string
PARALLELISM
= 'parallelism'
PARAMS
public
string
PARAMS
= 'params'
PREFIX_FIELDS
public
string
PREFIX_FIELDS
= 'prefixFields'
READ_OWN_WRITES
public
string
READ_OWN_WRITES
= 'readOwnWrites'
REFILL_INDEX_CACHES
public
string
REFILL_INDEX_CACHES
= 'refillIndexCaches'
SPARSE
public
string
SPARSE
= 'sparse'
STORED_VALUE
public
string
STORED_VALUE
= 'storedValue'
TYPE
public
string
TYPE
= 'type'
UNIQUE
public
string
UNIQUE
= 'unique'
USE_CACHE
public
string
USE_CACHE
= 'useCache'
WAIT_FOR_SYNC
public
string
WAIT_FOR_SYNC
= 'waitForSync'
Properties
$collections
Restrict the search to the given source collections of the View — an array of collection names. Documents from the View's other linked collections are ignored. The search expression itself is unrestricted (`true` matches every document of the selected collections).
public
array<string|int, mixed>|null
$collections
Tags
$conditionOptimization
How the search criteria get optimized — one of the {@see \oihana\arango\db\enums\ConditionOptimization} constants: `'auto'` (server default: convert to disjunctive normal form and remove redundant or overlapping conditions) or `'none'` (search the index without optimizing the conditions).
public
string|null
$conditionOptimization
Tags
$countApproximate
How the total row count is calculated when the `fullCount` query option is enabled or a `COLLECT WITH COUNT` clause is executed — one of the {@see \oihana\arango\db\enums\CountApproximate} constants: `'exact'` (server default: enumerate the rows) or `'cost'` (O(1) cost-based approximation, precise for an empty or single-term search condition).
public
string|null
$countApproximate
Tags
$parallelism
Number of worker threads that may process the View's index segments in parallel. `1` disables parallelization; greater values are a hint, capped by the server's `--arangosearch.execution-threads-limit`. Omit to use the server's `--arangosearch.default-parallelism`.
public
int|null
$parallelism
Tags
Methods
__construct()
Creates a new QueryOptions 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>