Docs
  • Guides
  • APIs (opens in a new tab)
  • Products
    Elasticsearch Observability Security Elastic Cloud
  • Reference
  • Troubleshoot
  • Release notes
  1. Docs /
  2. Reference /
  3. Elasticsearch /
  4. Clients /
  5. PHP

Configuration

Almost every aspect of the client is configurable. Most users only need to configure a few parameters to suit their needs, but it is possible to completely replace much of the internals if required.

Custom configuration is accomplished before the client is instantiated, through the ClientBuilder class. You can find all the configuration options and check sample code that helps you replace the various components.

To learn more about JSON in PHP, read Dealing with JSON arrays and objects in PHP.

  • Host Configuration
  • Set retries
  • HTTP Meta Data
  • Enabling the Logger
  • Configure the HTTP client
  • Namespaces
  • Node Pool
  • Building the client from a configuration hash
Previous
Connecting
Next
Dealing with JSON arrays and objects in PHP
  • View as Markdown
  • Report a docs issue
  • Edit this page
  • Learn how to contribute
Get started free
  • 14-day free trial
  • All features included
  • No setup required
Section
Reference
Docs Guides APIs (opens in a new tab) Reference Troubleshoot Release notes
Version
Reference Elasticsearch Clients
PHP
  • Overview
  • Getting started
  • Installation
  • Connecting
  • Configuration
    • Dealing with JSON arrays and objects in PHP
    • Host Configuration
    • Set retries
    • HTTP Meta Data
    • Enabling the Logger
    • Configure the HTTP client
    • Namespaces
    • Node Pool
  • Operations
    • Index management operations
    • Search operations
    • Indexing documents
    • Getting documents
    • Updating documents
    • Deleting documents
  • Client helpers
    • Iterators
    • ES|QL
    • Bulk ingest
Elastic logo
  • Trademarks
  • Terms of Use
  • Privacy
  • Sitemap

© 2026 Elasticsearch B.V. All Rights Reserved.

This content is available in different formats for convenience only. All original licensing terms apply.

Elasticsearch is a trademark of Elasticsearch B.V., registered in the U.S. and in other countries. Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant logo are trademarks of the Apache Software Foundation in the United States and/or other countries.