Get Index Terms Operation
-
Use
GetTermsOperation
to retrieve the terms of an index-field. -
In this page:
Get Terms example
// Define the get terms operation
// Pass the requested index-name, index-field, start value & page size
$getTermsOp = new GetTermsOperation("Orders/Totals", "Employee", "employees/5-a", 10);
// Execute the operation by passing it to Maintenance.Send
/** @var StringArrayResult $fieldTerms */
$fieldTerms = $store->maintenance()->send($getTermsOp);
// fieldTerms will contain the all terms that come after term 'employees/5-a' for index-field 'Employee'
Syntax
GetTermsOperation(?string $indexName, ?string $field, ?string $fromValue, ?int $pageSize = null)
Parameters | Type | Description |
---|---|---|
$indexName | ?string |
Name of an index to get terms for |
$field | ?string |
Name of index-field to get terms for |
$fromValue | ?string |
The starting term to return results from. This term is not included in the results. None - start from first term. |
$pageSize | ?int |
Number of terms to get.None - return all terms. |