JavaScript client

    The client contains a library of APIs that let you perform different operations on your cluster and return a standard response body. The example here demonstrates some basic operations like creating an index, adding documents, and searching your data.

    To add the client to your project, install it from npm:

    If you prefer to add the client manually or just want to examine the source code, see on GitHub.

    Then require the client:

    memoryCircuitBreaker contains two fields:

    • maxPercentage: The threshold that determines whether the Circuit Breaker engages. The input range must be between . Any number that exceeds that range will correct to 1.0.

    The following example turns on the Circuit Breaker and sets the maximum percentage of a query response to 80% of the cluster’s storage. You can customize this example for use in the POST _cluster/settings request body.