---
type: api
title: Search allocators
description: Retrieves the information for all the allocators in the platform that match a specified query.
url: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/cloud-enterprise/operation/operation-search-allocators
resource: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/cloud-enterprise/operation/operation-search-allocators
products:
  - Elastic Cloud Enterprise
---

# Search allocators

## Paths

- `POST` `/platform/infrastructure/allocators/_search`

- [Basic auth](/elastic/docs-builder/docs/4371/api/doc/cloud-enterprise/authentication#basicauth)
- [Api key auth](/elastic/docs-builder/docs/4371/api/doc/cloud-enterprise/authentication#apikey)

## Description

Retrieves the information for all the allocators in the platform that match a specified query.

## Request Body

`application/json`

The optional search request to execute. If not supplied then all allocators are matched

- `from` (integer) — optional
  Deprecated, use cursor for a more scalable approach to paging.
- `cursor` (string) — optional
  To retrieve the next page of hits, set this to the cursor value of the previous response. When set, all other fields are ignored.
- `size` (integer) — optional
  The maximum number of search results to return.
- `query` ({} QueryContainer) — optional
  The container for all of the allowed Elasticsearch queries. Specify only one property each time.
  - `match` (map string to MatchQuery) — optional
    Map values ({} MatchQuery)
    - `query` (string) — required
      The text/numeric/date to query for.
    - `operator` (string) — optional
      The operator flag can be set to or or and to control the boolean clauses (defaults to or).
    - `minimum_should_match` (integer) — optional
      The minimum number of optional should clauses to match.
    - `analyzer` (string) — optional
      The analyzer that will be used to perform the analysis process on the text. Defaults to the analyzer that was used to index the field.
  - `match_all` (MatchAllQuery) — optional
    A query that matches all documents.
  - `match_none` (MatchNoneQuery) — optional
    A query that doesn't match any documents.
  - `term` (map string to TermQuery) — optional
    Map values ({} TermQuery)
    - `value` (string) — required
      The exact value to query for.
  - `bool` ({} BoolQuery) — optional
    A query for documents that match boolean combinations of other queries.
    - `must` ([] QueryContainer) — optional — recursive
      Same fields as `query`
    - `should` ([] QueryContainer) — optional — recursive
      Same fields as `query`
    - `must_not` ([] QueryContainer) — optional — recursive
      Same fields as `query`
    - `filter` ([] QueryContainer) — optional — recursive
      Same fields as `query`
    - `minimum_should_match` (integer) — optional
      The minimum number of optional should clauses to match.
  - `query_string` ({} QueryStringQuery) — optional
    A query that uses the strict query string syntax for parsing. Will return an error for invalid syntax.
    - `query` (string) — required
      The actual query to be parsed.
    - `default_field` (string) — optional
      The default field for query terms if no prefix field is specified.
    - `analyzer` (string) — optional
      The analyzer used to analyze each term of the query when creating composite queries.
    - `default_operator` (string) — optional
      The default operator used if no explicit operator is specified.
    - `allow_leading_wildcard` (boolean) — optional
      When set, * or ? are allowed as the first character. Defaults to false.
  - `nested` ({} NestedQuery) — optional
    A query that matches nested objects.
    - `query` ({} QueryContainer) — required — recursive
      The container for all of the allowed Elasticsearch queries. Specify only one property each time.
      Same fields as `query`
    - `path` (string) — required
      The path to the nested object.
    - `score_mode` (enum) — optional
      Allows to specify how inner children matching affects score of the parent. Refer to the Elasticsearch documentation for details.
      Values: `avg`, `sum`, `min`, `max`, `none`
  - `prefix` (map string to PrefixQuery) — optional
    Map values ({} PrefixQuery)
    - `value` (string) — required
      The prefix to search for.
    - `boost` (number) — optional
      An optional boost value to apply to the query.
  - `exists` ({} ExistsQuery) — optional
    Matches documents that have at least one non-`null` value in the original field.
    - `field` (string) — required
      The field to check for non-null values in.
  - `range` (map string to RangeQuery) — optional
    Map values ({} RangeQuery)
    - `gt` (object) — optional
      Greater-than
    - `gte` (object) — optional
      Greater-than or equal to
    - `lt` (object) — optional
      Less-than
    - `lte` (object) — optional
      Less-than or equal to.
    - `boost` (number) — optional
      An optional boost value to apply to the query.
    - `format` (string) — optional
      Formatted dates will be parsed using the format specified on the date field by default, but it can be overridden by passing the format parameter.
    - `time_zone` (string) — optional
      Dates can be converted from another timezone to UTC either by specifying the time zone in the date value itself (if the format accepts it), or it can be specified as the time_zone parameter.
  - `simple_query_string` ({} SimpleQueryStringQuery) — optional
    A query that uses simple query string syntax. Will ignore invalid syntax.
    - `query` (string) — required
      The query expressed in simple query string syntax.
    - `fields` ([] string) — optional
      Array of fields to search
    - `default_operator` (string) — optional
      The boolean operator used to combine the terms of the query. Valid values are `OR` (default) and `AND`.
    - `analyze_wildcard` (boolean) — optional
      If `true`, the query attempts to analyze wildcard terms. Defaults to `false`.
    - `analyzer` (string) — optional
      The name of the analyzer to use to convert the query text into tokens.
    - `auto_generate_synonyms_phrase_query` (boolean) — optional
      If `true`, the parse creates a `match_phrase` uery for each multi-position token. Defaults to `true`.
    - `flags` (string) — optional
      List of enabled operators for the simple query string syntax. Defaults to `ALL`.
    - `fuzzy_max_expansions` (integer) — optional
      Maximum number of terms to which the query expands for fuzzy matching. Defaults to 50.
    - `fuzzy_prefix_length` (integer) — optional
      Number of beginning characters left unchanged for fuzzy matching. Defaults to 0.
    - `fuzzy_transpositions` (boolean) — optional
      If `true`, edits for fuzzy matching include transpositions of two adjacent characters. Defaults to `false`.
    - `lenient` (boolean) — optional
      If `true`, format-based errors, such as providing a text value for a numeric field are ignored. Defaults to `false`.
    - `minimum_should_match` (string) — optional
      Minimum number of clauses that must match for a document to be returned.
    - `quote_field_suffix` (string) — optional
      Suffix appended to quoted text in the query string.
- `sort` ([] object) — optional
  An array of fields to sort the search results by. Defaults to query rank and last modified date descending.

## Response

An overview of allocators that matched the given search query

`application/json`

- `zones` ([] AllocatorZoneInfo)
  - `zone_id` (string)
    Identifier of the zone
  - `allocators` ([] AllocatorInfo)
    - `status` ({} AllocatorHealthStatus)
      The health status of the allocator.
      - `connected` (boolean)
        Whether the allocator is connected
      - `healthy` (boolean)
        Whether the allocator is healthy, meaning it is either connected or has no instances
      - `health_checks` ({} AllocatorHealthChecks)
        The checks performed to determine if an allocator is healthy or not.
        - `is_docker_healthy` (boolean)
          Check performed by the allocator to figure out if docker is healthy
        - `is_connected_to_zk` (boolean)
          Whether the allocator is connected to zk or not
        - `has_instances` (boolean)
          Whether the allocator has allocated instances
      - `maintenance_mode` (boolean)
        Whether the allocator is in maintenance mode (meaning that new workload won't be assigned to it)
      - `maintenance_mode_timestamp` (string)
        Timestamp when allocator last entered or exited maintenance mode
    - `allocator_id` (string)
      Identifier for this allocator
    - `zone_id` (string)
      Identifier of the zone
    - `host_ip` (string)
      Host IP of this allocator
    - `public_hostname` (string)
      Public hostname of this allocator
    - `capacity` ({} AllocatorCapacity)
      The total and used capacity of the allocator.
      - `memory` ({} AllocatorCapacityMemory)
        The available and used memory of the allocator.
        - `total` (integer)
          Total memory in MB capacity installed on this allocator
        - `used` (integer)
          Used memory in MB used by instances assigned to this allocator
      - `storage` ({} AllocatorCapacityStorage)
        The storage capacity of the allocator.
        - `total` (integer)
          Total storage in MiB capacity installed on this allocator
      - `available_cpus` (integer)
        Total number of CPUs available on this allocator
      - `additional_master_bonus` (number)
        Additional bonus CPU shares available to Elasticsearch master instances
    - `settings` ({} AllocatorSettings)
      The settings for the allocator.
      - `capacity` (integer)
        A memory capacity (in MB) that overrides the capacity defined during installation - requires separate restart of Allocator services on each host to take full effect.
    - `instances` ([] AllocatedInstanceStatus)
      - `cluster_type` (enum)
        Type of instance that is running
        Values: `elasticsearch`, `kibana`, `apm`, `integrations_server`, `appsearch`, `enterprise_search`
      - `cluster_id` (string)
        Identifier for the cluster this instance belongs
      - `cluster_name` (string)
        Name of cluster this instance belongs, if available
      - `instance_name` (string)
        Instance ID of the instance
      - `node_memory` (integer)
        Memory assigned to this instance
      - `healthy` (boolean)
        Indicates whether the instance is healthy
      - `cluster_healthy` (boolean)
        Indicates whether the cluster the instance belongs to is healthy
      - `instance_configuration_id` (string)
        The instance configuration id of this instance
      - `moving` (boolean)
        Indicates whether the instance is vacating away from this allocator. Note that this is currently not populated when returned from the search endpoint.
      - `plans_info` ({} AllocatedInstancePlansInfo)
        The plan information for the Elasticsearch cluster associated with the Kibana instance or APM Server.
        - `pending` (boolean)
          Whether or not there is a pending plan.
        - `version` (string)
          The version of the current plan, falling back to that of the pending plan if it exists.
        - `zone_count` (integer)
          The number of zones in the current plan, falling back to that of the pending plan if it exists.
      - `deployment_id` (string)
        The id of the deployment this cluster belongs to.
    - `metadata` ([] MetadataItem)
      Arbitrary metadata associated with this allocator
      - `key` (string)
        The metadata field name
      - `value` (string)
        The metadata value
    - `build_info` ({} AllocatorBuildInfo)
      Information about the build that is running on the allocator.
      - `commit_hash` (string)
        Git commit hash
      - `version` (string)
        Version of the artifact
    - `features` ([] string)
      List of features associated with this allocator. Note this is only present for backwards compatibility purposes and is scheduled for removal in the next major version release.
    - `external_links` ([] ExternalHyperlink · unique)
      External resources related to this allocator.
      - `id` (string)
        Identifier of the external link
      - `label` (string)
        Human-readable description of the external link
      - `uri` (string)
        hyperlink to an external resource
    - `region` (string)
      The region that this allocator belongs to. Only populated in SaaS or federated ECE.
## Code Examples

#### Console

```console
POST /platform/infrastructure/allocators/_search
```

#### curl

```curl
curl -X POST "/platform/infrastructure/allocators/_search"
```

