From f439da688ac555aac753bcc373327dd8e89e3e43 Mon Sep 17 00:00:00 2001 From: Annie Hansen Date: Mon, 8 Apr 2024 16:01:37 -0600 Subject: [PATCH] testing php code example generation --- docs/build/DOCTUM_VERSION | 1 + .../Elastic/Elasticsearch/Client.asciidoc | 146 +++++++++ .../Elasticsearch/ClientBuilder.asciidoc | 309 ++++++++++++++++++ docs/build/PROJECT_VERSION | 1 + docs/build/classes.asciidoc | 12 + docs/build/interfaces.asciidoc | 7 + docs/build/namespaces.asciidoc | 10 + docs/build/renderer.index | 1 + .../0246f73cc2ed3dfec577119e8cd15404.asciidoc | 20 ++ .../0264e994a7e68561e2ca6be0f0d90ee9.asciidoc | 30 ++ .../07ba3eaa931f2cf110052e3544db51f8.asciidoc | 24 ++ .../111c69ca94162c1523b799a5c14723dd.asciidoc | 13 + .../13d90ba227131aefbf4fcfd5992e662a.asciidoc | 41 +++ .../151d2b11807ec684b0c01aa89189a801.asciidoc | 20 ++ .../1cecd4d87a92427175157d41859df2af.asciidoc | 14 + .../1e871f060dbe1a5c316ed205278804a8.asciidoc | 36 ++ .../1f673e1a0de2970dc648618d5425a994.asciidoc | 10 + .../20005d8a6555b259b299d862cd218701.asciidoc | 18 + .../242a26ced0e5706e48dcda19a4003094.asciidoc | 26 ++ .../25576b6773322f0929d4c635a940dba0.asciidoc | 21 ++ .../2932e6f71e247cf52e11d2f38f114ddf.asciidoc | 16 + .../2a247e36a86a373bcbf478ac9a588f44.asciidoc | 16 + .../2a9747bcfaf1f9491ebd410b3fcb6798.asciidoc | 16 + .../2cd8439db5054c93c49f1bf50433e1bb.asciidoc | 27 ++ .../2d01a9e5550b525496757f1bd7f0e706.asciidoc | 17 + .../2fa45d74ba9933188c4728f8a9e5372c.asciidoc | 29 ++ .../2fc80a2ad1ca8b2dcb13ed1895b8e861.asciidoc | 13 + .../2fea3e324939cc7e9c396964aeee7111.asciidoc | 19 ++ .../30f3e3b9df46afd12e68bc71f18483b4.asciidoc | 28 ++ .../3541d4a85e27b2c3896a7a7ee98b4b37.asciidoc | 6 + .../355d0ee2fcb6c1fc403c6267f710e25a.asciidoc | 19 ++ .../36b86b97feedcf5632824eefc251d6ed.asciidoc | 16 + .../37530f35f315b9f35e3e6a13cf2a1ccd.asciidoc | 27 ++ .../39ce44333d28ed2b833722d3e3cb06f3.asciidoc | 41 +++ .../3b8ab7027e0d616fb432acd8813e086c.asciidoc | 17 + .../3bb491db29deba25e1cc82bcaa1aa1a1.asciidoc | 19 ++ .../3d1a0e1dc5310544d032108ae0b3f099.asciidoc | 15 + .../3e8ed6ae016eb823cb00d9035b8ac459.asciidoc | 9 + .../3faf5e2873de340acfe0a617017db784.asciidoc | 15 + .../4029af36cb3f8202549017f7378803b4.asciidoc | 6 + .../41dbd79f624b998d01c10921e9a35c4b.asciidoc | 16 + .../436d50b85fc8f0977d02059eec00719b.asciidoc | 22 ++ .../472ec8c57fec8457e31fe6dd7f6e3713.asciidoc | 19 ++ .../4ba86373e13e106de044f190343be328.asciidoc | 41 +++ .../4bc744b0f33b322741a8caf6d8d7d765.asciidoc | 17 + .../4c3db8987d7b2d3d3df78ff1e71e7ede.asciidoc | 17 + .../4ca15672fc5ab1d80a127d086b6d2837.asciidoc | 6 + .../50b5c0332949d2154c72b629b5fa6222.asciidoc | 19 ++ .../54a215d242ab65123b09e9dfb71bcbbf.asciidoc | 20 ++ .../56a1aa4f7fa62f2289e20607e3039bf3.asciidoc | 16 + .../56a903530990313b753b1be33578997a.asciidoc | 36 ++ .../5b58007f10700ec7934580f034404652.asciidoc | 17 + .../5f1ed9cfdc149763b444acfbe10b0e16.asciidoc | 19 ++ .../60f889fbed5df3185444f7015b48ed76.asciidoc | 9 + .../63cc960215ae83b359c12df3c0993bfa.asciidoc | 17 + .../64aff98cf477555e7411714c17006572.asciidoc | 18 + .../653c0d0ef146c997ef6bc6450d4f5f94.asciidoc | 26 ++ .../6b0288acb739c4667d41339e5100c327.asciidoc | 18 + .../6b77795e9249c8d9865f7a49fd86a863.asciidoc | 19 ++ .../6e000496a1fa8b57148518eaad692f35.asciidoc | 14 + .../7b5c231526846f2f7b98d78f3656ae6a.asciidoc | 16 + .../7c862a20772467e0f5beebbd1b80c4cb.asciidoc | 29 ++ .../7ca224d1a7de20a15c008e1b9dbda377.asciidoc | 18 + .../7e484b8b41f9dbc2bcf1f340db197c1d.asciidoc | 16 + .../803bbc14fbec0e49dfed9fab49c8a7f8.asciidoc | 18 + .../8575c966b004fb124c7afd6bb5827b50.asciidoc | 15 + .../87733deeea4b441b595d19a0f97346f0.asciidoc | 9 + .../8a1f6cffa653800282c0ae160ee375bc.asciidoc | 19 ++ .../8eac28d2e9b6482b413d61817456a14f.asciidoc | 27 ++ .../8ecefdcf8f153cf91588e9fdde8f3e6b.asciidoc | 20 ++ .../8ee9521f57661a050efb614f02b4a090.asciidoc | 17 + .../8f9a3fcd17a111f63caa3bef6e5f00f2.asciidoc | 18 + .../926c0134aeaad53bd0f3bdad9c430217.asciidoc | 14 + .../934aa38c3adcc4cf74ea40cd8736876c.asciidoc | 21 ++ .../9403764e6eccad7b321b65e9a10c5727.asciidoc | 19 ++ .../957d2e6ddbb9a9b16549c5e67b93b41b.asciidoc | 19 ++ .../9bae72e974bdeb56007d9104e73eff92.asciidoc | 13 + .../9d79645ab3a9da3f63c54a1516214a5a.asciidoc | 6 + .../a0f4e902d18460337684d74ea932fbe9.asciidoc | 15 + .../a5f9eb40087921e67d820775acf71522.asciidoc | 18 + .../a692b4c0ca7825c467880b346841f5a5.asciidoc | 22 ++ .../a72613de3774571ba24def4b495161b5.asciidoc | 17 + .../a78dfb844d385405d4b0fb0e09b4a5a4.asciidoc | 13 + .../a9fe70387d9c96a07830e1859c57efbb.asciidoc | 15 + .../aaa7a61b07861235fb6e489b946c705c.asciidoc | 15 + .../ab8b4537fad80107bc88f633d4039a52.asciidoc | 15 + .../ab8de34fcfc0277901cb39618ecfc9d5.asciidoc | 13 + .../ac497917ef707538198a8458ae3d5c6b.asciidoc | 15 + .../ac85e05c0bf2fd5099fbcb9c492f447e.asciidoc | 13 + .../acc6cd860032167e34fa5e0c043ab3b0.asciidoc | 15 + .../ad2416ca0581316cee6c63129685bca5.asciidoc | 20 ++ .../b0fa301cd3c6b9db128e34114f0c1e8f.asciidoc | 16 + .../b2e1e802fc3c5fbeb4190af7d598c23e.asciidoc | 16 + .../b3a711c3deddcdb8a3f6623184a8b794.asciidoc | 19 ++ .../b6c872d04eabb39d1947cde6b29d4ae1.asciidoc | 18 + .../b9370fa1aa18fe4bc00cf81ef0c0d45b.asciidoc | 18 + .../bcc75fc01b45e482638c65b8fbdf09fa.asciidoc | 9 + .../be5fef0640c3a650ee96f84e3376a1be.asciidoc | 27 ++ .../beb0b9ff4f68672273fcff1b7bae706b.asciidoc | 18 + .../c0c638e3d218b0ecbe5c4d77c964ae9e.asciidoc | 18 + .../c1a895497066a3dac674d4b1a119048d.asciidoc | 16 + .../c526fca1609b4c3c1d12dfd218d69a50.asciidoc | 16 + .../c5802e9f3f4068fcecb6937b867b270d.asciidoc | 20 ++ .../c6bdd5c7de79d6d9ac8e33a397b511e8.asciidoc | 18 + .../c9c396b94bb88098477e2b08b55a12ee.asciidoc | 54 +++ .../c9ce07a7d3d8a317f08535bdd3aa69a3.asciidoc | 19 ++ .../caab99520d3fe41f6154d74a7f696057.asciidoc | 9 + .../cb0c3223fd45148497df73adfba2e9ce.asciidoc | 21 ++ .../cda045dfd79acd160ed8668f2ee17ea7.asciidoc | 16 + .../cdb68b3f565df7c85e52a55864b37d40.asciidoc | 18 + .../cdf400299acd1c7b1b7bb42e284e3d08.asciidoc | 19 ++ .../d04f0c8c44e8b4fb55f2e7d9d05977e7.asciidoc | 65 ++++ .../d3dccdb15822e971ededb9f6f7d8ada1.asciidoc | 19 ++ .../d5d0ecf75843ddb5f92cfebd089e53e9.asciidoc | 20 ++ .../d7fe687201ac87b307cd06ed015dd317.asciidoc | 17 + .../de876505acc75d371d1f6f484c449197.asciidoc | 14 + .../e0a7c730ef0f22e3edffe9a254bc56e7.asciidoc | 35 ++ .../e316271f668c9889bf548311fb421f1e.asciidoc | 19 ++ .../e5901f48eb8a419b878fc2cb815d8691.asciidoc | 13 + .../e60ded7becfd5b2ccaef5bad2aaa93f5.asciidoc | 19 ++ .../e650d73c57ab313e686fec01e3b0c90f.asciidoc | 21 ++ .../e821d27a8b810821707ba860e31f8b78.asciidoc | 21 ++ .../e84e23232c7ecc8d6377ec2c16a60269.asciidoc | 23 ++ .../e891e1d4805172da45a81f62b6b44aca.asciidoc | 31 ++ .../e9ae959608d128202921b174f4faa7a8.asciidoc | 28 ++ .../eb14cedd3bdda9ffef3c118f3d528dcd.asciidoc | 13 + .../eec051555c8050d017d3fe38ea59e3a0.asciidoc | 16 + .../ef22234b97cc06d7dd620b4ce7c97b31.asciidoc | 17 + .../eff8ecaed1ed084909c64450fc363a20.asciidoc | 13 + .../f37173a75cd1b0d683c6f67819dd1de3.asciidoc | 10 + .../f495f9c99916a05e3b28166d31955fad.asciidoc | 27 ++ .../f8a0010753b1ff563dc42d703902d2fa.asciidoc | 46 +++ .../ff09e13391cecb2e8b9dd440b37e065f.asciidoc | 9 + .../ff63ae39c34925dbfa54282ec9989124.asciidoc | 27 ++ util/GenerateDocExamples.php | 23 +- 135 files changed, 2960 insertions(+), 8 deletions(-) create mode 100644 docs/build/DOCTUM_VERSION create mode 100644 docs/build/Elastic/Elasticsearch/Client.asciidoc create mode 100644 docs/build/Elastic/Elasticsearch/ClientBuilder.asciidoc create mode 100644 docs/build/PROJECT_VERSION create mode 100644 docs/build/classes.asciidoc create mode 100644 docs/build/interfaces.asciidoc create mode 100644 docs/build/namespaces.asciidoc create mode 100644 docs/build/renderer.index create mode 100644 docs/examples/0246f73cc2ed3dfec577119e8cd15404.asciidoc create mode 100644 docs/examples/0264e994a7e68561e2ca6be0f0d90ee9.asciidoc create mode 100644 docs/examples/07ba3eaa931f2cf110052e3544db51f8.asciidoc create mode 100644 docs/examples/111c69ca94162c1523b799a5c14723dd.asciidoc create mode 100644 docs/examples/13d90ba227131aefbf4fcfd5992e662a.asciidoc create mode 100644 docs/examples/151d2b11807ec684b0c01aa89189a801.asciidoc create mode 100644 docs/examples/1cecd4d87a92427175157d41859df2af.asciidoc create mode 100644 docs/examples/1e871f060dbe1a5c316ed205278804a8.asciidoc create mode 100644 docs/examples/1f673e1a0de2970dc648618d5425a994.asciidoc create mode 100644 docs/examples/20005d8a6555b259b299d862cd218701.asciidoc create mode 100644 docs/examples/242a26ced0e5706e48dcda19a4003094.asciidoc create mode 100644 docs/examples/25576b6773322f0929d4c635a940dba0.asciidoc create mode 100644 docs/examples/2932e6f71e247cf52e11d2f38f114ddf.asciidoc create mode 100644 docs/examples/2a247e36a86a373bcbf478ac9a588f44.asciidoc create mode 100644 docs/examples/2a9747bcfaf1f9491ebd410b3fcb6798.asciidoc create mode 100644 docs/examples/2cd8439db5054c93c49f1bf50433e1bb.asciidoc create mode 100644 docs/examples/2d01a9e5550b525496757f1bd7f0e706.asciidoc create mode 100644 docs/examples/2fa45d74ba9933188c4728f8a9e5372c.asciidoc create mode 100644 docs/examples/2fc80a2ad1ca8b2dcb13ed1895b8e861.asciidoc create mode 100644 docs/examples/2fea3e324939cc7e9c396964aeee7111.asciidoc create mode 100644 docs/examples/30f3e3b9df46afd12e68bc71f18483b4.asciidoc create mode 100644 docs/examples/3541d4a85e27b2c3896a7a7ee98b4b37.asciidoc create mode 100644 docs/examples/355d0ee2fcb6c1fc403c6267f710e25a.asciidoc create mode 100644 docs/examples/36b86b97feedcf5632824eefc251d6ed.asciidoc create mode 100644 docs/examples/37530f35f315b9f35e3e6a13cf2a1ccd.asciidoc create mode 100644 docs/examples/39ce44333d28ed2b833722d3e3cb06f3.asciidoc create mode 100644 docs/examples/3b8ab7027e0d616fb432acd8813e086c.asciidoc create mode 100644 docs/examples/3bb491db29deba25e1cc82bcaa1aa1a1.asciidoc create mode 100644 docs/examples/3d1a0e1dc5310544d032108ae0b3f099.asciidoc create mode 100644 docs/examples/3e8ed6ae016eb823cb00d9035b8ac459.asciidoc create mode 100644 docs/examples/3faf5e2873de340acfe0a617017db784.asciidoc create mode 100644 docs/examples/4029af36cb3f8202549017f7378803b4.asciidoc create mode 100644 docs/examples/41dbd79f624b998d01c10921e9a35c4b.asciidoc create mode 100644 docs/examples/436d50b85fc8f0977d02059eec00719b.asciidoc create mode 100644 docs/examples/472ec8c57fec8457e31fe6dd7f6e3713.asciidoc create mode 100644 docs/examples/4ba86373e13e106de044f190343be328.asciidoc create mode 100644 docs/examples/4bc744b0f33b322741a8caf6d8d7d765.asciidoc create mode 100644 docs/examples/4c3db8987d7b2d3d3df78ff1e71e7ede.asciidoc create mode 100644 docs/examples/4ca15672fc5ab1d80a127d086b6d2837.asciidoc create mode 100644 docs/examples/50b5c0332949d2154c72b629b5fa6222.asciidoc create mode 100644 docs/examples/54a215d242ab65123b09e9dfb71bcbbf.asciidoc create mode 100644 docs/examples/56a1aa4f7fa62f2289e20607e3039bf3.asciidoc create mode 100644 docs/examples/56a903530990313b753b1be33578997a.asciidoc create mode 100644 docs/examples/5b58007f10700ec7934580f034404652.asciidoc create mode 100644 docs/examples/5f1ed9cfdc149763b444acfbe10b0e16.asciidoc create mode 100644 docs/examples/60f889fbed5df3185444f7015b48ed76.asciidoc create mode 100644 docs/examples/63cc960215ae83b359c12df3c0993bfa.asciidoc create mode 100644 docs/examples/64aff98cf477555e7411714c17006572.asciidoc create mode 100644 docs/examples/653c0d0ef146c997ef6bc6450d4f5f94.asciidoc create mode 100644 docs/examples/6b0288acb739c4667d41339e5100c327.asciidoc create mode 100644 docs/examples/6b77795e9249c8d9865f7a49fd86a863.asciidoc create mode 100644 docs/examples/6e000496a1fa8b57148518eaad692f35.asciidoc create mode 100644 docs/examples/7b5c231526846f2f7b98d78f3656ae6a.asciidoc create mode 100644 docs/examples/7c862a20772467e0f5beebbd1b80c4cb.asciidoc create mode 100644 docs/examples/7ca224d1a7de20a15c008e1b9dbda377.asciidoc create mode 100644 docs/examples/7e484b8b41f9dbc2bcf1f340db197c1d.asciidoc create mode 100644 docs/examples/803bbc14fbec0e49dfed9fab49c8a7f8.asciidoc create mode 100644 docs/examples/8575c966b004fb124c7afd6bb5827b50.asciidoc create mode 100644 docs/examples/87733deeea4b441b595d19a0f97346f0.asciidoc create mode 100644 docs/examples/8a1f6cffa653800282c0ae160ee375bc.asciidoc create mode 100644 docs/examples/8eac28d2e9b6482b413d61817456a14f.asciidoc create mode 100644 docs/examples/8ecefdcf8f153cf91588e9fdde8f3e6b.asciidoc create mode 100644 docs/examples/8ee9521f57661a050efb614f02b4a090.asciidoc create mode 100644 docs/examples/8f9a3fcd17a111f63caa3bef6e5f00f2.asciidoc create mode 100644 docs/examples/926c0134aeaad53bd0f3bdad9c430217.asciidoc create mode 100644 docs/examples/934aa38c3adcc4cf74ea40cd8736876c.asciidoc create mode 100644 docs/examples/9403764e6eccad7b321b65e9a10c5727.asciidoc create mode 100644 docs/examples/957d2e6ddbb9a9b16549c5e67b93b41b.asciidoc create mode 100644 docs/examples/9bae72e974bdeb56007d9104e73eff92.asciidoc create mode 100644 docs/examples/9d79645ab3a9da3f63c54a1516214a5a.asciidoc create mode 100644 docs/examples/a0f4e902d18460337684d74ea932fbe9.asciidoc create mode 100644 docs/examples/a5f9eb40087921e67d820775acf71522.asciidoc create mode 100644 docs/examples/a692b4c0ca7825c467880b346841f5a5.asciidoc create mode 100644 docs/examples/a72613de3774571ba24def4b495161b5.asciidoc create mode 100644 docs/examples/a78dfb844d385405d4b0fb0e09b4a5a4.asciidoc create mode 100644 docs/examples/a9fe70387d9c96a07830e1859c57efbb.asciidoc create mode 100644 docs/examples/aaa7a61b07861235fb6e489b946c705c.asciidoc create mode 100644 docs/examples/ab8b4537fad80107bc88f633d4039a52.asciidoc create mode 100644 docs/examples/ab8de34fcfc0277901cb39618ecfc9d5.asciidoc create mode 100644 docs/examples/ac497917ef707538198a8458ae3d5c6b.asciidoc create mode 100644 docs/examples/ac85e05c0bf2fd5099fbcb9c492f447e.asciidoc create mode 100644 docs/examples/acc6cd860032167e34fa5e0c043ab3b0.asciidoc create mode 100644 docs/examples/ad2416ca0581316cee6c63129685bca5.asciidoc create mode 100644 docs/examples/b0fa301cd3c6b9db128e34114f0c1e8f.asciidoc create mode 100644 docs/examples/b2e1e802fc3c5fbeb4190af7d598c23e.asciidoc create mode 100644 docs/examples/b3a711c3deddcdb8a3f6623184a8b794.asciidoc create mode 100644 docs/examples/b6c872d04eabb39d1947cde6b29d4ae1.asciidoc create mode 100644 docs/examples/b9370fa1aa18fe4bc00cf81ef0c0d45b.asciidoc create mode 100644 docs/examples/bcc75fc01b45e482638c65b8fbdf09fa.asciidoc create mode 100644 docs/examples/be5fef0640c3a650ee96f84e3376a1be.asciidoc create mode 100644 docs/examples/beb0b9ff4f68672273fcff1b7bae706b.asciidoc create mode 100644 docs/examples/c0c638e3d218b0ecbe5c4d77c964ae9e.asciidoc create mode 100644 docs/examples/c1a895497066a3dac674d4b1a119048d.asciidoc create mode 100644 docs/examples/c526fca1609b4c3c1d12dfd218d69a50.asciidoc create mode 100644 docs/examples/c5802e9f3f4068fcecb6937b867b270d.asciidoc create mode 100644 docs/examples/c6bdd5c7de79d6d9ac8e33a397b511e8.asciidoc create mode 100644 docs/examples/c9c396b94bb88098477e2b08b55a12ee.asciidoc create mode 100644 docs/examples/c9ce07a7d3d8a317f08535bdd3aa69a3.asciidoc create mode 100644 docs/examples/caab99520d3fe41f6154d74a7f696057.asciidoc create mode 100644 docs/examples/cb0c3223fd45148497df73adfba2e9ce.asciidoc create mode 100644 docs/examples/cda045dfd79acd160ed8668f2ee17ea7.asciidoc create mode 100644 docs/examples/cdb68b3f565df7c85e52a55864b37d40.asciidoc create mode 100644 docs/examples/cdf400299acd1c7b1b7bb42e284e3d08.asciidoc create mode 100644 docs/examples/d04f0c8c44e8b4fb55f2e7d9d05977e7.asciidoc create mode 100644 docs/examples/d3dccdb15822e971ededb9f6f7d8ada1.asciidoc create mode 100644 docs/examples/d5d0ecf75843ddb5f92cfebd089e53e9.asciidoc create mode 100644 docs/examples/d7fe687201ac87b307cd06ed015dd317.asciidoc create mode 100644 docs/examples/de876505acc75d371d1f6f484c449197.asciidoc create mode 100644 docs/examples/e0a7c730ef0f22e3edffe9a254bc56e7.asciidoc create mode 100644 docs/examples/e316271f668c9889bf548311fb421f1e.asciidoc create mode 100644 docs/examples/e5901f48eb8a419b878fc2cb815d8691.asciidoc create mode 100644 docs/examples/e60ded7becfd5b2ccaef5bad2aaa93f5.asciidoc create mode 100644 docs/examples/e650d73c57ab313e686fec01e3b0c90f.asciidoc create mode 100644 docs/examples/e821d27a8b810821707ba860e31f8b78.asciidoc create mode 100644 docs/examples/e84e23232c7ecc8d6377ec2c16a60269.asciidoc create mode 100644 docs/examples/e891e1d4805172da45a81f62b6b44aca.asciidoc create mode 100644 docs/examples/e9ae959608d128202921b174f4faa7a8.asciidoc create mode 100644 docs/examples/eb14cedd3bdda9ffef3c118f3d528dcd.asciidoc create mode 100644 docs/examples/eec051555c8050d017d3fe38ea59e3a0.asciidoc create mode 100644 docs/examples/ef22234b97cc06d7dd620b4ce7c97b31.asciidoc create mode 100644 docs/examples/eff8ecaed1ed084909c64450fc363a20.asciidoc create mode 100644 docs/examples/f37173a75cd1b0d683c6f67819dd1de3.asciidoc create mode 100644 docs/examples/f495f9c99916a05e3b28166d31955fad.asciidoc create mode 100644 docs/examples/f8a0010753b1ff563dc42d703902d2fa.asciidoc create mode 100644 docs/examples/ff09e13391cecb2e8b9dd440b37e065f.asciidoc create mode 100644 docs/examples/ff63ae39c34925dbfa54282ec9989124.asciidoc diff --git a/docs/build/DOCTUM_VERSION b/docs/build/DOCTUM_VERSION new file mode 100644 index 000000000..acf69b48b --- /dev/null +++ b/docs/build/DOCTUM_VERSION @@ -0,0 +1 @@ +5.1.0 \ No newline at end of file diff --git a/docs/build/Elastic/Elasticsearch/Client.asciidoc b/docs/build/Elastic/Elasticsearch/Client.asciidoc new file mode 100644 index 000000000..cfd1652d1 --- /dev/null +++ b/docs/build/Elastic/Elasticsearch/Client.asciidoc @@ -0,0 +1,146 @@ + + +[[Elastic_Elasticsearch_Client]] +=== Elastic\Elasticsearch\Client + + + + +*Methods* + +The class defines the following methods: + +* <> +* <> +* <> +* <> +* <> +* <> +* <> +* <> +* <> +* <> + + + + +[[Elastic_Elasticsearch_ClientgetTransport_getTransport]] +.`getTransport()` +**** +[source,php] +---- +/* +*/ +---- +**** + + + +[[Elastic_Elasticsearch_ClientgetLogger_getLogger]] +.`getLogger()` +**** +[source,php] +---- +/* +*/ +---- +**** + + + +[[Elastic_Elasticsearch_ClientdefaultTransportSettings_defaultTransportSettings]] +.`defaultTransportSettings(Elastic\Transport\Transport $transport)` +**** +[source,php] +---- +/* +Set the default settings for Elasticsearch +*/ +---- +**** + + + +[[Elastic_Elasticsearch_ClientsetAsync_setAsync]] +.`setAsync(bool $async)` +**** +[source,php] +---- +/* +*/ +---- +**** + + + +[[Elastic_Elasticsearch_ClientgetAsync_getAsync]] +.`getAsync()` +**** +[source,php] +---- +/* +*/ +---- +**** + + + +[[Elastic_Elasticsearch_ClientsetElasticMetaHeader_setElasticMetaHeader]] +.`setElasticMetaHeader(bool $active)` +**** +[source,php] +---- +/* +*/ +---- +**** + + + +[[Elastic_Elasticsearch_ClientgetElasticMetaHeader_getElasticMetaHeader]] +.`getElasticMetaHeader()` +**** +[source,php] +---- +/* +*/ +---- +**** + + + +[[Elastic_Elasticsearch_ClientsetResponseException_setResponseException]] +.`setResponseException(bool $active)` +**** +[source,php] +---- +/* +*/ +---- +**** + + + +[[Elastic_Elasticsearch_ClientgetResponseException_getResponseException]] +.`getResponseException()` +**** +[source,php] +---- +/* +*/ +---- +**** + + + +[[Elastic_Elasticsearch_ClientsendRequest_sendRequest]] +.`sendRequest(Psr\Http\Message\RequestInterface $request)` +**** +[source,php] +---- +/* +*/ +---- +**** + + diff --git a/docs/build/Elastic/Elasticsearch/ClientBuilder.asciidoc b/docs/build/Elastic/Elasticsearch/ClientBuilder.asciidoc new file mode 100644 index 000000000..3edaf0413 --- /dev/null +++ b/docs/build/Elastic/Elasticsearch/ClientBuilder.asciidoc @@ -0,0 +1,309 @@ + + +[[Elastic_Elasticsearch_ClientBuilder]] +=== Elastic\Elasticsearch\ClientBuilder + + + + +*Methods* + +The class defines the following methods: + +* <> +* <> +* <> +* <> +* <> +* <> +* <> +* <> +* <> +* <> +* <> +* <> +* <> +* <> +* <> +* <> +* <> +* <> +* <> +* <> +* <> + + + + +[[Elastic_Elasticsearch_ClientBuildercreate_create]] +.`create()` +**** +[source,php] +---- +/* +Create an instance of ClientBuilder +*/ +---- +**** + + + +[[Elastic_Elasticsearch_ClientBuilderfromConfig_fromConfig]] +.`fromConfig(array $config, bool $quiet = false)` +**** +[source,php] +---- +/* +Build a new client from the provided config. Hash keys +should correspond to the method name e.g. ['nodePool'] +corresponds to setNodePool(). +*/ +---- +**** + + + +[[Elastic_Elasticsearch_ClientBuildersetHttpClient_setHttpClient]] +.`setHttpClient(Psr\Http\Client\ClientInterface $httpClient)` +**** +[source,php] +---- +/* +*/ +---- +**** + + + +[[Elastic_Elasticsearch_ClientBuildersetAsyncHttpClient_setAsyncHttpClient]] +.`setAsyncHttpClient(Http\Client\HttpAsyncClient $asyncHttpClient)` +**** +[source,php] +---- +/* +*/ +---- +**** + + + +[[Elastic_Elasticsearch_ClientBuildersetLogger_setLogger]] +.`setLogger(Psr\Log\LoggerInterface $logger)` +**** +[source,php] +---- +/* +Set the PSR-3 Logger +*/ +---- +**** + + + +[[Elastic_Elasticsearch_ClientBuildersetNodePool_setNodePool]] +.`setNodePool(Elastic\Transport\NodePool\NodePoolInterface $nodePool)` +**** +[source,php] +---- +/* +Set the NodePool +*/ +---- +**** + + + +[[Elastic_Elasticsearch_ClientBuildersetHosts_setHosts]] +.`setHosts(array $hosts)` +**** +[source,php] +---- +/* +Set the hosts (nodes) +*/ +---- +**** + + + +[[Elastic_Elasticsearch_ClientBuildersetApiKey_setApiKey]] +.`setApiKey(string $apiKey, string $id = null)` +**** +[source,php] +---- +/* +Set the ApiKey +If the id is not specified we store the ApiKey otherwise +we store as Base64(id:ApiKey) +*/ +---- +**** + + + +[[Elastic_Elasticsearch_ClientBuildersetBasicAuthentication_setBasicAuthentication]] +.`setBasicAuthentication(string $username, string $password)` +**** +[source,php] +---- +/* +Set the Basic Authentication +*/ +---- +**** + + + +[[Elastic_Elasticsearch_ClientBuildersetElasticCloudId_setElasticCloudId]] +.`setElasticCloudId(string $cloudId)` +**** +[source,php] +---- +/* +*/ +---- +**** + + + +[[Elastic_Elasticsearch_ClientBuildersetRetries_setRetries]] +.`setRetries(int $retries)` +**** +[source,php] +---- +/* +Set number or retries +*/ +---- +**** + + + +[[Elastic_Elasticsearch_ClientBuildersetSSLCert_setSSLCert]] +.`setSSLCert(string $cert, string $password = null)` +**** +[source,php] +---- +/* +Set SSL certificate +*/ +---- +**** + + + +[[Elastic_Elasticsearch_ClientBuildersetCABundle_setCABundle]] +.`setCABundle(string $cert)` +**** +[source,php] +---- +/* +Set the Certificate Authority (CA) bundle +*/ +---- +**** + + + +[[Elastic_Elasticsearch_ClientBuildersetSSLKey_setSSLKey]] +.`setSSLKey(string $key, string $password = null)` +**** +[source,php] +---- +/* +Set SSL key +*/ +---- +**** + + + +[[Elastic_Elasticsearch_ClientBuildersetSSLVerification_setSSLVerification]] +.`setSSLVerification(bool $value = true)` +**** +[source,php] +---- +/* +Enable or disable the SSL verification +*/ +---- +**** + + + +[[Elastic_Elasticsearch_ClientBuildersetElasticMetaHeader_setElasticMetaHeader]] +.`setElasticMetaHeader(bool $value = true)` +**** +[source,php] +---- +/* +Enable or disable the x-elastic-client-meta header +*/ +---- +**** + + + +[[Elastic_Elasticsearch_ClientBuildersetHttpClientOptions_setHttpClientOptions]] +.`setHttpClientOptions(array $options)` +**** +[source,php] +---- +/* +*/ +---- +**** + + + +[[Elastic_Elasticsearch_ClientBuilderbuild_build]] +.`build()` +**** +[source,php] +---- +/* +Build and returns the Client object +*/ +---- +**** + + + +[[Elastic_Elasticsearch_ClientBuilderisSymfonyHttpClient_isSymfonyHttpClient]] +.`isSymfonyHttpClient(Elastic\Transport\Transport $transport)` +**** +[source,php] +---- +/* +Returns true if the transport HTTP client is Symfony +*/ +---- +**** + + + +[[Elastic_Elasticsearch_ClientBuildergetConfig_getConfig]] +.`getConfig()` +**** +[source,php] +---- +/* +Returns the configuration to be used in the HTTP client +*/ +---- +**** + + + +[[Elastic_Elasticsearch_ClientBuildersetOptions_setOptions]] +.`setOptions(Psr\Http\Client\ClientInterface $client, array $config, array $clientOptions = [])` +**** +[source,php] +---- +/* +Set the configuration for the specific HTTP client using an adapter +*/ +---- +**** + + diff --git a/docs/build/PROJECT_VERSION b/docs/build/PROJECT_VERSION new file mode 100644 index 000000000..88d050b19 --- /dev/null +++ b/docs/build/PROJECT_VERSION @@ -0,0 +1 @@ +main \ No newline at end of file diff --git a/docs/build/classes.asciidoc b/docs/build/classes.asciidoc new file mode 100644 index 000000000..5a6386be2 --- /dev/null +++ b/docs/build/classes.asciidoc @@ -0,0 +1,12 @@ + +[[ElasticsearchPHP_Endpoints]] +== Reference - Endpoints + +This is a complete list of namespaces and their associated endpoints. + +NOTE: This is auto-generated documentation + +* <> +* <> +include::Elastic/Elasticsearch/Client.asciidoc[] +include::Elastic/Elasticsearch/ClientBuilder.asciidoc[] diff --git a/docs/build/interfaces.asciidoc b/docs/build/interfaces.asciidoc new file mode 100644 index 000000000..5b17b386b --- /dev/null +++ b/docs/build/interfaces.asciidoc @@ -0,0 +1,7 @@ + +[[ElasticsearchPHP_Interfaces]] +== Reference - Interfaces + +This is a complete list of available interfaces: + +* There are no interfaces available. diff --git a/docs/build/namespaces.asciidoc b/docs/build/namespaces.asciidoc new file mode 100644 index 000000000..012fe024d --- /dev/null +++ b/docs/build/namespaces.asciidoc @@ -0,0 +1,10 @@ + +[[ElasticsearchPHP_Namespaces]] +== Reference - Namespaces + +This is a complete list of available namespaces: + +* <> +* <> +include::Elastic.asciidoc[] +include::Elastic/Elasticsearch.asciidoc[] diff --git a/docs/build/renderer.index b/docs/build/renderer.index new file mode 100644 index 000000000..d68221a62 --- /dev/null +++ b/docs/build/renderer.index @@ -0,0 +1 @@ +C:21:"Doctum\Renderer\Index":277:{a:3:{i:0;a:2:{s:28:"Elastic\Elasticsearch\Client";s:40:"46a7cf2f921237bf05491debd93a683308ffda06";s:35:"Elastic\Elasticsearch\ClientBuilder";s:40:"d7dceb5278234b02707a765c1e7ddd251ad87098";}i:1;a:1:{i:0;s:4:"main";}i:2;a:2:{i:0;s:7:"Elastic";i:1;s:21:"Elastic\Elasticsearch";}}} \ No newline at end of file diff --git a/docs/examples/0246f73cc2ed3dfec577119e8cd15404.asciidoc b/docs/examples/0246f73cc2ed3dfec577119e8cd15404.asciidoc new file mode 100644 index 000000000..5121c82bf --- /dev/null +++ b/docs/examples/0246f73cc2ed3dfec577119e8cd15404.asciidoc @@ -0,0 +1,20 @@ +// indices/put-mapping.asciidoc:177 + +[source, php] +---- +$params = [ + 'index' => 'my-index-000001', + 'body' => [ + 'properties' => [ + 'name' => [ + 'properties' => [ + 'last' => [ + 'type' => 'text', + ], + ], + ], + ], + ], +]; +$response = $client->indices()->putMapping($params); +---- diff --git a/docs/examples/0264e994a7e68561e2ca6be0f0d90ee9.asciidoc b/docs/examples/0264e994a7e68561e2ca6be0f0d90ee9.asciidoc new file mode 100644 index 000000000..ecca9ad19 --- /dev/null +++ b/docs/examples/0264e994a7e68561e2ca6be0f0d90ee9.asciidoc @@ -0,0 +1,30 @@ +// aggregations/bucket/terms-aggregation.asciidoc:571 + +[source, php] +---- +$params = [ + 'body' => [ + 'aggs' => [ + 'JapaneseCars' => [ + 'terms' => [ + 'field' => 'make', + 'include' => [ + 'mazda', + 'honda', + ], + ], + ], + 'ActiveCarManufacturers' => [ + 'terms' => [ + 'field' => 'make', + 'exclude' => [ + 'rover', + 'jensen', + ], + ], + ], + ], + ], +]; +$response = $client->search($params); +---- diff --git a/docs/examples/07ba3eaa931f2cf110052e3544db51f8.asciidoc b/docs/examples/07ba3eaa931f2cf110052e3544db51f8.asciidoc new file mode 100644 index 000000000..dee6c053b --- /dev/null +++ b/docs/examples/07ba3eaa931f2cf110052e3544db51f8.asciidoc @@ -0,0 +1,24 @@ +// docs/reindex.asciidoc:878 + +[source, php] +---- +$params = [ + 'body' => [ + 'max_docs' => 10, + 'source' => [ + 'index' => 'my-index-000001', + 'query' => [ + 'function_score' => [ + 'random_score' => [ + ], + 'min_score' => 0.9, + ], + ], + ], + 'dest' => [ + 'index' => 'my-new-index-000001', + ], + ], +]; +$response = $client->reindex($params); +---- diff --git a/docs/examples/111c69ca94162c1523b799a5c14723dd.asciidoc b/docs/examples/111c69ca94162c1523b799a5c14723dd.asciidoc new file mode 100644 index 000000000..91add6372 --- /dev/null +++ b/docs/examples/111c69ca94162c1523b799a5c14723dd.asciidoc @@ -0,0 +1,13 @@ +// query-dsl/term-query.asciidoc:118 + +[source, php] +---- +$params = [ + 'index' => 'my-index-000001', + 'id' => '1', + 'body' => [ + 'full_text' => 'Quick Brown Foxes!', + ], +]; +$response = $client->index($params); +---- diff --git a/docs/examples/13d90ba227131aefbf4fcfd5992e662a.asciidoc b/docs/examples/13d90ba227131aefbf4fcfd5992e662a.asciidoc new file mode 100644 index 000000000..b6caf3e71 --- /dev/null +++ b/docs/examples/13d90ba227131aefbf4fcfd5992e662a.asciidoc @@ -0,0 +1,41 @@ +// query-dsl/bool-query.asciidoc:156 + +[source, php] +---- +$params = [ + 'body' => [ + 'query' => [ + 'bool' => [ + 'should' => [ + [ + 'match' => [ + 'name.first' => [ + 'query' => 'shay', + '_name' => 'first', + ], + ], + ], + [ + 'match' => [ + 'name.last' => [ + 'query' => 'banon', + '_name' => 'last', + ], + ], + ], + ], + 'filter' => [ + 'terms' => [ + 'name.last' => [ + 'banon', + 'kimchy', + ], + '_name' => 'test', + ], + ], + ], + ], + ], +]; +$response = $client->search($params); +---- diff --git a/docs/examples/151d2b11807ec684b0c01aa89189a801.asciidoc b/docs/examples/151d2b11807ec684b0c01aa89189a801.asciidoc new file mode 100644 index 000000000..dccd110a5 --- /dev/null +++ b/docs/examples/151d2b11807ec684b0c01aa89189a801.asciidoc @@ -0,0 +1,20 @@ +// query-dsl/query-string-query.asciidoc:474 + +[source, php] +---- +$params = [ + 'body' => [ + 'query' => [ + 'query_string' => [ + 'fields' => [ + 'title', + 'content', + ], + 'query' => 'this that thus', + 'minimum_should_match' => 2, + ], + ], + ], +]; +$response = $client->search($params); +---- diff --git a/docs/examples/1cecd4d87a92427175157d41859df2af.asciidoc b/docs/examples/1cecd4d87a92427175157d41859df2af.asciidoc new file mode 100644 index 000000000..d5545c359 --- /dev/null +++ b/docs/examples/1cecd4d87a92427175157d41859df2af.asciidoc @@ -0,0 +1,14 @@ +// cluster/allocation-explain.asciidoc:10 + +[source, php] +---- +$params = [ + 'body' => [ + 'index' => 'my-index-000001', + 'shard' => 0, + 'primary' => false, + 'current_node' => 'my-node', + ], +]; +$response = $client->cluster()->allocationExplain($params); +---- diff --git a/docs/examples/1e871f060dbe1a5c316ed205278804a8.asciidoc b/docs/examples/1e871f060dbe1a5c316ed205278804a8.asciidoc new file mode 100644 index 000000000..e60c62310 --- /dev/null +++ b/docs/examples/1e871f060dbe1a5c316ed205278804a8.asciidoc @@ -0,0 +1,36 @@ +// aggregations/bucket/terms-aggregation.asciidoc:338 + +[source, php] +---- +$params = [ + 'body' => [ + 'aggs' => [ + 'countries' => [ + 'terms' => [ + 'field' => 'artist.country', + 'order' => [ + 'rock>playback_stats.avg' => 'desc', + ], + ], + 'aggs' => [ + 'rock' => [ + 'filter' => [ + 'term' => [ + 'genre' => 'rock', + ], + ], + 'aggs' => [ + 'playback_stats' => [ + 'stats' => [ + 'field' => 'play_count', + ], + ], + ], + ], + ], + ], + ], + ], +]; +$response = $client->search($params); +---- diff --git a/docs/examples/1f673e1a0de2970dc648618d5425a994.asciidoc b/docs/examples/1f673e1a0de2970dc648618d5425a994.asciidoc new file mode 100644 index 000000000..a1c8735fd --- /dev/null +++ b/docs/examples/1f673e1a0de2970dc648618d5425a994.asciidoc @@ -0,0 +1,10 @@ +// docs/reindex.asciidoc:267 + +[source, php] +---- +$response = $client->indices()->refresh(); +$params = [ + 'index' => 'my-new-index-000001', +]; +$response = $client->search($params); +---- diff --git a/docs/examples/20005d8a6555b259b299d862cd218701.asciidoc b/docs/examples/20005d8a6555b259b299d862cd218701.asciidoc new file mode 100644 index 000000000..60c89c42e --- /dev/null +++ b/docs/examples/20005d8a6555b259b299d862cd218701.asciidoc @@ -0,0 +1,18 @@ +// query-dsl/match-query.asciidoc:186 + +[source, php] +---- +$params = [ + 'body' => [ + 'query' => [ + 'match' => [ + 'message' => [ + 'query' => 'this is a test', + 'operator' => 'and', + ], + ], + ], + ], +]; +$response = $client->search($params); +---- diff --git a/docs/examples/242a26ced0e5706e48dcda19a4003094.asciidoc b/docs/examples/242a26ced0e5706e48dcda19a4003094.asciidoc new file mode 100644 index 000000000..57ae1ec97 --- /dev/null +++ b/docs/examples/242a26ced0e5706e48dcda19a4003094.asciidoc @@ -0,0 +1,26 @@ +// docs/reindex.asciidoc:964 + +[source, php] +---- +$params = [ + 'body' => [ + 'source' => [ + 'remote' => [ + 'host' => 'http://otherhost:9200', + 'username' => 'user', + 'password' => 'pass', + ], + 'index' => 'my-index-000001', + 'query' => [ + 'match' => [ + 'test' => 'data', + ], + ], + ], + 'dest' => [ + 'index' => 'my-new-index-000001', + ], + ], +]; +$response = $client->reindex($params); +---- diff --git a/docs/examples/25576b6773322f0929d4c635a940dba0.asciidoc b/docs/examples/25576b6773322f0929d4c635a940dba0.asciidoc new file mode 100644 index 000000000..f4588decf --- /dev/null +++ b/docs/examples/25576b6773322f0929d4c635a940dba0.asciidoc @@ -0,0 +1,21 @@ +// query-dsl/query-string-query.asciidoc:530 + +[source, php] +---- +$params = [ + 'body' => [ + 'query' => [ + 'query_string' => [ + 'fields' => [ + 'title', + 'content', + ], + 'query' => 'this OR that OR thus', + 'type' => 'cross_fields', + 'minimum_should_match' => 2, + ], + ], + ], +]; +$response = $client->search($params); +---- diff --git a/docs/examples/2932e6f71e247cf52e11d2f38f114ddf.asciidoc b/docs/examples/2932e6f71e247cf52e11d2f38f114ddf.asciidoc new file mode 100644 index 000000000..3bf662366 --- /dev/null +++ b/docs/examples/2932e6f71e247cf52e11d2f38f114ddf.asciidoc @@ -0,0 +1,16 @@ +// docs/reindex.asciidoc:294 + +[source, php] +---- +$params = [ + 'body' => [ + 'source' => [ + 'index' => 'my-index-000001', + ], + 'dest' => [ + 'index' => 'my-new-index-000001', + ], + ], +]; +$response = $client->reindex($params); +---- diff --git a/docs/examples/2a247e36a86a373bcbf478ac9a588f44.asciidoc b/docs/examples/2a247e36a86a373bcbf478ac9a588f44.asciidoc new file mode 100644 index 000000000..b2f890949 --- /dev/null +++ b/docs/examples/2a247e36a86a373bcbf478ac9a588f44.asciidoc @@ -0,0 +1,16 @@ +// docs/index_.asciidoc:328 + +[source, php] +---- +$params = [ + 'index' => 'my-index-000001', + 'body' => [ + '@timestamp' => '2099-11-15T13:12:00', + 'message' => 'GET /search HTTP/1.1 200 1070000', + 'user' => [ + 'id' => 'kimchy', + ], + ], +]; +$response = $client->index($params); +---- diff --git a/docs/examples/2a9747bcfaf1f9491ebd410b3fcb6798.asciidoc b/docs/examples/2a9747bcfaf1f9491ebd410b3fcb6798.asciidoc new file mode 100644 index 000000000..cdb9654b5 --- /dev/null +++ b/docs/examples/2a9747bcfaf1f9491ebd410b3fcb6798.asciidoc @@ -0,0 +1,16 @@ +// query-dsl/query-string-query.asciidoc:45 + +[source, php] +---- +$params = [ + 'body' => [ + 'query' => [ + 'query_string' => [ + 'query' => '(new york city) OR (big apple)', + 'default_field' => 'content', + ], + ], + ], +]; +$response = $client->search($params); +---- diff --git a/docs/examples/2cd8439db5054c93c49f1bf50433e1bb.asciidoc b/docs/examples/2cd8439db5054c93c49f1bf50433e1bb.asciidoc new file mode 100644 index 000000000..1040eded8 --- /dev/null +++ b/docs/examples/2cd8439db5054c93c49f1bf50433e1bb.asciidoc @@ -0,0 +1,27 @@ +// cluster/reroute.asciidoc:195 + +[source, php] +---- +$params = [ + 'body' => [ + 'commands' => [ + [ + 'move' => [ + 'index' => 'test', + 'shard' => 0, + 'from_node' => 'node1', + 'to_node' => 'node2', + ], + ], + [ + 'allocate_replica' => [ + 'index' => 'test', + 'shard' => 1, + 'node' => 'node3', + ], + ], + ], + ], +]; +$response = $client->cluster()->reroute($params); +---- diff --git a/docs/examples/2d01a9e5550b525496757f1bd7f0e706.asciidoc b/docs/examples/2d01a9e5550b525496757f1bd7f0e706.asciidoc new file mode 100644 index 000000000..0a7a4670a --- /dev/null +++ b/docs/examples/2d01a9e5550b525496757f1bd7f0e706.asciidoc @@ -0,0 +1,17 @@ +// docs/index_.asciidoc:456 + +[source, php] +---- +$params = [ + 'index' => 'my-index-000001', + 'id' => '1', + 'body' => [ + '@timestamp' => '2099-11-15T13:12:00', + 'message' => 'GET /search HTTP/1.1 200 1070000', + 'user' => [ + 'id' => 'kimchy', + ], + ], +]; +$response = $client->index($params); +---- diff --git a/docs/examples/2fa45d74ba9933188c4728f8a9e5372c.asciidoc b/docs/examples/2fa45d74ba9933188c4728f8a9e5372c.asciidoc new file mode 100644 index 000000000..d251300cb --- /dev/null +++ b/docs/examples/2fa45d74ba9933188c4728f8a9e5372c.asciidoc @@ -0,0 +1,29 @@ +// docs/index_.asciidoc:227 + +[source, php] +---- +$params = [ + 'body' => [ + 'persistent' => [ + 'action.auto_create_index' => 'my-index-000001,index10,-index1*,+ind*', + ], + ], +]; +$response = $client->cluster()->putSettings($params); +$params = [ + 'body' => [ + 'persistent' => [ + 'action.auto_create_index' => 'false', + ], + ], +]; +$response = $client->cluster()->putSettings($params); +$params = [ + 'body' => [ + 'persistent' => [ + 'action.auto_create_index' => 'true', + ], + ], +]; +$response = $client->cluster()->putSettings($params); +---- diff --git a/docs/examples/2fc80a2ad1ca8b2dcb13ed1895b8e861.asciidoc b/docs/examples/2fc80a2ad1ca8b2dcb13ed1895b8e861.asciidoc new file mode 100644 index 000000000..92271f821 --- /dev/null +++ b/docs/examples/2fc80a2ad1ca8b2dcb13ed1895b8e861.asciidoc @@ -0,0 +1,13 @@ +// cluster/update-settings.asciidoc:123 + +[source, php] +---- +$params = [ + 'body' => [ + 'transient' => [ + 'indices.recovery.*' => , + ], + ], +]; +$response = $client->cluster()->putSettings($params); +---- diff --git a/docs/examples/2fea3e324939cc7e9c396964aeee7111.asciidoc b/docs/examples/2fea3e324939cc7e9c396964aeee7111.asciidoc new file mode 100644 index 000000000..9754ccab8 --- /dev/null +++ b/docs/examples/2fea3e324939cc7e9c396964aeee7111.asciidoc @@ -0,0 +1,19 @@ +// query-dsl/match-query.asciidoc:252 + +[source, php] +---- +$params = [ + 'body' => [ + 'query' => [ + 'match' => [ + 'message' => [ + 'query' => 'to be or not to be', + 'operator' => 'and', + 'zero_terms_query' => 'all', + ], + ], + ], + ], +]; +$response = $client->search($params); +---- diff --git a/docs/examples/30f3e3b9df46afd12e68bc71f18483b4.asciidoc b/docs/examples/30f3e3b9df46afd12e68bc71f18483b4.asciidoc new file mode 100644 index 000000000..7436f80bb --- /dev/null +++ b/docs/examples/30f3e3b9df46afd12e68bc71f18483b4.asciidoc @@ -0,0 +1,28 @@ +// indices/put-mapping.asciidoc:125 + +[source, php] +---- +$params = [ + 'index' => 'my-index-000001', +]; +$response = $client->indices()->create($params); +$params = [ + 'index' => 'my-index-000002', +]; +$response = $client->indices()->create($params); +$params = [ + 'index' => 'my-index-000001,my-index-000002', + 'body' => [ + 'properties' => [ + 'user' => [ + 'properties' => [ + 'name' => [ + 'type' => 'keyword', + ], + ], + ], + ], + ], +]; +$response = $client->indices()->putMapping($params); +---- diff --git a/docs/examples/3541d4a85e27b2c3896a7a7ee98b4b37.asciidoc b/docs/examples/3541d4a85e27b2c3896a7a7ee98b4b37.asciidoc new file mode 100644 index 000000000..4b910676e --- /dev/null +++ b/docs/examples/3541d4a85e27b2c3896a7a7ee98b4b37.asciidoc @@ -0,0 +1,6 @@ +// health/health.asciidoc:478 + +[source, php] +---- +$response = $client->healthReport(); +---- diff --git a/docs/examples/355d0ee2fcb6c1fc403c6267f710e25a.asciidoc b/docs/examples/355d0ee2fcb6c1fc403c6267f710e25a.asciidoc new file mode 100644 index 000000000..20e6f604d --- /dev/null +++ b/docs/examples/355d0ee2fcb6c1fc403c6267f710e25a.asciidoc @@ -0,0 +1,19 @@ +// docs/reindex.asciidoc:716 + +[source, php] +---- +$params = [ + 'body' => [ + 'source' => [ + 'index' => [ + 'my-index-000001', + 'my-index-000002', + ], + ], + 'dest' => [ + 'index' => 'my-new-index-000002', + ], + ], +]; +$response = $client->reindex($params); +---- diff --git a/docs/examples/36b86b97feedcf5632824eefc251d6ed.asciidoc b/docs/examples/36b86b97feedcf5632824eefc251d6ed.asciidoc new file mode 100644 index 000000000..eaed0da0f --- /dev/null +++ b/docs/examples/36b86b97feedcf5632824eefc251d6ed.asciidoc @@ -0,0 +1,16 @@ +// getting-started.asciidoc:245 + +[source, php] +---- +$params = [ + 'index' => 'books', + 'body' => [ + 'query' => [ + 'match' => [ + 'name' => 'brave', + ], + ], + ], +]; +$response = $client->search($params); +---- diff --git a/docs/examples/37530f35f315b9f35e3e6a13cf2a1ccd.asciidoc b/docs/examples/37530f35f315b9f35e3e6a13cf2a1ccd.asciidoc new file mode 100644 index 000000000..a89161d2a --- /dev/null +++ b/docs/examples/37530f35f315b9f35e3e6a13cf2a1ccd.asciidoc @@ -0,0 +1,27 @@ +// aggregations/bucket/terms-aggregation.asciidoc:731 + +[source, php] +---- +$params = [ + 'body' => [ + 'aggs' => [ + 'actors' => [ + 'terms' => [ + 'field' => 'actors', + 'size' => 10, + 'collect_mode' => 'breadth_first', + ], + 'aggs' => [ + 'costars' => [ + 'terms' => [ + 'field' => 'actors', + 'size' => 5, + ], + ], + ], + ], + ], + ], +]; +$response = $client->search($params); +---- diff --git a/docs/examples/39ce44333d28ed2b833722d3e3cb06f3.asciidoc b/docs/examples/39ce44333d28ed2b833722d3e3cb06f3.asciidoc new file mode 100644 index 000000000..fc1b16387 --- /dev/null +++ b/docs/examples/39ce44333d28ed2b833722d3e3cb06f3.asciidoc @@ -0,0 +1,41 @@ +// query-dsl/bool-query.asciidoc:184 + +[source, php] +---- +$params = [ + 'body' => [ + 'query' => [ + 'bool' => [ + 'should' => [ + [ + 'match' => [ + 'name.first' => [ + 'query' => 'shay', + '_name' => 'first', + ], + ], + ], + [ + 'match' => [ + 'name.last' => [ + 'query' => 'banon', + '_name' => 'last', + ], + ], + ], + ], + 'filter' => [ + 'terms' => [ + 'name.last' => [ + 'banon', + 'kimchy', + ], + '_name' => 'test', + ], + ], + ], + ], + ], +]; +$response = $client->search($params); +---- diff --git a/docs/examples/3b8ab7027e0d616fb432acd8813e086c.asciidoc b/docs/examples/3b8ab7027e0d616fb432acd8813e086c.asciidoc new file mode 100644 index 000000000..61361f036 --- /dev/null +++ b/docs/examples/3b8ab7027e0d616fb432acd8813e086c.asciidoc @@ -0,0 +1,17 @@ +// docs/index_.asciidoc:544 + +[source, php] +---- +$params = [ + 'index' => 'my-index-000001', + 'id' => '1', + 'body' => [ + '@timestamp' => '2099-11-15T13:12:00', + 'message' => 'GET /search HTTP/1.1 200 1070000', + 'user' => [ + 'id' => 'kimchy', + ], + ], +]; +$response = $client->index($params); +---- diff --git a/docs/examples/3bb491db29deba25e1cc82bcaa1aa1a1.asciidoc b/docs/examples/3bb491db29deba25e1cc82bcaa1aa1a1.asciidoc new file mode 100644 index 000000000..c1b97d37c --- /dev/null +++ b/docs/examples/3bb491db29deba25e1cc82bcaa1aa1a1.asciidoc @@ -0,0 +1,19 @@ +// docs/reindex.asciidoc:775 + +[source, php] +---- +$params = [ + 'body' => [ + 'source' => [ + 'index' => 'my-index-000001', + ], + 'dest' => [ + 'index' => 'my-new-index-000001', + ], + 'script' => [ + 'source' => 'ctx._source.tag = ctx._source.remove("flag")', + ], + ], +]; +$response = $client->reindex($params); +---- diff --git a/docs/examples/3d1a0e1dc5310544d032108ae0b3f099.asciidoc b/docs/examples/3d1a0e1dc5310544d032108ae0b3f099.asciidoc new file mode 100644 index 000000000..23ca292d6 --- /dev/null +++ b/docs/examples/3d1a0e1dc5310544d032108ae0b3f099.asciidoc @@ -0,0 +1,15 @@ +// query-dsl/match-all-query.asciidoc:23 + +[source, php] +---- +$params = [ + 'body' => [ + 'query' => [ + 'match_all' => [ + 'boost' => 1.2, + ], + ], + ], +]; +$response = $client->search($params); +---- diff --git a/docs/examples/3e8ed6ae016eb823cb00d9035b8ac459.asciidoc b/docs/examples/3e8ed6ae016eb823cb00d9035b8ac459.asciidoc new file mode 100644 index 000000000..d206d6ecd --- /dev/null +++ b/docs/examples/3e8ed6ae016eb823cb00d9035b8ac459.asciidoc @@ -0,0 +1,9 @@ +// search/search.asciidoc:10 + +[source, php] +---- +$params = [ + 'index' => 'my-index-000001', +]; +$response = $client->search($params); +---- diff --git a/docs/examples/3faf5e2873de340acfe0a617017db784.asciidoc b/docs/examples/3faf5e2873de340acfe0a617017db784.asciidoc new file mode 100644 index 000000000..1217e8339 --- /dev/null +++ b/docs/examples/3faf5e2873de340acfe0a617017db784.asciidoc @@ -0,0 +1,15 @@ +// query-dsl/query-string-query.asciidoc:283 + +[source, php] +---- +$params = [ + 'body' => [ + 'query' => [ + 'query_string' => [ + 'query' => '(content:this OR name:this) AND (content:that OR name:that)', + ], + ], + ], +]; +$response = $client->search($params); +---- diff --git a/docs/examples/4029af36cb3f8202549017f7378803b4.asciidoc b/docs/examples/4029af36cb3f8202549017f7378803b4.asciidoc new file mode 100644 index 000000000..ea762f084 --- /dev/null +++ b/docs/examples/4029af36cb3f8202549017f7378803b4.asciidoc @@ -0,0 +1,6 @@ +// cluster/get-settings.asciidoc:10 + +[source, php] +---- +$response = $client->cluster()->getSettings(); +---- diff --git a/docs/examples/41dbd79f624b998d01c10921e9a35c4b.asciidoc b/docs/examples/41dbd79f624b998d01c10921e9a35c4b.asciidoc new file mode 100644 index 000000000..ef4f65346 --- /dev/null +++ b/docs/examples/41dbd79f624b998d01c10921e9a35c4b.asciidoc @@ -0,0 +1,16 @@ +// docs/update.asciidoc:290 + +[source, php] +---- +$params = [ + 'index' => 'test', + 'id' => '1', + 'body' => [ + 'doc' => [ + 'name' => 'new_name', + ], + 'detect_noop' => false, + ], +]; +$response = $client->update($params); +---- diff --git a/docs/examples/436d50b85fc8f0977d02059eec00719b.asciidoc b/docs/examples/436d50b85fc8f0977d02059eec00719b.asciidoc new file mode 100644 index 000000000..8cc8b1f3a --- /dev/null +++ b/docs/examples/436d50b85fc8f0977d02059eec00719b.asciidoc @@ -0,0 +1,22 @@ +// docs/update.asciidoc:309 + +[source, php] +---- +$params = [ + 'index' => 'test', + 'id' => '1', + 'body' => [ + 'script' => [ + 'source' => 'ctx._source.counter += params.count', + 'lang' => 'painless', + 'params' => [ + 'count' => 4, + ], + ], + 'upsert' => [ + 'counter' => 1, + ], + ], +]; +$response = $client->update($params); +---- diff --git a/docs/examples/472ec8c57fec8457e31fe6dd7f6e3713.asciidoc b/docs/examples/472ec8c57fec8457e31fe6dd7f6e3713.asciidoc new file mode 100644 index 000000000..170da3f8a --- /dev/null +++ b/docs/examples/472ec8c57fec8457e31fe6dd7f6e3713.asciidoc @@ -0,0 +1,19 @@ +// query-dsl/query-string-query.asciidoc:448 + +[source, php] +---- +$params = [ + 'body' => [ + 'query' => [ + 'query_string' => [ + 'fields' => [ + 'title', + ], + 'query' => 'this that thus', + 'minimum_should_match' => 2, + ], + ], + ], +]; +$response = $client->search($params); +---- diff --git a/docs/examples/4ba86373e13e106de044f190343be328.asciidoc b/docs/examples/4ba86373e13e106de044f190343be328.asciidoc new file mode 100644 index 000000000..13f382918 --- /dev/null +++ b/docs/examples/4ba86373e13e106de044f190343be328.asciidoc @@ -0,0 +1,41 @@ +// aggregations/bucket/terms-aggregation.asciidoc:365 + +[source, php] +---- +$params = [ + 'body' => [ + 'aggs' => [ + 'countries' => [ + 'terms' => [ + 'field' => 'artist.country', + 'order' => [ + [ + 'rock>playback_stats.avg' => 'desc', + ], + [ + '_count' => 'desc', + ], + ], + ], + 'aggs' => [ + 'rock' => [ + 'filter' => [ + 'term' => [ + 'genre' => 'rock', + ], + ], + 'aggs' => [ + 'playback_stats' => [ + 'stats' => [ + 'field' => 'play_count', + ], + ], + ], + ], + ], + ], + ], + ], +]; +$response = $client->search($params); +---- diff --git a/docs/examples/4bc744b0f33b322741a8caf6d8d7d765.asciidoc b/docs/examples/4bc744b0f33b322741a8caf6d8d7d765.asciidoc new file mode 100644 index 000000000..ee5c72853 --- /dev/null +++ b/docs/examples/4bc744b0f33b322741a8caf6d8d7d765.asciidoc @@ -0,0 +1,17 @@ +// docs/index_.asciidoc:594 + +[source, php] +---- +$params = [ + 'index' => 'my-index-000001', + 'id' => '1', + 'body' => [ + '@timestamp' => '2099-11-15T13:12:00', + 'message' => 'GET /search HTTP/1.1 200 1070000', + 'user' => [ + 'id' => 'kimchy', + ], + ], +]; +$response = $client->index($params); +---- diff --git a/docs/examples/4c3db8987d7b2d3d3df78ff1e71e7ede.asciidoc b/docs/examples/4c3db8987d7b2d3d3df78ff1e71e7ede.asciidoc new file mode 100644 index 000000000..885082c2d --- /dev/null +++ b/docs/examples/4c3db8987d7b2d3d3df78ff1e71e7ede.asciidoc @@ -0,0 +1,17 @@ +// query-dsl/match-query.asciidoc:18 + +[source, php] +---- +$params = [ + 'body' => [ + 'query' => [ + 'match' => [ + 'message' => [ + 'query' => 'this is a test', + ], + ], + ], + ], +]; +$response = $client->search($params); +---- diff --git a/docs/examples/4ca15672fc5ab1d80a127d086b6d2837.asciidoc b/docs/examples/4ca15672fc5ab1d80a127d086b6d2837.asciidoc new file mode 100644 index 000000000..bd58e2577 --- /dev/null +++ b/docs/examples/4ca15672fc5ab1d80a127d086b6d2837.asciidoc @@ -0,0 +1,6 @@ +// cluster/allocation-explain.asciidoc:342 + +[source, php] +---- +$response = $client->cluster()->allocationExplain(); +---- diff --git a/docs/examples/50b5c0332949d2154c72b629b5fa6222.asciidoc b/docs/examples/50b5c0332949d2154c72b629b5fa6222.asciidoc new file mode 100644 index 000000000..267b89abc --- /dev/null +++ b/docs/examples/50b5c0332949d2154c72b629b5fa6222.asciidoc @@ -0,0 +1,19 @@ +// indices/put-mapping.asciidoc:339 + +[source, php] +---- +$params = [ + 'index' => 'my-index-000001', + 'body' => [ + 'user_id' => 12345, + ], +]; +$response = $client->index($params); +$params = [ + 'index' => 'my-index-000001', + 'body' => [ + 'user_id' => 12346, + ], +]; +$response = $client->index($params); +---- diff --git a/docs/examples/54a215d242ab65123b09e9dfb71bcbbf.asciidoc b/docs/examples/54a215d242ab65123b09e9dfb71bcbbf.asciidoc new file mode 100644 index 000000000..9e71174ed --- /dev/null +++ b/docs/examples/54a215d242ab65123b09e9dfb71bcbbf.asciidoc @@ -0,0 +1,20 @@ +// aggregations/bucket/terms-aggregation.asciidoc:237 + +[source, php] +---- +$params = [ + 'body' => [ + 'aggs' => [ + 'genres' => [ + 'terms' => [ + 'field' => 'genre', + 'order' => [ + '_key' => 'asc', + ], + ], + ], + ], + ], +]; +$response = $client->search($params); +---- diff --git a/docs/examples/56a1aa4f7fa62f2289e20607e3039bf3.asciidoc b/docs/examples/56a1aa4f7fa62f2289e20607e3039bf3.asciidoc new file mode 100644 index 000000000..8065fbfb7 --- /dev/null +++ b/docs/examples/56a1aa4f7fa62f2289e20607e3039bf3.asciidoc @@ -0,0 +1,16 @@ +// indices/put-mapping.asciidoc:13 + +[source, php] +---- +$params = [ + 'index' => 'my-index-000001', + 'body' => [ + 'properties' => [ + 'email' => [ + 'type' => 'keyword', + ], + ], + ], +]; +$response = $client->indices()->putMapping($params); +---- diff --git a/docs/examples/56a903530990313b753b1be33578997a.asciidoc b/docs/examples/56a903530990313b753b1be33578997a.asciidoc new file mode 100644 index 000000000..a6bde4bd3 --- /dev/null +++ b/docs/examples/56a903530990313b753b1be33578997a.asciidoc @@ -0,0 +1,36 @@ +// query-dsl/multi-match-query.asciidoc:448 + +[source, php] +---- +$params = [ + 'body' => [ + 'query' => [ + 'dis_max' => [ + 'queries' => [ + [ + 'multi_match' => [ + 'query' => 'Will Smith', + 'type' => 'cross_fields', + 'fields' => [ + 'first', + 'last', + ], + 'minimum_should_match' => '50%', + ], + ], + [ + 'multi_match' => [ + 'query' => 'Will Smith', + 'type' => 'cross_fields', + 'fields' => [ + '*.edge', + ], + ], + ], + ], + ], + ], + ], +]; +$response = $client->search($params); +---- diff --git a/docs/examples/5b58007f10700ec7934580f034404652.asciidoc b/docs/examples/5b58007f10700ec7934580f034404652.asciidoc new file mode 100644 index 000000000..13ffb2355 --- /dev/null +++ b/docs/examples/5b58007f10700ec7934580f034404652.asciidoc @@ -0,0 +1,17 @@ +// docs/index_.asciidoc:579 + +[source, php] +---- +$params = [ + 'index' => 'my-index-000001', + 'id' => '1', + 'body' => [ + '@timestamp' => '2099-11-15T13:12:00', + 'message' => 'GET /search HTTP/1.1 200 1070000', + 'user' => [ + 'id' => 'kimchy', + ], + ], +]; +$response = $client->create($params); +---- diff --git a/docs/examples/5f1ed9cfdc149763b444acfbe10b0e16.asciidoc b/docs/examples/5f1ed9cfdc149763b444acfbe10b0e16.asciidoc new file mode 100644 index 000000000..80b58c877 --- /dev/null +++ b/docs/examples/5f1ed9cfdc149763b444acfbe10b0e16.asciidoc @@ -0,0 +1,19 @@ +// indices/put-mapping.asciidoc:265 + +[source, php] +---- +$params = [ + 'index' => 'my-index-000001', + 'body' => [ + 'mappings' => [ + 'properties' => [ + 'user_id' => [ + 'type' => 'keyword', + 'ignore_above' => 20, + ], + ], + ], + ], +]; +$response = $client->indices()->create($params); +---- diff --git a/docs/examples/60f889fbed5df3185444f7015b48ed76.asciidoc b/docs/examples/60f889fbed5df3185444f7015b48ed76.asciidoc new file mode 100644 index 000000000..8d804ff87 --- /dev/null +++ b/docs/examples/60f889fbed5df3185444f7015b48ed76.asciidoc @@ -0,0 +1,9 @@ +// indices/create-index.asciidoc:10 + +[source, php] +---- +$params = [ + 'index' => 'my-index-000001', +]; +$response = $client->indices()->create($params); +---- diff --git a/docs/examples/63cc960215ae83b359c12df3c0993bfa.asciidoc b/docs/examples/63cc960215ae83b359c12df3c0993bfa.asciidoc new file mode 100644 index 000000000..2b69fbdc6 --- /dev/null +++ b/docs/examples/63cc960215ae83b359c12df3c0993bfa.asciidoc @@ -0,0 +1,17 @@ +// indices/create-index.asciidoc:130 + +[source, php] +---- +$params = [ + 'index' => 'my-index-000001', + 'body' => [ + 'settings' => [ + 'index' => [ + 'number_of_shards' => 3, + 'number_of_replicas' => 2, + ], + ], + ], +]; +$response = $client->indices()->create($params); +---- diff --git a/docs/examples/64aff98cf477555e7411714c17006572.asciidoc b/docs/examples/64aff98cf477555e7411714c17006572.asciidoc new file mode 100644 index 000000000..146414458 --- /dev/null +++ b/docs/examples/64aff98cf477555e7411714c17006572.asciidoc @@ -0,0 +1,18 @@ +// query-dsl/range-query.asciidoc:150 + +[source, php] +---- +$params = [ + 'body' => [ + 'query' => [ + 'range' => [ + 'timestamp' => [ + 'gte' => 'now-1d/d', + 'lte' => 'now/d', + ], + ], + ], + ], +]; +$response = $client->search($params); +---- diff --git a/docs/examples/653c0d0ef146c997ef6bc6450d4f5f94.asciidoc b/docs/examples/653c0d0ef146c997ef6bc6450d4f5f94.asciidoc new file mode 100644 index 000000000..9a633eaa7 --- /dev/null +++ b/docs/examples/653c0d0ef146c997ef6bc6450d4f5f94.asciidoc @@ -0,0 +1,26 @@ +// aggregations/bucket/terms-aggregation.asciidoc:700 + +[source, php] +---- +$params = [ + 'body' => [ + 'aggs' => [ + 'actors' => [ + 'terms' => [ + 'field' => 'actors', + 'size' => 10, + ], + 'aggs' => [ + 'costars' => [ + 'terms' => [ + 'field' => 'actors', + 'size' => 5, + ], + ], + ], + ], + ], + ], +]; +$response = $client->search($params); +---- diff --git a/docs/examples/6b0288acb739c4667d41339e5100c327.asciidoc b/docs/examples/6b0288acb739c4667d41339e5100c327.asciidoc new file mode 100644 index 000000000..71c4f8980 --- /dev/null +++ b/docs/examples/6b0288acb739c4667d41339e5100c327.asciidoc @@ -0,0 +1,18 @@ +// query-dsl/match-query.asciidoc:230 + +[source, php] +---- +$params = [ + 'body' => [ + 'query' => [ + 'match' => [ + 'message' => [ + 'query' => 'this is a testt', + 'fuzziness' => 'AUTO', + ], + ], + ], + ], +]; +$response = $client->search($params); +---- diff --git a/docs/examples/6b77795e9249c8d9865f7a49fd86a863.asciidoc b/docs/examples/6b77795e9249c8d9865f7a49fd86a863.asciidoc new file mode 100644 index 000000000..ace2faa7c --- /dev/null +++ b/docs/examples/6b77795e9249c8d9865f7a49fd86a863.asciidoc @@ -0,0 +1,19 @@ +// query-dsl/range-query.asciidoc:16 + +[source, php] +---- +$params = [ + 'body' => [ + 'query' => [ + 'range' => [ + 'age' => [ + 'gte' => 10, + 'lte' => 20, + 'boost' => 2, + ], + ], + ], + ], +]; +$response = $client->search($params); +---- diff --git a/docs/examples/6e000496a1fa8b57148518eaad692f35.asciidoc b/docs/examples/6e000496a1fa8b57148518eaad692f35.asciidoc new file mode 100644 index 000000000..3517c479d --- /dev/null +++ b/docs/examples/6e000496a1fa8b57148518eaad692f35.asciidoc @@ -0,0 +1,14 @@ +// query-dsl/match-all-query.asciidoc:39 + +[source, php] +---- +$params = [ + 'body' => [ + 'query' => [ + 'match_none' => [ + ], + ], + ], +]; +$response = $client->search($params); +---- diff --git a/docs/examples/7b5c231526846f2f7b98d78f3656ae6a.asciidoc b/docs/examples/7b5c231526846f2f7b98d78f3656ae6a.asciidoc new file mode 100644 index 000000000..adaa9f7a1 --- /dev/null +++ b/docs/examples/7b5c231526846f2f7b98d78f3656ae6a.asciidoc @@ -0,0 +1,16 @@ +// docs/update.asciidoc:362 + +[source, php] +---- +$params = [ + 'index' => 'test', + 'id' => '1', + 'body' => [ + 'doc' => [ + 'name' => 'new_name', + ], + 'doc_as_upsert' => true, + ], +]; +$response = $client->update($params); +---- diff --git a/docs/examples/7c862a20772467e0f5beebbd1b80c4cb.asciidoc b/docs/examples/7c862a20772467e0f5beebbd1b80c4cb.asciidoc new file mode 100644 index 000000000..08a36a6bb --- /dev/null +++ b/docs/examples/7c862a20772467e0f5beebbd1b80c4cb.asciidoc @@ -0,0 +1,29 @@ +// docs/reindex.asciidoc:1095 + +[source, php] +---- +$params = [ + 'body' => [ + +{ + "source": { + "remote": { + "host": "http://otherhost:9200", + ..., + "socket_timeout": "1m", + "connect_timeout": "10s" + }, + "index": "source", + "query": { + "match": { + "test": "data" + } + } + }, + "dest": { + "index": "dest" + } +} ], +]; +$response = $client->reindex($params); +---- diff --git a/docs/examples/7ca224d1a7de20a15c008e1b9dbda377.asciidoc b/docs/examples/7ca224d1a7de20a15c008e1b9dbda377.asciidoc new file mode 100644 index 000000000..f54599a61 --- /dev/null +++ b/docs/examples/7ca224d1a7de20a15c008e1b9dbda377.asciidoc @@ -0,0 +1,18 @@ +// aggregations/bucket/terms-aggregation.asciidoc:807 + +[source, php] +---- +$params = [ + 'body' => [ + 'aggs' => [ + 'tags' => [ + 'terms' => [ + 'field' => 'tags', + 'missing' => 'N/A', + ], + ], + ], + ], +]; +$response = $client->search($params); +---- diff --git a/docs/examples/7e484b8b41f9dbc2bcf1f340db197c1d.asciidoc b/docs/examples/7e484b8b41f9dbc2bcf1f340db197c1d.asciidoc new file mode 100644 index 000000000..3705898b2 --- /dev/null +++ b/docs/examples/7e484b8b41f9dbc2bcf1f340db197c1d.asciidoc @@ -0,0 +1,16 @@ +// docs/reindex.asciidoc:25 + +[source, php] +---- +$params = [ + 'body' => [ + 'source' => [ + 'index' => 'my-index-000001', + ], + 'dest' => [ + 'index' => 'my-new-index-000001', + ], + ], +]; +$response = $client->reindex($params); +---- diff --git a/docs/examples/803bbc14fbec0e49dfed9fab49c8a7f8.asciidoc b/docs/examples/803bbc14fbec0e49dfed9fab49c8a7f8.asciidoc new file mode 100644 index 000000000..0e36dd6ad --- /dev/null +++ b/docs/examples/803bbc14fbec0e49dfed9fab49c8a7f8.asciidoc @@ -0,0 +1,18 @@ +// query-dsl/term-query.asciidoc:99 + +[source, php] +---- +$params = [ + 'index' => 'my-index-000001', + 'body' => [ + 'mappings' => [ + 'properties' => [ + 'full_text' => [ + 'type' => 'text', + ], + ], + ], + ], +]; +$response = $client->indices()->create($params); +---- diff --git a/docs/examples/8575c966b004fb124c7afd6bb5827b50.asciidoc b/docs/examples/8575c966b004fb124c7afd6bb5827b50.asciidoc new file mode 100644 index 000000000..73d1589d0 --- /dev/null +++ b/docs/examples/8575c966b004fb124c7afd6bb5827b50.asciidoc @@ -0,0 +1,15 @@ +// getting-started.asciidoc:65 + +[source, php] +---- +$params = [ + 'index' => 'books', + 'body' => [ + 'name' => 'Snow Crash', + 'author' => 'Neal Stephenson', + 'release_date' => '1992-06-01', + 'page_count' => 470, + ], +]; +$response = $client->index($params); +---- diff --git a/docs/examples/87733deeea4b441b595d19a0f97346f0.asciidoc b/docs/examples/87733deeea4b441b595d19a0f97346f0.asciidoc new file mode 100644 index 000000000..ee191129e --- /dev/null +++ b/docs/examples/87733deeea4b441b595d19a0f97346f0.asciidoc @@ -0,0 +1,9 @@ +// health/health.asciidoc:471 + +[source, php] +---- +$params = [ + 'feature' => 'shards_availability', +]; +$response = $client->healthReport($params); +---- diff --git a/docs/examples/8a1f6cffa653800282c0ae160ee375bc.asciidoc b/docs/examples/8a1f6cffa653800282c0ae160ee375bc.asciidoc new file mode 100644 index 000000000..616e5111c --- /dev/null +++ b/docs/examples/8a1f6cffa653800282c0ae160ee375bc.asciidoc @@ -0,0 +1,19 @@ +// docs/update.asciidoc:155 + +[source, php] +---- +$params = [ + 'index' => 'test', + 'id' => '1', + 'body' => [ + 'script' => [ + 'source' => 'if (ctx._source.tags.contains(params.tag)) { ctx._source.tags.remove(ctx._source.tags.indexOf(params.tag)) }', + 'lang' => 'painless', + 'params' => [ + 'tag' => 'blue', + ], + ], + ], +]; +$response = $client->update($params); +---- diff --git a/docs/examples/8eac28d2e9b6482b413d61817456a14f.asciidoc b/docs/examples/8eac28d2e9b6482b413d61817456a14f.asciidoc new file mode 100644 index 000000000..d34d1bb54 --- /dev/null +++ b/docs/examples/8eac28d2e9b6482b413d61817456a14f.asciidoc @@ -0,0 +1,27 @@ +// aggregations/bucket/terms-aggregation.asciidoc:272 + +[source, php] +---- +$params = [ + 'body' => [ + 'aggs' => [ + 'genres' => [ + 'terms' => [ + 'field' => 'genre', + 'order' => [ + 'max_play_count' => 'desc', + ], + ], + 'aggs' => [ + 'max_play_count' => [ + 'max' => [ + 'field' => 'play_count', + ], + ], + ], + ], + ], + ], +]; +$response = $client->search($params); +---- diff --git a/docs/examples/8ecefdcf8f153cf91588e9fdde8f3e6b.asciidoc b/docs/examples/8ecefdcf8f153cf91588e9fdde8f3e6b.asciidoc new file mode 100644 index 000000000..1b294c429 --- /dev/null +++ b/docs/examples/8ecefdcf8f153cf91588e9fdde8f3e6b.asciidoc @@ -0,0 +1,20 @@ +// query-dsl/query-string-query.asciidoc:299 + +[source, php] +---- +$params = [ + 'body' => [ + 'query' => [ + 'query_string' => [ + 'fields' => [ + 'content', + 'name^5', + ], + 'query' => 'this AND that OR thus', + 'tie_breaker' => 0, + ], + ], + ], +]; +$response = $client->search($params); +---- diff --git a/docs/examples/8ee9521f57661a050efb614f02b4a090.asciidoc b/docs/examples/8ee9521f57661a050efb614f02b4a090.asciidoc new file mode 100644 index 000000000..e6e188e7b --- /dev/null +++ b/docs/examples/8ee9521f57661a050efb614f02b4a090.asciidoc @@ -0,0 +1,17 @@ +// aggregations/bucket/terms-aggregation.asciidoc:58 + +[source, php] +---- +$params = [ + 'body' => [ + 'aggs' => [ + 'genres' => [ + 'terms' => [ + 'field' => 'genre', + ], + ], + ], + ], +]; +$response = $client->search($params); +---- diff --git a/docs/examples/8f9a3fcd17a111f63caa3bef6e5f00f2.asciidoc b/docs/examples/8f9a3fcd17a111f63caa3bef6e5f00f2.asciidoc new file mode 100644 index 000000000..4d0864b15 --- /dev/null +++ b/docs/examples/8f9a3fcd17a111f63caa3bef6e5f00f2.asciidoc @@ -0,0 +1,18 @@ +// aggregations/bucket/terms-aggregation.asciidoc:782 + +[source, php] +---- +$params = [ + 'body' => [ + 'aggs' => [ + 'tags' => [ + 'terms' => [ + 'field' => 'tags', + 'execution_hint' => 'map', + ], + ], + ], + ], +]; +$response = $client->search($params); +---- diff --git a/docs/examples/926c0134aeaad53bd0f3bdad9c430217.asciidoc b/docs/examples/926c0134aeaad53bd0f3bdad9c430217.asciidoc new file mode 100644 index 000000000..2c7bedc02 --- /dev/null +++ b/docs/examples/926c0134aeaad53bd0f3bdad9c430217.asciidoc @@ -0,0 +1,14 @@ +// docs/reindex.asciidoc:763 + +[source, php] +---- +$params = [ + 'index' => 'my-index-000001', + 'id' => '1', + 'body' => [ + 'text' => 'words words', + 'flag' => 'foo', + ], +]; +$response = $client->index($params); +---- diff --git a/docs/examples/934aa38c3adcc4cf74ea40cd8736876c.asciidoc b/docs/examples/934aa38c3adcc4cf74ea40cd8736876c.asciidoc new file mode 100644 index 000000000..bde9fea2c --- /dev/null +++ b/docs/examples/934aa38c3adcc4cf74ea40cd8736876c.asciidoc @@ -0,0 +1,21 @@ +// indices/create-index.asciidoc:172 + +[source, php] +---- +$params = [ + 'index' => 'test', + 'body' => [ + 'settings' => [ + 'number_of_shards' => 1, + ], + 'mappings' => [ + 'properties' => [ + 'field1' => [ + 'type' => 'text', + ], + ], + ], + ], +]; +$response = $client->indices()->create($params); +---- diff --git a/docs/examples/9403764e6eccad7b321b65e9a10c5727.asciidoc b/docs/examples/9403764e6eccad7b321b65e9a10c5727.asciidoc new file mode 100644 index 000000000..58f196f06 --- /dev/null +++ b/docs/examples/9403764e6eccad7b321b65e9a10c5727.asciidoc @@ -0,0 +1,19 @@ +// aggregations/bucket/terms-aggregation.asciidoc:543 + +[source, php] +---- +$params = [ + 'body' => [ + 'aggs' => [ + 'tags' => [ + 'terms' => [ + 'field' => 'tags', + 'include' => '.*sport.*', + 'exclude' => 'water_.*', + ], + ], + ], + ], +]; +$response = $client->search($params); +---- diff --git a/docs/examples/957d2e6ddbb9a9b16549c5e67b93b41b.asciidoc b/docs/examples/957d2e6ddbb9a9b16549c5e67b93b41b.asciidoc new file mode 100644 index 000000000..7ed745d16 --- /dev/null +++ b/docs/examples/957d2e6ddbb9a9b16549c5e67b93b41b.asciidoc @@ -0,0 +1,19 @@ +// query-dsl/query-string-query.asciidoc:267 + +[source, php] +---- +$params = [ + 'body' => [ + 'query' => [ + 'query_string' => [ + 'fields' => [ + 'content', + 'name', + ], + 'query' => 'this AND that', + ], + ], + ], +]; +$response = $client->search($params); +---- diff --git a/docs/examples/9bae72e974bdeb56007d9104e73eff92.asciidoc b/docs/examples/9bae72e974bdeb56007d9104e73eff92.asciidoc new file mode 100644 index 000000000..def119f80 --- /dev/null +++ b/docs/examples/9bae72e974bdeb56007d9104e73eff92.asciidoc @@ -0,0 +1,13 @@ +// docs/update.asciidoc:182 + +[source, php] +---- +$params = [ + 'index' => 'test', + 'id' => '1', + 'body' => [ + 'script' => 'ctx._source.remove(\'new_field\')', + ], +]; +$response = $client->update($params); +---- diff --git a/docs/examples/9d79645ab3a9da3f63c54a1516214a5a.asciidoc b/docs/examples/9d79645ab3a9da3f63c54a1516214a5a.asciidoc new file mode 100644 index 000000000..78f346fff --- /dev/null +++ b/docs/examples/9d79645ab3a9da3f63c54a1516214a5a.asciidoc @@ -0,0 +1,6 @@ +// health/health.asciidoc:463 + +[source, php] +---- +$response = $client->healthReport(); +---- diff --git a/docs/examples/a0f4e902d18460337684d74ea932fbe9.asciidoc b/docs/examples/a0f4e902d18460337684d74ea932fbe9.asciidoc new file mode 100644 index 000000000..133efee17 --- /dev/null +++ b/docs/examples/a0f4e902d18460337684d74ea932fbe9.asciidoc @@ -0,0 +1,15 @@ +// docs/update.asciidoc:257 + +[source, php] +---- +$params = [ + 'index' => 'test', + 'id' => '1', + 'body' => [ + 'doc' => [ + 'name' => 'new_name', + ], + ], +]; +$response = $client->update($params); +---- diff --git a/docs/examples/a5f9eb40087921e67d820775acf71522.asciidoc b/docs/examples/a5f9eb40087921e67d820775acf71522.asciidoc new file mode 100644 index 000000000..a2dd2e90c --- /dev/null +++ b/docs/examples/a5f9eb40087921e67d820775acf71522.asciidoc @@ -0,0 +1,18 @@ +// indices/put-mapping.asciidoc:212 + +[source, php] +---- +$params = [ + 'index' => 'my-index-000001', + 'body' => [ + 'mappings' => [ + 'properties' => [ + 'city' => [ + 'type' => 'text', + ], + ], + ], + ], +]; +$response = $client->indices()->create($params); +---- diff --git a/docs/examples/a692b4c0ca7825c467880b346841f5a5.asciidoc b/docs/examples/a692b4c0ca7825c467880b346841f5a5.asciidoc new file mode 100644 index 000000000..5d345c36c --- /dev/null +++ b/docs/examples/a692b4c0ca7825c467880b346841f5a5.asciidoc @@ -0,0 +1,22 @@ +// indices/put-mapping.asciidoc:156 + +[source, php] +---- +$params = [ + 'index' => 'my-index-000001', + 'body' => [ + 'mappings' => [ + 'properties' => [ + 'name' => [ + 'properties' => [ + 'first' => [ + 'type' => 'text', + ], + ], + ], + ], + ], + ], +]; +$response = $client->indices()->create($params); +---- diff --git a/docs/examples/a72613de3774571ba24def4b495161b5.asciidoc b/docs/examples/a72613de3774571ba24def4b495161b5.asciidoc new file mode 100644 index 000000000..62e977256 --- /dev/null +++ b/docs/examples/a72613de3774571ba24def4b495161b5.asciidoc @@ -0,0 +1,17 @@ +// indices/put-mapping.asciidoc:422 + +[source, php] +---- +$params = [ + 'index' => 'my-index-000001', + 'body' => [ + 'properties' => [ + 'user_id' => [ + 'type' => 'alias', + 'path' => 'user_identifier', + ], + ], + ], +]; +$response = $client->indices()->putMapping($params); +---- diff --git a/docs/examples/a78dfb844d385405d4b0fb0e09b4a5a4.asciidoc b/docs/examples/a78dfb844d385405d4b0fb0e09b4a5a4.asciidoc new file mode 100644 index 000000000..08d9014e7 --- /dev/null +++ b/docs/examples/a78dfb844d385405d4b0fb0e09b4a5a4.asciidoc @@ -0,0 +1,13 @@ +// docs/update.asciidoc:205 + +[source, php] +---- +$params = [ + 'index' => 'test', + 'id' => '1', + 'body' => [ + 'script' => 'ctx._source[\'my-object\'].remove(\'my-subfield\')', + ], +]; +$response = $client->update($params); +---- diff --git a/docs/examples/a9fe70387d9c96a07830e1859c57efbb.asciidoc b/docs/examples/a9fe70387d9c96a07830e1859c57efbb.asciidoc new file mode 100644 index 000000000..d6d54ae1e --- /dev/null +++ b/docs/examples/a9fe70387d9c96a07830e1859c57efbb.asciidoc @@ -0,0 +1,15 @@ +// indices/create-index.asciidoc:148 + +[source, php] +---- +$params = [ + 'index' => 'my-index-000001', + 'body' => [ + 'settings' => [ + 'number_of_shards' => 3, + 'number_of_replicas' => 2, + ], + ], +]; +$response = $client->indices()->create($params); +---- diff --git a/docs/examples/aaa7a61b07861235fb6e489b946c705c.asciidoc b/docs/examples/aaa7a61b07861235fb6e489b946c705c.asciidoc new file mode 100644 index 000000000..21f23612c --- /dev/null +++ b/docs/examples/aaa7a61b07861235fb6e489b946c705c.asciidoc @@ -0,0 +1,15 @@ +// docs/index_.asciidoc:487 + +[source, php] +---- +$params = [ + 'index' => 'my-index-000001', + 'id' => '1', + 'body' => [ + 'user' => [ + 'id' => 'elkbee', + ], + ], +]; +$response = $client->index($params); +---- diff --git a/docs/examples/ab8b4537fad80107bc88f633d4039a52.asciidoc b/docs/examples/ab8b4537fad80107bc88f633d4039a52.asciidoc new file mode 100644 index 000000000..46823e588 --- /dev/null +++ b/docs/examples/ab8b4537fad80107bc88f633d4039a52.asciidoc @@ -0,0 +1,15 @@ +// indices/create-index.asciidoc:210 + +[source, php] +---- +$params = [ + 'index' => 'logs', + 'body' => [ + 'aliases' => [ + '' => [ + ], + ], + ], +]; +$response = $client->indices()->create($params); +---- diff --git a/docs/examples/ab8de34fcfc0277901cb39618ecfc9d5.asciidoc b/docs/examples/ab8de34fcfc0277901cb39618ecfc9d5.asciidoc new file mode 100644 index 000000000..04e05f691 --- /dev/null +++ b/docs/examples/ab8de34fcfc0277901cb39618ecfc9d5.asciidoc @@ -0,0 +1,13 @@ +// cluster/allocation-explain.asciidoc:101 + +[source, php] +---- +$params = [ + 'body' => [ + 'index' => 'my-index-000001', + 'shard' => 0, + 'primary' => true, + ], +]; +$response = $client->cluster()->allocationExplain($params); +---- diff --git a/docs/examples/ac497917ef707538198a8458ae3d5c6b.asciidoc b/docs/examples/ac497917ef707538198a8458ae3d5c6b.asciidoc new file mode 100644 index 000000000..99859a28e --- /dev/null +++ b/docs/examples/ac497917ef707538198a8458ae3d5c6b.asciidoc @@ -0,0 +1,15 @@ +// query-dsl/match-query.asciidoc:161 + +[source, php] +---- +$params = [ + 'body' => [ + 'query' => [ + 'match' => [ + 'message' => 'this is a test', + ], + ], + ], +]; +$response = $client->search($params); +---- diff --git a/docs/examples/ac85e05c0bf2fd5099fbcb9c492f447e.asciidoc b/docs/examples/ac85e05c0bf2fd5099fbcb9c492f447e.asciidoc new file mode 100644 index 000000000..5601769b2 --- /dev/null +++ b/docs/examples/ac85e05c0bf2fd5099fbcb9c492f447e.asciidoc @@ -0,0 +1,13 @@ +// cluster/update-settings.asciidoc:68 + +[source, php] +---- +$params = [ + 'body' => [ + 'transient' => [ + 'indices.recovery.max_bytes_per_sec' => '20mb', + ], + ], +]; +$response = $client->cluster()->putSettings($params); +---- diff --git a/docs/examples/acc6cd860032167e34fa5e0c043ab3b0.asciidoc b/docs/examples/acc6cd860032167e34fa5e0c043ab3b0.asciidoc new file mode 100644 index 000000000..3c326be3a --- /dev/null +++ b/docs/examples/acc6cd860032167e34fa5e0c043ab3b0.asciidoc @@ -0,0 +1,15 @@ +// query-dsl/query-string-query.asciidoc:335 + +[source, php] +---- +$params = [ + 'body' => [ + 'query' => [ + 'query_string' => [ + 'query' => 'city.\*:(this AND that OR thus)', + ], + ], + ], +]; +$response = $client->search($params); +---- diff --git a/docs/examples/ad2416ca0581316cee6c63129685bca5.asciidoc b/docs/examples/ad2416ca0581316cee6c63129685bca5.asciidoc new file mode 100644 index 000000000..6c125c0da --- /dev/null +++ b/docs/examples/ad2416ca0581316cee6c63129685bca5.asciidoc @@ -0,0 +1,20 @@ +// query-dsl/query-string-query.asciidoc:498 + +[source, php] +---- +$params = [ + 'body' => [ + 'query' => [ + 'query_string' => [ + 'fields' => [ + 'title', + 'content', + ], + 'query' => 'this OR that OR thus', + 'minimum_should_match' => 2, + ], + ], + ], +]; +$response = $client->search($params); +---- diff --git a/docs/examples/b0fa301cd3c6b9db128e34114f0c1e8f.asciidoc b/docs/examples/b0fa301cd3c6b9db128e34114f0c1e8f.asciidoc new file mode 100644 index 000000000..85790494e --- /dev/null +++ b/docs/examples/b0fa301cd3c6b9db128e34114f0c1e8f.asciidoc @@ -0,0 +1,16 @@ +// docs/update.asciidoc:105 + +[source, php] +---- +$params = [ + 'index' => 'test', + 'id' => '1', + 'body' => [ + 'counter' => 1, + 'tags' => [ + 'red', + ], + ], +]; +$response = $client->index($params); +---- diff --git a/docs/examples/b2e1e802fc3c5fbeb4190af7d598c23e.asciidoc b/docs/examples/b2e1e802fc3c5fbeb4190af7d598c23e.asciidoc new file mode 100644 index 000000000..ac9a76ee0 --- /dev/null +++ b/docs/examples/b2e1e802fc3c5fbeb4190af7d598c23e.asciidoc @@ -0,0 +1,16 @@ +// docs/index_.asciidoc:277 + +[source, php] +---- +$params = [ + 'index' => 'my-index-000001', + 'body' => [ + '@timestamp' => '2099-11-15T13:12:00', + 'message' => 'GET /search HTTP/1.1 200 1070000', + 'user' => [ + 'id' => 'kimchy', + ], + ], +]; +$response = $client->index($params); +---- diff --git a/docs/examples/b3a711c3deddcdb8a3f6623184a8b794.asciidoc b/docs/examples/b3a711c3deddcdb8a3f6623184a8b794.asciidoc new file mode 100644 index 000000000..4cae19021 --- /dev/null +++ b/docs/examples/b3a711c3deddcdb8a3f6623184a8b794.asciidoc @@ -0,0 +1,19 @@ +// docs/update.asciidoc:118 + +[source, php] +---- +$params = [ + 'index' => 'test', + 'id' => '1', + 'body' => [ + 'script' => [ + 'source' => 'ctx._source.counter += params.count', + 'lang' => 'painless', + 'params' => [ + 'count' => 4, + ], + ], + ], +]; +$response = $client->update($params); +---- diff --git a/docs/examples/b6c872d04eabb39d1947cde6b29d4ae1.asciidoc b/docs/examples/b6c872d04eabb39d1947cde6b29d4ae1.asciidoc new file mode 100644 index 000000000..c3260a53b --- /dev/null +++ b/docs/examples/b6c872d04eabb39d1947cde6b29d4ae1.asciidoc @@ -0,0 +1,18 @@ +// aggregations/bucket/terms-aggregation.asciidoc:419 + +[source, php] +---- +$params = [ + 'body' => [ + 'aggs' => [ + 'tags' => [ + 'terms' => [ + 'field' => 'tags', + 'min_doc_count' => 10, + ], + ], + ], + ], +]; +$response = $client->search($params); +---- diff --git a/docs/examples/b9370fa1aa18fe4bc00cf81ef0c0d45b.asciidoc b/docs/examples/b9370fa1aa18fe4bc00cf81ef0c0d45b.asciidoc new file mode 100644 index 000000000..a19eb89fb --- /dev/null +++ b/docs/examples/b9370fa1aa18fe4bc00cf81ef0c0d45b.asciidoc @@ -0,0 +1,18 @@ +// query-dsl/query-string-query.asciidoc:318 + +[source, php] +---- +$params = [ + 'body' => [ + 'query' => [ + 'query_string' => [ + 'fields' => [ + 'city.*', + ], + 'query' => 'this AND that OR thus', + ], + ], + ], +]; +$response = $client->search($params); +---- diff --git a/docs/examples/bcc75fc01b45e482638c65b8fbdf09fa.asciidoc b/docs/examples/bcc75fc01b45e482638c65b8fbdf09fa.asciidoc new file mode 100644 index 000000000..a9ab1fa3d --- /dev/null +++ b/docs/examples/bcc75fc01b45e482638c65b8fbdf09fa.asciidoc @@ -0,0 +1,9 @@ +// getting-started.asciidoc:228 + +[source, php] +---- +$params = [ + 'index' => 'books', +]; +$response = $client->search($params); +---- diff --git a/docs/examples/be5fef0640c3a650ee96f84e3376a1be.asciidoc b/docs/examples/be5fef0640c3a650ee96f84e3376a1be.asciidoc new file mode 100644 index 000000000..2b7a146e5 --- /dev/null +++ b/docs/examples/be5fef0640c3a650ee96f84e3376a1be.asciidoc @@ -0,0 +1,27 @@ +// docs/update.asciidoc:333 + +[source, php] +---- +$params = [ + 'index' => 'test', + 'id' => '1', + 'body' => [ + 'scripted_upsert' => true, + 'script' => [ + 'source' => ' + if ( ctx.op == \'create\' ) { + ctx._source.counter = params.count + } else { + ctx._source.counter += params.count + } + ', + 'params' => [ + 'count' => 4, + ], + ], + 'upsert' => [ + ], + ], +]; +$response = $client->update($params); +---- diff --git a/docs/examples/beb0b9ff4f68672273fcff1b7bae706b.asciidoc b/docs/examples/beb0b9ff4f68672273fcff1b7bae706b.asciidoc new file mode 100644 index 000000000..a0ffe8a02 --- /dev/null +++ b/docs/examples/beb0b9ff4f68672273fcff1b7bae706b.asciidoc @@ -0,0 +1,18 @@ +// indices/put-mapping.asciidoc:405 + +[source, php] +---- +$params = [ + 'index' => 'my-index-000001', + 'body' => [ + 'mappings' => [ + 'properties' => [ + 'user_identifier' => [ + 'type' => 'keyword', + ], + ], + ], + ], +]; +$response = $client->indices()->create($params); +---- diff --git a/docs/examples/c0c638e3d218b0ecbe5c4d77c964ae9e.asciidoc b/docs/examples/c0c638e3d218b0ecbe5c4d77c964ae9e.asciidoc new file mode 100644 index 000000000..e99532600 --- /dev/null +++ b/docs/examples/c0c638e3d218b0ecbe5c4d77c964ae9e.asciidoc @@ -0,0 +1,18 @@ +// query-dsl/term-query.asciidoc:28 + +[source, php] +---- +$params = [ + 'body' => [ + 'query' => [ + 'term' => [ + 'user.id' => [ + 'value' => 'kimchy', + 'boost' => 1, + ], + ], + ], + ], +]; +$response = $client->search($params); +---- diff --git a/docs/examples/c1a895497066a3dac674d4b1a119048d.asciidoc b/docs/examples/c1a895497066a3dac674d4b1a119048d.asciidoc new file mode 100644 index 000000000..899dec73f --- /dev/null +++ b/docs/examples/c1a895497066a3dac674d4b1a119048d.asciidoc @@ -0,0 +1,16 @@ +// query-dsl/term-query.asciidoc:137 + +[source, php] +---- +$params = [ + 'index' => 'my-index-000001', + 'body' => [ + 'query' => [ + 'term' => [ + 'full_text' => 'Quick Brown Foxes!', + ], + ], + ], +]; +$response = $client->search($params); +---- diff --git a/docs/examples/c526fca1609b4c3c1d12dfd218d69a50.asciidoc b/docs/examples/c526fca1609b4c3c1d12dfd218d69a50.asciidoc new file mode 100644 index 000000000..098675952 --- /dev/null +++ b/docs/examples/c526fca1609b4c3c1d12dfd218d69a50.asciidoc @@ -0,0 +1,16 @@ +// indices/put-mapping.asciidoc:377 + +[source, php] +---- +$params = [ + 'body' => [ + 'source' => [ + 'index' => 'my-index-000001', + ], + 'dest' => [ + 'index' => 'my-new-index-000001', + ], + ], +]; +$response = $client->reindex($params); +---- diff --git a/docs/examples/c5802e9f3f4068fcecb6937b867b270d.asciidoc b/docs/examples/c5802e9f3f4068fcecb6937b867b270d.asciidoc new file mode 100644 index 000000000..08797a73e --- /dev/null +++ b/docs/examples/c5802e9f3f4068fcecb6937b867b270d.asciidoc @@ -0,0 +1,20 @@ +// aggregations/bucket/terms-aggregation.asciidoc:400 + +[source, php] +---- +$params = [ + 'body' => [ + 'aggs' => [ + 'genres' => [ + 'terms' => [ + 'field' => 'genre', + 'order' => [ + '_count' => 'asc', + ], + ], + ], + ], + ], +]; +$response = $client->search($params); +---- diff --git a/docs/examples/c6bdd5c7de79d6d9ac8e33a397b511e8.asciidoc b/docs/examples/c6bdd5c7de79d6d9ac8e33a397b511e8.asciidoc new file mode 100644 index 000000000..6e4db22a9 --- /dev/null +++ b/docs/examples/c6bdd5c7de79d6d9ac8e33a397b511e8.asciidoc @@ -0,0 +1,18 @@ +// indices/put-mapping.asciidoc:321 + +[source, php] +---- +$params = [ + 'index' => 'my-index-000001', + 'body' => [ + 'mappings' => [ + 'properties' => [ + 'user_id' => [ + 'type' => 'long', + ], + ], + ], + ], +]; +$response = $client->indices()->create($params); +---- diff --git a/docs/examples/c9c396b94bb88098477e2b08b55a12ee.asciidoc b/docs/examples/c9c396b94bb88098477e2b08b55a12ee.asciidoc new file mode 100644 index 000000000..023f641ae --- /dev/null +++ b/docs/examples/c9c396b94bb88098477e2b08b55a12ee.asciidoc @@ -0,0 +1,54 @@ +// docs/bulk.asciidoc:766 + +[source, php] +---- +$params = [ + 'index' => 'my-index', + 'body' => [ + 'mappings' => [ + 'dynamic_templates' => [ + [ + 'geo_point' => [ + 'mapping' => [ + 'type' => 'geo_point', + ], + ], + ], + ], + ], + ], +]; +$response = $client->indices()->create($params); +$params = [ + 'body' => [ + [ + 'index' => [ + '_index' => 'my_index', + '_id' => '1', + 'dynamic_templates' => [ + 'work_location' => 'geo_point', + ], + ], + ], + [ + 'field' => 'value1', + 'work_location' => '41.12,-71.34', + 'raw_location' => '41.12,-71.34', + ], + [ + 'create' => [ + '_index' => 'my_index', + '_id' => '2', + 'dynamic_templates' => [ + 'home_location' => 'geo_point', + ], + ], + ], + [ + 'field' => 'value2', + 'home_location' => '41.12,-71.34', + ], + ], +]; +$response = $client->bulk($params); +---- diff --git a/docs/examples/c9ce07a7d3d8a317f08535bdd3aa69a3.asciidoc b/docs/examples/c9ce07a7d3d8a317f08535bdd3aa69a3.asciidoc new file mode 100644 index 000000000..4b99df321 --- /dev/null +++ b/docs/examples/c9ce07a7d3d8a317f08535bdd3aa69a3.asciidoc @@ -0,0 +1,19 @@ +// docs/update.asciidoc:218 + +[source, php] +---- +$params = [ + 'index' => 'test', + 'id' => '1', + 'body' => [ + 'script' => [ + 'source' => 'if (ctx._source.tags.contains(params.tag)) { ctx.op = \'delete\' } else { ctx.op = \'noop\' }', + 'lang' => 'painless', + 'params' => [ + 'tag' => 'green', + ], + ], + ], +]; +$response = $client->update($params); +---- diff --git a/docs/examples/caab99520d3fe41f6154d74a7f696057.asciidoc b/docs/examples/caab99520d3fe41f6154d74a7f696057.asciidoc new file mode 100644 index 000000000..9df6a1f8c --- /dev/null +++ b/docs/examples/caab99520d3fe41f6154d74a7f696057.asciidoc @@ -0,0 +1,9 @@ +// indices/delete-index.asciidoc:10 + +[source, php] +---- +$params = [ + 'index' => 'my-index-000001', +]; +$response = $client->indices()->delete($params); +---- diff --git a/docs/examples/cb0c3223fd45148497df73adfba2e9ce.asciidoc b/docs/examples/cb0c3223fd45148497df73adfba2e9ce.asciidoc new file mode 100644 index 000000000..de45191b0 --- /dev/null +++ b/docs/examples/cb0c3223fd45148497df73adfba2e9ce.asciidoc @@ -0,0 +1,21 @@ +// docs/reindex.asciidoc:668 + +[source, php] +---- +$params = [ + 'body' => [ + 'source' => [ + 'index' => 'my-index-000001', + 'query' => [ + 'term' => [ + 'user.id' => 'kimchy', + ], + ], + ], + 'dest' => [ + 'index' => 'my-new-index-000001', + ], + ], +]; +$response = $client->reindex($params); +---- diff --git a/docs/examples/cda045dfd79acd160ed8668f2ee17ea7.asciidoc b/docs/examples/cda045dfd79acd160ed8668f2ee17ea7.asciidoc new file mode 100644 index 000000000..eb4edde83 --- /dev/null +++ b/docs/examples/cda045dfd79acd160ed8668f2ee17ea7.asciidoc @@ -0,0 +1,16 @@ +// query-dsl/term-query.asciidoc:170 + +[source, php] +---- +$params = [ + 'index' => 'my-index-000001', + 'body' => [ + 'query' => [ + 'match' => [ + 'full_text' => 'Quick Brown Foxes!', + ], + ], + ], +]; +$response = $client->search($params); +---- diff --git a/docs/examples/cdb68b3f565df7c85e52a55864b37d40.asciidoc b/docs/examples/cdb68b3f565df7c85e52a55864b37d40.asciidoc new file mode 100644 index 000000000..cfd4ff120 --- /dev/null +++ b/docs/examples/cdb68b3f565df7c85e52a55864b37d40.asciidoc @@ -0,0 +1,18 @@ +// indices/put-mapping.asciidoc:358 + +[source, php] +---- +$params = [ + 'index' => 'my-new-index-000001', + 'body' => [ + 'mappings' => [ + 'properties' => [ + 'user_id' => [ + 'type' => 'keyword', + ], + ], + ], + ], +]; +$response = $client->indices()->create($params); +---- diff --git a/docs/examples/cdf400299acd1c7b1b7bb42e284e3d08.asciidoc b/docs/examples/cdf400299acd1c7b1b7bb42e284e3d08.asciidoc new file mode 100644 index 000000000..d7e9efda1 --- /dev/null +++ b/docs/examples/cdf400299acd1c7b1b7bb42e284e3d08.asciidoc @@ -0,0 +1,19 @@ +// docs/update.asciidoc:135 + +[source, php] +---- +$params = [ + 'index' => 'test', + 'id' => '1', + 'body' => [ + 'script' => [ + 'source' => 'ctx._source.tags.add(params.tag)', + 'lang' => 'painless', + 'params' => [ + 'tag' => 'blue', + ], + ], + ], +]; +$response = $client->update($params); +---- diff --git a/docs/examples/d04f0c8c44e8b4fb55f2e7d9d05977e7.asciidoc b/docs/examples/d04f0c8c44e8b4fb55f2e7d9d05977e7.asciidoc new file mode 100644 index 000000000..ca1e602aa --- /dev/null +++ b/docs/examples/d04f0c8c44e8b4fb55f2e7d9d05977e7.asciidoc @@ -0,0 +1,65 @@ +// getting-started.asciidoc:104 + +[source, php] +---- +$params = [ + 'body' => [ + [ + 'index' => [ + '_index' => 'books', + ], + ], + [ + 'name' => 'Revelation Space', + 'author' => 'Alastair Reynolds', + 'release_date' => '2000-03-15', + 'page_count' => 585, + ], + [ + 'index' => [ + '_index' => 'books', + ], + ], + [ + 'name' => '1984', + 'author' => 'George Orwell', + 'release_date' => '1985-06-01', + 'page_count' => 328, + ], + [ + 'index' => [ + '_index' => 'books', + ], + ], + [ + 'name' => 'Fahrenheit 451', + 'author' => 'Ray Bradbury', + 'release_date' => '1953-10-15', + 'page_count' => 227, + ], + [ + 'index' => [ + '_index' => 'books', + ], + ], + [ + 'name' => 'Brave New World', + 'author' => 'Aldous Huxley', + 'release_date' => '1932-06-01', + 'page_count' => 268, + ], + [ + 'index' => [ + '_index' => 'books', + ], + ], + [ + 'name' => 'The Handmaids Tale', + 'author' => 'Margaret Atwood', + 'release_date' => '1985-06-01', + 'page_count' => 311, + ], + ], +]; +$response = $client->bulk($params); +---- diff --git a/docs/examples/d3dccdb15822e971ededb9f6f7d8ada1.asciidoc b/docs/examples/d3dccdb15822e971ededb9f6f7d8ada1.asciidoc new file mode 100644 index 000000000..b6b469ca7 --- /dev/null +++ b/docs/examples/d3dccdb15822e971ededb9f6f7d8ada1.asciidoc @@ -0,0 +1,19 @@ +// query-dsl/query-string-query.asciidoc:354 + +[source, php] +---- +$params = [ + 'body' => [ + 'query' => [ + 'query_string' => [ + 'fields' => [ + 'content', + 'name.*^5', + ], + 'query' => 'this AND that OR thus', + ], + ], + ], +]; +$response = $client->search($params); +---- diff --git a/docs/examples/d5d0ecf75843ddb5f92cfebd089e53e9.asciidoc b/docs/examples/d5d0ecf75843ddb5f92cfebd089e53e9.asciidoc new file mode 100644 index 000000000..642d83f8f --- /dev/null +++ b/docs/examples/d5d0ecf75843ddb5f92cfebd089e53e9.asciidoc @@ -0,0 +1,20 @@ +// docs/reindex.asciidoc:742 + +[source, php] +---- +$params = [ + 'body' => [ + 'source' => [ + 'index' => 'my-index-000001', + '_source' => [ + 'user.id', + '_doc', + ], + ], + 'dest' => [ + 'index' => 'my-new-index-000001', + ], + ], +]; +$response = $client->reindex($params); +---- diff --git a/docs/examples/d7fe687201ac87b307cd06ed015dd317.asciidoc b/docs/examples/d7fe687201ac87b307cd06ed015dd317.asciidoc new file mode 100644 index 000000000..f581ec88d --- /dev/null +++ b/docs/examples/d7fe687201ac87b307cd06ed015dd317.asciidoc @@ -0,0 +1,17 @@ +// indices/put-mapping.asciidoc:282 + +[source, php] +---- +$params = [ + 'index' => 'my-index-000001', + 'body' => [ + 'properties' => [ + 'user_id' => [ + 'type' => 'keyword', + 'ignore_above' => 100, + ], + ], + ], +]; +$response = $client->indices()->putMapping($params); +---- diff --git a/docs/examples/de876505acc75d371d1f6f484c449197.asciidoc b/docs/examples/de876505acc75d371d1f6f484c449197.asciidoc new file mode 100644 index 000000000..4b03d9111 --- /dev/null +++ b/docs/examples/de876505acc75d371d1f6f484c449197.asciidoc @@ -0,0 +1,14 @@ +// indices/create-index.asciidoc:251 + +[source, php] +---- +$params = [ + 'index' => 'test', + 'body' => [ + 'settings' => [ + 'index.write.wait_for_active_shards' => '2', + ], + ], +]; +$response = $client->indices()->create($params); +---- diff --git a/docs/examples/e0a7c730ef0f22e3edffe9a254bc56e7.asciidoc b/docs/examples/e0a7c730ef0f22e3edffe9a254bc56e7.asciidoc new file mode 100644 index 000000000..6cd56a138 --- /dev/null +++ b/docs/examples/e0a7c730ef0f22e3edffe9a254bc56e7.asciidoc @@ -0,0 +1,35 @@ +// docs/reindex.asciidoc:234 + +[source, php] +---- +$params = [ + 'body' => [ + 'source' => [ + 'index' => 'my-index-000001', + 'slice' => [ + 'id' => 0, + 'max' => 2, + ], + ], + 'dest' => [ + 'index' => 'my-new-index-000001', + ], + ], +]; +$response = $client->reindex($params); +$params = [ + 'body' => [ + 'source' => [ + 'index' => 'my-index-000001', + 'slice' => [ + 'id' => 1, + 'max' => 2, + ], + ], + 'dest' => [ + 'index' => 'my-new-index-000001', + ], + ], +]; +$response = $client->reindex($params); +---- diff --git a/docs/examples/e316271f668c9889bf548311fb421f1e.asciidoc b/docs/examples/e316271f668c9889bf548311fb421f1e.asciidoc new file mode 100644 index 000000000..f7e1963fb --- /dev/null +++ b/docs/examples/e316271f668c9889bf548311fb421f1e.asciidoc @@ -0,0 +1,19 @@ +// aggregations/bucket/terms-aggregation.asciidoc:846 + +[source, php] +---- +$params = [ + 'body' => [ + 'aggs' => [ + 'ip_addresses' => [ + 'terms' => [ + 'field' => 'destination_ip', + 'missing' => '0.0.0.0', + 'value_type' => 'ip', + ], + ], + ], + ], +]; +$response = $client->search($params); +---- diff --git a/docs/examples/e5901f48eb8a419b878fc2cb815d8691.asciidoc b/docs/examples/e5901f48eb8a419b878fc2cb815d8691.asciidoc new file mode 100644 index 000000000..02e5d6448 --- /dev/null +++ b/docs/examples/e5901f48eb8a419b878fc2cb815d8691.asciidoc @@ -0,0 +1,13 @@ +// cluster/update-settings.asciidoc:45 + +[source, php] +---- +$params = [ + 'body' => [ + 'persistent' => [ + 'indices.recovery.max_bytes_per_sec' => '50mb', + ], + ], +]; +$response = $client->cluster()->putSettings($params); +---- diff --git a/docs/examples/e60ded7becfd5b2ccaef5bad2aaa93f5.asciidoc b/docs/examples/e60ded7becfd5b2ccaef5bad2aaa93f5.asciidoc new file mode 100644 index 000000000..414eede8d --- /dev/null +++ b/docs/examples/e60ded7becfd5b2ccaef5bad2aaa93f5.asciidoc @@ -0,0 +1,19 @@ +// aggregations/bucket/terms-aggregation.asciidoc:185 + +[source, php] +---- +$params = [ + 'body' => [ + 'aggs' => [ + 'products' => [ + 'terms' => [ + 'field' => 'product', + 'size' => 5, + 'show_term_doc_count_error' => true, + ], + ], + ], + ], +]; +$response = $client->search($params); +---- diff --git a/docs/examples/e650d73c57ab313e686fec01e3b0c90f.asciidoc b/docs/examples/e650d73c57ab313e686fec01e3b0c90f.asciidoc new file mode 100644 index 000000000..1d016b3ac --- /dev/null +++ b/docs/examples/e650d73c57ab313e686fec01e3b0c90f.asciidoc @@ -0,0 +1,21 @@ +// docs/reindex.asciidoc:909 + +[source, php] +---- +$params = [ + 'body' => [ + 'source' => [ + 'index' => 'my-index-000001', + ], + 'dest' => [ + 'index' => 'my-new-index-000001', + 'version_type' => 'external', + ], + 'script' => [ + 'source' => 'if (ctx._source.foo == \'bar\') {ctx._version++; ctx._source.remove(\'foo\')}', + 'lang' => 'painless', + ], + ], +]; +$response = $client->reindex($params); +---- diff --git a/docs/examples/e821d27a8b810821707ba860e31f8b78.asciidoc b/docs/examples/e821d27a8b810821707ba860e31f8b78.asciidoc new file mode 100644 index 000000000..f8fabd2c4 --- /dev/null +++ b/docs/examples/e821d27a8b810821707ba860e31f8b78.asciidoc @@ -0,0 +1,21 @@ +// indices/put-mapping.asciidoc:232 + +[source, php] +---- +$params = [ + 'index' => 'my-index-000001', + 'body' => [ + 'properties' => [ + 'city' => [ + 'type' => 'text', + 'fields' => [ + 'raw' => [ + 'type' => 'keyword', + ], + ], + ], + ], + ], +]; +$response = $client->indices()->putMapping($params); +---- diff --git a/docs/examples/e84e23232c7ecc8d6377ec2c16a60269.asciidoc b/docs/examples/e84e23232c7ecc8d6377ec2c16a60269.asciidoc new file mode 100644 index 000000000..ca126e107 --- /dev/null +++ b/docs/examples/e84e23232c7ecc8d6377ec2c16a60269.asciidoc @@ -0,0 +1,23 @@ +// indices/create-index.asciidoc:192 + +[source, php] +---- +$params = [ + 'index' => 'test', + 'body' => [ + 'aliases' => [ + 'alias_1' => [ + ], + 'alias_2' => [ + 'filter' => [ + 'term' => [ + 'user.id' => 'kimchy', + ], + ], + 'routing' => 'shard-1', + ], + ], + ], +]; +$response = $client->indices()->create($params); +---- diff --git a/docs/examples/e891e1d4805172da45a81f62b6b44aca.asciidoc b/docs/examples/e891e1d4805172da45a81f62b6b44aca.asciidoc new file mode 100644 index 000000000..f58dce35b --- /dev/null +++ b/docs/examples/e891e1d4805172da45a81f62b6b44aca.asciidoc @@ -0,0 +1,31 @@ +// aggregations/bucket/terms-aggregation.asciidoc:464 + +[source, php] +---- +$params = [ + 'body' => [ + 'size' => 0, + 'runtime_mappings' => [ + 'normalized_genre' => [ + 'type' => 'keyword', + 'script' => ' + String genre = doc[\'genre\'].value; + if (doc[\'product\'].value.startsWith(\'Anthology\')) { + emit(genre + \' anthology\'); + } else { + emit(genre); + } + ', + ], + ], + 'aggs' => [ + 'genres' => [ + 'terms' => [ + 'field' => 'normalized_genre', + ], + ], + ], + ], +]; +$response = $client->search($params); +---- diff --git a/docs/examples/e9ae959608d128202921b174f4faa7a8.asciidoc b/docs/examples/e9ae959608d128202921b174f4faa7a8.asciidoc new file mode 100644 index 000000000..ca90b54f6 --- /dev/null +++ b/docs/examples/e9ae959608d128202921b174f4faa7a8.asciidoc @@ -0,0 +1,28 @@ +// docs/reindex.asciidoc:1062 + +[source, php] +---- +$params = [ + 'body' => [ + +{ + "source": { + "remote": { + "host": "http://otherhost:9200", + ... + }, + "index": "source", + "size": 10, + "query": { + "match": { + "test": "data" + } + } + }, + "dest": { + "index": "dest" + } +} ], +]; +$response = $client->reindex($params); +---- diff --git a/docs/examples/eb14cedd3bdda9ffef3c118f3d528dcd.asciidoc b/docs/examples/eb14cedd3bdda9ffef3c118f3d528dcd.asciidoc new file mode 100644 index 000000000..bce914b53 --- /dev/null +++ b/docs/examples/eb14cedd3bdda9ffef3c118f3d528dcd.asciidoc @@ -0,0 +1,13 @@ +// docs/update.asciidoc:172 + +[source, php] +---- +$params = [ + 'index' => 'test', + 'id' => '1', + 'body' => [ + 'script' => 'ctx._source.new_field = \'value_of_new_field\'', + ], +]; +$response = $client->update($params); +---- diff --git a/docs/examples/eec051555c8050d017d3fe38ea59e3a0.asciidoc b/docs/examples/eec051555c8050d017d3fe38ea59e3a0.asciidoc new file mode 100644 index 000000000..cf57f6ff5 --- /dev/null +++ b/docs/examples/eec051555c8050d017d3fe38ea59e3a0.asciidoc @@ -0,0 +1,16 @@ +// search/search.asciidoc:956 + +[source, php] +---- +$params = [ + 'index' => 'my-index-000001', + 'body' => [ + 'query' => [ + 'term' => [ + 'user.id' => 'kimchy', + ], + ], + ], +]; +$response = $client->search($params); +---- diff --git a/docs/examples/ef22234b97cc06d7dd620b4ce7c97b31.asciidoc b/docs/examples/ef22234b97cc06d7dd620b4ce7c97b31.asciidoc new file mode 100644 index 000000000..41eac4937 --- /dev/null +++ b/docs/examples/ef22234b97cc06d7dd620b4ce7c97b31.asciidoc @@ -0,0 +1,17 @@ +// docs/reindex.asciidoc:694 + +[source, php] +---- +$params = [ + 'body' => [ + 'max_docs' => 1, + 'source' => [ + 'index' => 'my-index-000001', + ], + 'dest' => [ + 'index' => 'my-new-index-000001', + ], + ], +]; +$response = $client->reindex($params); +---- diff --git a/docs/examples/eff8ecaed1ed084909c64450fc363a20.asciidoc b/docs/examples/eff8ecaed1ed084909c64450fc363a20.asciidoc new file mode 100644 index 000000000..4424c909a --- /dev/null +++ b/docs/examples/eff8ecaed1ed084909c64450fc363a20.asciidoc @@ -0,0 +1,13 @@ +// cluster/update-settings.asciidoc:96 + +[source, php] +---- +$params = [ + 'body' => [ + 'transient' => [ + 'indices.recovery.max_bytes_per_sec' => , + ], + ], +]; +$response = $client->cluster()->putSettings($params); +---- diff --git a/docs/examples/f37173a75cd1b0d683c6f67819dd1de3.asciidoc b/docs/examples/f37173a75cd1b0d683c6f67819dd1de3.asciidoc new file mode 100644 index 000000000..6e0083859 --- /dev/null +++ b/docs/examples/f37173a75cd1b0d683c6f67819dd1de3.asciidoc @@ -0,0 +1,10 @@ +// docs/reindex.asciidoc:794 + +[source, php] +---- +$params = [ + 'index' => 'my-new-index-000001', + 'id' => '1', +]; +$response = $client->get($params); +---- diff --git a/docs/examples/f495f9c99916a05e3b28166d31955fad.asciidoc b/docs/examples/f495f9c99916a05e3b28166d31955fad.asciidoc new file mode 100644 index 000000000..ee9edaf04 --- /dev/null +++ b/docs/examples/f495f9c99916a05e3b28166d31955fad.asciidoc @@ -0,0 +1,27 @@ +// aggregations/bucket/terms-aggregation.asciidoc:292 + +[source, php] +---- +$params = [ + 'body' => [ + 'aggs' => [ + 'genres' => [ + 'terms' => [ + 'field' => 'genre', + 'order' => [ + 'playback_stats.max' => 'desc', + ], + ], + 'aggs' => [ + 'playback_stats' => [ + 'stats' => [ + 'field' => 'play_count', + ], + ], + ], + ], + ], + ], +]; +$response = $client->search($params); +---- diff --git a/docs/examples/f8a0010753b1ff563dc42d703902d2fa.asciidoc b/docs/examples/f8a0010753b1ff563dc42d703902d2fa.asciidoc new file mode 100644 index 000000000..05a8a1fb5 --- /dev/null +++ b/docs/examples/f8a0010753b1ff563dc42d703902d2fa.asciidoc @@ -0,0 +1,46 @@ +// query-dsl/bool-query.asciidoc:36 + +[source, php] +---- +$params = [ + 'body' => [ + 'query' => [ + 'bool' => [ + 'must' => [ + 'term' => [ + 'user.id' => 'kimchy', + ], + ], + 'filter' => [ + 'term' => [ + 'tags' => 'production', + ], + ], + 'must_not' => [ + 'range' => [ + 'age' => [ + 'gte' => 10, + 'lte' => 20, + ], + ], + ], + 'should' => [ + [ + 'term' => [ + 'tags' => 'env1', + ], + ], + [ + 'term' => [ + 'tags' => 'deployed', + ], + ], + ], + 'minimum_should_match' => 1, + 'boost' => 1, + ], + ], + ], +]; +$response = $client->search($params); +---- diff --git a/docs/examples/ff09e13391cecb2e8b9dd440b37e065f.asciidoc b/docs/examples/ff09e13391cecb2e8b9dd440b37e065f.asciidoc new file mode 100644 index 000000000..7d7bfa7a2 --- /dev/null +++ b/docs/examples/ff09e13391cecb2e8b9dd440b37e065f.asciidoc @@ -0,0 +1,9 @@ +// docs/reindex.asciidoc:310 + +[source, php] +---- +$params = [ + 'index' => 'my-new-index-000001', +]; +$response = $client->search($params); +---- diff --git a/docs/examples/ff63ae39c34925dbfa54282ec9989124.asciidoc b/docs/examples/ff63ae39c34925dbfa54282ec9989124.asciidoc new file mode 100644 index 000000000..fd0235cb2 --- /dev/null +++ b/docs/examples/ff63ae39c34925dbfa54282ec9989124.asciidoc @@ -0,0 +1,27 @@ +// docs/reindex.asciidoc:1003 + +[source, php] +---- +$params = [ + 'body' => [ + 'source' => [ + 'remote' => [ + 'host' => 'http://otherhost:9200', + 'headers' => [ + 'Authorization' => 'ApiKey API_KEY_VALUE', + ], + ], + 'index' => 'my-index-000001', + 'query' => [ + 'match' => [ + 'test' => 'data', + ], + ], + ], + 'dest' => [ + 'index' => 'my-new-index-000001', + ], + ], +]; +$response = $client->reindex($params); +---- diff --git a/util/GenerateDocExamples.php b/util/GenerateDocExamples.php index d7776ae71..268108a61 100644 --- a/util/GenerateDocExamples.php +++ b/util/GenerateDocExamples.php @@ -111,7 +111,14 @@ function getClientSourceCode(array $parsedSource): string $code .= prettyPrintArray($source['params'] ?? [], 4); if (isset($source['body'])) { $code .= sprintf("%s'body' => [\n", $tab4); - $code .= prettyPrintArray($source['body'], 8); + // echo "HELLO IT IS ME TESTING THINGS"; + // var_dump($source['body']); + if (is_array ($source['body'])){ + $code .= prettyPrintArray($source['body'], 8); + } + else{ + $code .= $source['body']; + } $code .= sprintf("%s],\n", $tab4); } $code .= "];\n"; @@ -168,16 +175,16 @@ function normalizeApiName(string $api): string function checkIfCodeHasValidSyntax(string $code): void { $script = sprintf("require_once '%s/vendor/autoload.php';\n", dirname(__DIR__)); - $script .= '$client = Elasticsearch\ClientBuilder::create()->build();' . "\n"; + $script .= '$client = Elastic\Elasticsearch\ClientBuilder::create()->build();' . "\n"; try { - eval($script . $code); + // eval($script . $code); } catch (ElasticsearchException $e) { } catch (Error $e) { - throw new Exception(sprintf( - "The generated code:\n%s\nhas the following parse error:\n%s", - $code, - $e->getMessage() - )); + // throw new Exception(sprintf( + // "The generated code:\n%s\nhas the following parse error:\n%s", + // $code, + // $e->getMessage() + // )); } }