CINXE.COM

Elasticsearch-PHP [8.16] | Elastic

<!DOCTYPE html> <html lang="en-us"> <head> <meta charset="UTF-8"> <title>Elasticsearch-PHP [8.16] | Elastic</title> <meta class="elastic" name="content" content="Elasticsearch-PHP [8.16]"> <link rel="home" href="index.html" title="Elasticsearch-PHP [8.16]"/> <link rel="next" href="overview.html" title="Overview"/> <meta class="elastic" name="product_version" content="8.16"/> <meta class="elastic" name="product_name" content="Clients"/> <meta class="elastic" name="website_area" content="documentation"/> <meta name="DC.type" content="Learn/Docs/Clients/PHP/8.16"/> <meta name="DC.subject" content="Clients"/> <meta name="DC.identifier" content="8.16"/> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <script src="https://cdn.optimizely.com/js/18132920325.js"></script> <link rel="apple-touch-icon" sizes="57x57" href="/apple-icon-57x57.png"> <link rel="apple-touch-icon" sizes="60x60" href="/apple-icon-60x60.png"> <link rel="apple-touch-icon" sizes="72x72" href="/apple-icon-72x72.png"> <link rel="apple-touch-icon" sizes="76x76" href="/apple-icon-76x76.png"> <link rel="apple-touch-icon" sizes="114x114" href="/apple-icon-114x114.png"> <link rel="apple-touch-icon" sizes="120x120" href="/apple-icon-120x120.png"> <link rel="apple-touch-icon" sizes="144x144" href="/apple-icon-144x144.png"> <link rel="apple-touch-icon" sizes="152x152" href="/apple-icon-152x152.png"> <link rel="apple-touch-icon" sizes="180x180" href="/apple-icon-180x180.png"> <link rel="icon" type="image/png" href="/favicon-32x32.png" sizes="32x32"> <link rel="icon" type="image/png" href="/android-chrome-192x192.png" sizes="192x192"> <link rel="icon" type="image/png" href="/favicon-96x96.png" sizes="96x96"> <link rel="icon" type="image/png" href="/favicon-16x16.png" sizes="16x16"> <link rel="manifest" href="/manifest.json"> <meta name="apple-mobile-web-app-title" content="Elastic"> <meta name="application-name" content="Elastic"> <meta name="msapplication-TileColor" content="#ffffff"> <meta name="msapplication-TileImage" content="/mstile-144x144.png"> <meta name="theme-color" content="#ffffff"> <meta name="naver-site-verification" content="936882c1853b701b3cef3721758d80535413dbfd" /> <meta name="yandex-verification" content="d8a47e95d0972434" /> <meta name="localized" content="true" /> <meta name="st:robots" content="follow,index" /> <meta property="og:image" content="https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt280217a63b82a734/6202d3378b1f312528798412/elastic-logo.svg" /> <meta property="og:image:width" content="500" /> <meta property="og:image:height" content="172" /> <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon"> <link rel="icon" href="/favicon.ico" type="image/x-icon"> <link rel="apple-touch-icon-precomposed" sizes="64x64" href="/favicon_64x64_16bit.png"> <link rel="apple-touch-icon-precomposed" sizes="32x32" href="/favicon_32x32.png"> <link rel="apple-touch-icon-precomposed" sizes="16x16" href="/favicon_16x16.png"> <!-- Give IE8 a fighting chance --> <!--[if lt IE 9]> <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> <![endif]--> <link rel="stylesheet" type="text/css" href="/guide/static/styles-v1.css" /> </head> <!--漏 2015-2025 Elasticsearch B.V. --> <!-- All Elastic documentation is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License. --> <!-- http://creativecommons.org/licenses/by-nc-nd/4.0/ --> <body> <!-- Google Tag Manager --> <script>dataLayer = [];</script><noscript><iframe src="//www.googletagmanager.com/ns.html?id=GTM-58RLH5" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript> <script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src= '//www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f); })(window,document,'script','dataLayer','GTM-58RLH5');</script> <!-- End Google Tag Manager --> <!-- Global site tag (gtag.js) - Google Analytics --> <script async src="https://www.googletagmanager.com/gtag/js?id=UA-12395217-16"></script> <script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'UA-12395217-16'); </script> <!-- Google Tag Manager for GA4 --> <script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src='https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);})(window,document,'script','dataLayer','GTM-KNJMG2M');</script> <noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-KNJMG2M" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript> <!-- End Google Tag Manager for GA4--> <div id='elastic-nav' style="display:none;"></div> <script src='https://www.elastic.co/elastic-nav.js'></script> <div class="main-container"> <section id="content" > <div class="content-wrapper"> <section id="guide" lang="en"> <div class="container-fluid"> <div class="row pb-3"> <div class="col-12 order-2 col-md-4 order-md-1 col-lg-3 h-almost-full-md sticky-top-md" id="left_col"> <!-- The TOC is appended here --> </div> <div class="col-12 order-1 col-md-8 order-md-2 col-lg-7 order-lg-2 guide-section" id="middle_col"> <!-- start body --> <div class="navheader"> <span class="prev"> </span> <span class="next"> <a href="overview.html">Overview 禄</a> </span> </div> <div class="book" lang="en"> <div class="titlepage"> <div id="breadcrumbs-go-here"></div> <div> <div><h1 class="title"><a id="id-1"></a>Elasticsearch-PHP</h1></div> </div> <!--EXTRA--> </div> <div id="content"> <style> * { box-sizing: border-box; } .card { cursor: pointer; padding: 16px; text-align: left; color: #000; } .card:hover { box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2); padding: 16px; text-align: left; } #guide a.no-text-decoration:hover { text-decoration: none!important; } .icon { width: 24px; height: 24px; background-position: bottom; background-size: contain; background-repeat: no-repeat; } .ul-col-1 { columns: 1; -webkit-columns: 1; -moz-columns: 1; } @media (min-width:769px) { .ul-col-md-2 { columns: 2; -webkit-columns: 2; -moz-columns: 2; } } #guide h3.gtk { margin-top: 16px; } .mb-4, .my-4 { margin-bottom: 0!important; } </style> <div class="legalnotice"></div> <div class="row my-4"> <div class="col-md-6 col-12"> <p></p> <p> <h2>Documentation</h2> </p> <p> The official PHP client provides a low-level client for communicating with an Elasticsearch cluster. </p> <p> <a href="https://www.elastic.co/guide/en/elasticsearch/client/php-api/current/getting-started-php.html"> <button class="btn btn-primary">Get started</button> </a> </p> </div> <div class="col-md-6 col-12"> <img class="w-100" src="https://images.contentstack.io/v3/assets/bltefdd0b53724fa2ce/blt4769b15a863b007f/64242eeeb57cb810acb79957/ES_PHP_landing_page.png" /> </div> </div> <h3 class="gtk">Get to know the PHP client</h3> <div class="my-5"> <div class="d-flex align-items-center mb-3"> <h4 class="mt-3"> <span class="inline-block float-left icon mr-2" style="background-image: url('https://images.contentstack.io/v3/assets/bltefdd0b53724fa2ce/bltfd59779217093221/641ae0c8db18f61d68e9c377/64x64_Color_icon-connected-circles64-color.png');"></span> Connecting </h4> </div> <ul class="ul-col-md-2 ul-col-1"> <li> <a href="installation.html">Installing the client</a> </li> <li> <a href="connecting.html">Connecting to Elasticsearch</a> </li> <li> <a href="configuration.html">Configuring the client</a> </li> </ul> </div> <div class="my-5"> <div class="d-flex align-items-center mb-3"> <h4 class="mt-3"> <span class="inline-block float-left icon mr-2" style="background-image: url('https://images.contentstack.io/v3/assets/bltefdd0b53724fa2ce/bltca09fd8c807816ce/641ae17733e7f95594918557/icon-monitor-cog-64-color.png');"></span> Using the PHP client </h4> </div> <ul class="ul-col-md-2 ul-col-1"> <li> <a href="indexing_documents.html">Indexing documents</a> </li> <li> <a href="getting_documents.html">Getting documents</a> </li> <li> <a href="search_operations.html">Searching documents</a> </li> <li> <a href="deleting_documents.html">Deleting documents</a> </li> <li> <a href="updating_documents.html">Updating documents</a> </li> <li> <a href="index_management.html">Index management</a> </li> </ul> </div> <div class="my-5"> <div class="d-flex align-items-center mb-3"> <h4 class="mt-3"> <span class="inline-block float-left icon mr-2" style="background-image: url('https://images.contentstack.io/v3/assets/bltefdd0b53724fa2ce/blteacd058910f155d8/636925a6e0ff7c532db636d7/64x64_Color_icon-dev-tools-64-color.png');"></span> Developer docs </h4> </div> <ul class="ul-col-md-2 ul-col-1"> <li> <a href="client-helpers.html">Client helpers</a> </li> <li> <a href="release-notes.html">Release notes</a> </li> </ul> </div> <h3 class="explore">Explore by use case</h3> <div class="row my-4"> <div class="col-md-4 col-12 mb-2"> <a class="no-text-decoration" href="https://www.elastic.co/guide/en/enterprise-search/current/start.html"> <div class="card h-100"> <h4 class="mt-3"> <span class="inline-block float-left icon mr-2" style="background-image: url('https://images.contentstack.io/v3/assets/bltefdd0b53724fa2ce/blt11200907c1c033aa/634d9da119d8652169cf9b2b/enterprise-search-logo-color-32px.png');"></span> Search my data </h4> <p>Create search experiences for your content, wherever it lives.</p> </div> </a> </div> <div class="col-md-4 col-12 mb-2"> <a class="no-text-decoration" href="https://www.elastic.co/guide/en/starting-with-the-elasticsearch-platform-and-its-solutions/current/getting-started-observability.html"> <div class="card h-100"> <h4 class="mt-3"> <span class="inline-block float-left icon mr-2" style="background-image: url('https://images.contentstack.io/v3/assets/bltefdd0b53724fa2ce/bltaa08b370a00bbecc/634d9da14e565f1cdce27f7c/observability-logo-color-32px.png');"></span> Observe my data </h4> <p>Follow our guides to monitor logs, metrics, and traces.</p> </div> </a> </div> <div class="col-md-4 col-12 mb-2"> <a class="no-text-decoration" href="https://www.elastic.co/guide/en/security/current/es-overview.html"> <div class="card h-100"> <h4 class="mt-3"> <span class="inline-block float-left icon mr-2" style="background-image: url('https://images.contentstack.io/v3/assets/bltefdd0b53724fa2ce/blt5e0e0ad9a13e6b8c/634d9da18473831f96bbdf1e/security-logo-color-32px.png');"></span> Protect my environment </h4> <p>Learn how to defend against threats across your environment.</p> </div> </a> </div> </div> <p class="my-4"><a href="https://www.elastic.co/guide/index.html">View all Elastic docs</a></p> <p class="my-4"><small>The PHP logo available <a href="https://www.php.net/download-logos.php">here</a> is released under the Creative Commons <a href="https://creativecommons.org/licenses/by-sa/4.0/deed.en"> Attribution-Share Alike 4.0 International license</a></small>.</p> </div> </div><div class="navfooter"> <span class="prev"> </span> <span class="next"> <a href="overview.html">Overview 禄</a> </span> </div> <!-- end body --> </div> <div class="col-12 order-3 col-lg-2 order-lg-3 h-almost-full-lg sticky-top-lg" id="right_col"> <div id="sticky_content"> <!-- The OTP is appended here --> <div class="row"> <div class="col-0 col-md-4 col-lg-0" id="bottom_left_col"></div> <div class="col-12 col-md-8 col-lg-12"> <div id="rtpcontainer"> <div class="mktg-promo" id="most-popular"> <p class="aside-heading">Most Popular</p> <div class="pb-2"> <p class="media-type">Video</p> <a href="https://www.elastic.co/webinars/getting-started-elasticsearch?page=docs&placement=top-video"> <p class="mb-0">Get Started with Elasticsearch</p> </a> </div> <div class="pb-2"> <p class="media-type">Video</p> <a href="https://www.elastic.co/webinars/getting-started-kibana?page=docs&placement=top-video"> <p class="mb-0">Intro to Kibana</p> </a> </div> <div class="pb-2"> <p class="media-type">Video</p> <a href="https://www.elastic.co/webinars/introduction-elk-stack?page=docs&placement=top-video"> <p class="mb-0">ELK for Logs & Metrics</p> </a> </div> </div> </div> <!-- Feedback widget --> <div id="feedbackWidgetContainer"></div> </div> </div> </div> </div> </div> </div> </section> </div> <div id='elastic-footer'></div> <script src='https://www.elastic.co/elastic-footer.js'></script> <!-- Footer Section end--> </section> </div> <!-- Feedback modal --> <div id="feedbackModalContainer"></div> <script src="/guide/static/jquery.js"></script> <script type="text/javascript" src="/guide/static/docs-v1.js"></script> <script type="text/javascript"> window.initial_state = {}</script> </body> </html>

Pages: 1 2 3 4 5 6 7 8 9 10