├── BREAKING_CHANGES.md
├── CHANGELOG.md
├── CONTRIBUTING.md
├── LICENSE
├── README.md
├── catalog-info.yaml
├── composer.json
├── docs
├── docset.yml
├── examples
│ ├── 014b788c879e4aaa1020672e45e25473.asciidoc
│ ├── 015294a400986295039e52ebc62033be.asciidoc
│ ├── 025b54db0edc50c24ea48a2bd94366ad.asciidoc
│ ├── 028f6d6ac2594e20b78b8a8f8cbad49d.asciidoc
│ ├── 033778305d52746f5ce0a2a922c8e521.asciidoc
│ ├── 047266b0d20fdb62ebc72d51952c8f6d.asciidoc
│ ├── 048d8abd42d094bbdcf4452a58ccb35b.asciidoc
│ ├── 04f5dd677c777bcb15d7d5fa63275fc8.asciidoc
│ ├── 04fe1e3a0047b0cdb10987b79fc3f3f3.asciidoc
│ ├── 06afce2955f9094d96d27067ebca32e8.asciidoc
│ ├── 073539a7e38be3cdf13008330b6a536a.asciidoc
│ ├── 0989cc65d8924f666ce3eb0820d2d244.asciidoc
│ ├── 09d617863a103c82fb4101e6165ea7fe.asciidoc
│ ├── 09dbd90c5e22ea4a17b4cf9aa72e08ae.asciidoc
│ ├── 09ecba5814d71e4c44468575eada9878.asciidoc
│ ├── 0a958e486ede3f519d48431ab689eded.asciidoc
│ ├── 0ac9916f47a2483b89c1416684af322a.asciidoc
│ ├── 0afaf1cad692e6201aa574c8feb6e622.asciidoc
│ ├── 0ba0b2db24852abccb7c0fc1098d566e.asciidoc
│ ├── 0bbd30b9be3e54ff3028b9f4459634d2.asciidoc
│ ├── 0bd3923424a20a4ba860b0774b9991b1.asciidoc
│ ├── 0be2c28ee65384774b1e479b47dc3d92.asciidoc
│ ├── 0c4ad860a485fe53d8140ad3ccd11dcf.asciidoc
│ ├── 0cc991e3f7f8511a34730e154b3c5edc.asciidoc
│ ├── 0ce3606f1dba490eef83c4317b315b62.asciidoc
│ ├── 0d664883151008b1051ef2c9ab2d0373.asciidoc
│ ├── 0e118857b815b62118a30c042f079db1.asciidoc
│ ├── 1027ab1ca767ac1428176ef4f84bfbcf.asciidoc
│ ├── 1216f8f7367df3aa823012cef310c08a.asciidoc
│ ├── 12433d2b637d002e8d5c9a1adce69d3b.asciidoc
│ ├── 1252fa45847edba5ec2b2f33da70ec5b.asciidoc
│ ├── 138ccd89f72aa7502dd9578403dcc589.asciidoc
│ ├── 14701dcc0cca9665fce2aace0cb62af7.asciidoc
│ ├── 1577e6e806b3283c9e99f1596d310754.asciidoc
│ ├── 15dad5338065baaaa7d475abe85f4c22.asciidoc
│ ├── 162b5b693b713f0bfab1209d59443c46.asciidoc
│ ├── 179f0a3e84ff4bbac18787a018eabf89.asciidoc
│ ├── 17de0020b228df961ad3c6b06233c948.asciidoc
│ ├── 189a921df2f5b1fe580937210ce9c1c2.asciidoc
│ ├── 18ddb7e7a4bcafd449df956e828ed7a8.asciidoc
│ ├── 1aa91d3d48140d6367b6cabca8737b8f.asciidoc
│ ├── 1b542e3ea87a742f95641d64dcfb1bdb.asciidoc
│ ├── 1b8655e6ba99fe39933c6eafe78728b7.asciidoc
│ ├── 1b8caf0a6741126c6d0ad83b56fce290.asciidoc
│ ├── 1bc731a4df952228af6dfa6b48627332.asciidoc
│ ├── 1c23507edd7a3c18538b68223378e4ab.asciidoc
│ ├── 1d65cb6d055c46a1bde809687d835b71.asciidoc
│ ├── 1da77e114459e0b77d78a3dcc8fae429.asciidoc
│ ├── 1dbb8cf17fbc45c87c7d2f75f15f9778.asciidoc
│ ├── 1e18a67caf8f06ff2710ec4a8b30f625.asciidoc
│ ├── 1e49eba5b9042c1900a608fe5105ba43.asciidoc
│ ├── 1e50d993bd6517e6c381e82d09f0389e.asciidoc
│ ├── 1f336ecc62480c1d56351cc2f82d0d08.asciidoc
│ ├── 1f6fe6833686e38c3711c6f2aa00a078.asciidoc
│ ├── 210cf5c76bff517f48e80fa1c2d63907.asciidoc
│ ├── 213ab768f1b6a895e09403a0880e259a.asciidoc
│ ├── 216848930c2d344fe0bed0daa70c35b9.asciidoc
│ ├── 22334f4b24bb8977d3e1bf2ffdc29d3f.asciidoc
│ ├── 231aa0bb39c35fe199d28fe0e4a62b2e.asciidoc
│ ├── 23ab0f1023b1b2cd5cdf2a8f9ccfd57b.asciidoc
│ ├── 2468ab381257d759d8a88af1141f6f9c.asciidoc
│ ├── 251ea12c1248385ab409906ac64d9ee9.asciidoc
│ ├── 2533e4b36ae837eaecda08407ecb6383.asciidoc
│ ├── 2891aa10ee9d474780adf94d5607f2db.asciidoc
│ ├── 28aad2c5942bfb221c2bf1bbdc01658e.asciidoc
│ ├── 2a1de18774f9c68cafa169847832b2bc.asciidoc
│ ├── 2bb2339ac055337abf753bddb7771659.asciidoc
│ ├── 2fd69fb0538e4f36ac69a8b8f8bf5ae8.asciidoc
│ ├── 2fe28d9a91b3081a9ec4601af8fb7b1c.asciidoc
│ ├── 311c4b632a29b9ead63b02d01f10096b.asciidoc
│ ├── 3342c69b2c2303247217532956fcce85.asciidoc
│ ├── 33f148e3d8676de6cc52f58749898a13.asciidoc
│ ├── 34efeade38445b2834749ced59782e25.asciidoc
│ ├── 35e8da9410b8432cf4095f2541ad7b1d.asciidoc
│ ├── 3653567181f43a5f64c74f934aa821c2.asciidoc
│ ├── 36818c6d9f434d387819c30bd9addb14.asciidoc
│ ├── 36b2778f23d0955255f52c075c4d213d.asciidoc
│ ├── 3722cb3705b6bc7f486969deace3dd83.asciidoc
│ ├── 381fced1882ca8337143e6bb180a5715.asciidoc
│ ├── 38c1d0f6668e9563c0827f839f9fa505.asciidoc
│ ├── 39a6a038c4b551022afe83de0523634e.asciidoc
│ ├── 3a700f836d8d5da1b656a876554028aa.asciidoc
│ ├── 3ae03ba3b56e5e287953094050766738.asciidoc
│ ├── 3b04cc894e6a47d57983484010feac0c.asciidoc
│ ├── 3cd50a789b8e1f0ebbbc53a8d7ecf656.asciidoc
│ ├── 3d1ff6097e2359f927c88c2ccdb36252.asciidoc
│ ├── 3e573bfabe00f8bfb8bb69aa5820768e.asciidoc
│ ├── 3f3b3e207f79303ce6f86e03e928e062.asciidoc
│ ├── 400e89eb46ead8e9c9e40f123fd5e590.asciidoc
│ ├── 42744a175125df5be0ef77413bf8f608.asciidoc
│ ├── 427f6b5c5376cbf0f71f242a60ca3d9e.asciidoc
│ ├── 43af86de5e49aa06070092fffc138208.asciidoc
│ ├── 4646764bf09911fee7d58630c72d3137.asciidoc
│ ├── 46658f00edc4865dfe472a392374cd0f.asciidoc
│ ├── 46c4b0dfb674825f9579203d41e7f404.asciidoc
│ ├── 47b5ff897f26e9c943cee5c06034181d.asciidoc
│ ├── 47bb632c6091ad0cd94bc660bdd309a5.asciidoc
│ ├── 4acf902c2598b2558f34f20c1744c433.asciidoc
│ ├── 4b90feb9d5d3dbfce424dac0341320b7.asciidoc
│ ├── 4cd246e5c4c035a2cd4081ae9a3d54e5.asciidoc
│ ├── 4d46dbb96125b27f46299547de9d8709.asciidoc
│ ├── 4d56b179242fed59e3d6476f817b6055.asciidoc
│ ├── 4d6997c70a1851f9151443c0d38b532e.asciidoc
│ ├── 5043b83a89091fa00edb341ddf7ba370.asciidoc
│ ├── 506844befdc5691d835771bcbb1c1a60.asciidoc
│ ├── 5271f4ff29bb48838396e5a674664ee0.asciidoc
│ ├── 527324766814561b75aaee853ede49a7.asciidoc
│ ├── 5275842787967b6db876025f4a1c6942.asciidoc
│ ├── 52a87b81e4e0b6b11e23e85db1602a63.asciidoc
│ ├── 52b2bfbdd78f8283b6f4891c48013237.asciidoc
│ ├── 52c7e4172a446c394210a07c464c57d2.asciidoc
│ ├── 53b908c3432118c5a6e460f74d32006b.asciidoc
│ ├── 53d938c754f36a912fcbe6473abb463f.asciidoc
│ ├── 54092c8c646133f5dbbc047990dd458d.asciidoc
│ ├── 54a770f053f3225ea0d1e34334232411.asciidoc
│ ├── 58b5003c0a53a39bf509aa3797aad471.asciidoc
│ ├── 58df61acbfb15b8ef0aaa18b81ae98a6.asciidoc
│ ├── 5925c23a173a63bdb30b458248d1df76.asciidoc
│ ├── 5b7d6f1db88ca6f42c48fa3dbb4341e8.asciidoc
│ ├── 5be23858b35043fcb7b50fe36b873e6e.asciidoc
│ ├── 5c2f486c27bd5346e512265f93375d16.asciidoc
│ ├── 5d32279dcd52b22d9e1178a02a3ad957.asciidoc
│ ├── 5d9d7b84e2fec7ecd832145cbb951cf1.asciidoc
│ ├── 5da6efd5b038ada64c9e853c88c1ec47.asciidoc
│ ├── 5dd695679b5141d9142d3d30ba8d300a.asciidoc
│ ├── 5eabcdbf61bfcb484dc694f25c2bba36.asciidoc
│ ├── 5f210f74725ea0c9265190346edfa246.asciidoc
│ ├── 5f3549ac7fee94682ca0d7439eebdd2a.asciidoc
│ ├── 5f3a3eefeefe6fa85ec49d499212d245.asciidoc
│ ├── 609260ad1d5998be2ca09ff1fe237efa.asciidoc
│ ├── 60ee33f3acfdd0fe6f288ac77312c780.asciidoc
│ ├── 6138d6919f3cbaaf61e1092f817d295c.asciidoc
│ ├── 618d5f3d35921d8cb7e9ccfbe9a4c3e3.asciidoc
│ ├── 621665fdbd7fc103c09bfeed28b67b1a.asciidoc
│ ├── 625dc94df1f9affb49a082fd99d41620.asciidoc
│ ├── 626f8c4b3e2cd3d9beaa63a7f5799d7a.asciidoc
│ ├── 645136747d37368a14ab34de8bd046c6.asciidoc
│ ├── 645796e8047967ca4a7635a22a876f4c.asciidoc
│ ├── 645c4c6e209719d3a4d25b1a629cb23b.asciidoc
│ ├── 6464124d1677f4552ddddd95a340ca3a.asciidoc
│ ├── 64b9baa6d7556b960b29698f3383aa31.asciidoc
│ ├── 6799d132c1c7ca3970763acde2337ef9.asciidoc
│ ├── 67bba546d835bca8f31df13e3587c348.asciidoc
│ ├── 67ceac4bf2d9ac7cc500390544cdcb41.asciidoc
│ ├── 68721288dc9ad8aa1b55099b4d303051.asciidoc
│ ├── 68738b4fd0dda177022be45be95b4c84.asciidoc
│ ├── 69a7be47f85138b10437113ab2f0d72d.asciidoc
│ ├── 6a1702dd50690cae833572e48a0ddf25.asciidoc
│ ├── 6a4679531e64c492fce16dc12de6dcb0.asciidoc
│ ├── 6a81d00f0d73bc5985e76b3cadab645e.asciidoc
│ ├── 6bbc613bd4f9aec1bbdbabf5db021d28.asciidoc
│ ├── 6be70810d6ebd6f09d8a49f9df847765.asciidoc
│ ├── 6bf63f2ec6ba55fcaf1092f48212bf25.asciidoc
│ ├── 6d1e75312a28a5ba23837abf768f2510.asciidoc
│ ├── 6f097c298a7abf4c032c4314920c49c8.asciidoc
│ ├── 6f21a878fee3b43c5332b81aaddbeac7.asciidoc
│ ├── 6faf10a73f7d5fffbcb037bdb2cbaff8.asciidoc
│ ├── 70f0aa5853697e265ef3b1df72940951.asciidoc
│ ├── 710c7871f20f176d51209b1574b0d61b.asciidoc
│ ├── 71b5b2ba9557d0f296ff2de91727d2f6.asciidoc
│ ├── 71ba9033107882f61cdc3b32fc73568d.asciidoc
│ ├── 72231b7debac60c95b9869a97dafda3a.asciidoc
│ ├── 72beebe779a258c225dee7b023e60c52.asciidoc
│ ├── 734c2e2a1e45b84f1e4e65b51356fcd7.asciidoc
│ ├── 73e5c88ad1488b213fb278ee1cb42289.asciidoc
│ ├── 745f9b8cdb8e91073f6e520e1d9f8c05.asciidoc
│ ├── 7477671958734843dd67cf0b8e6c7515.asciidoc
│ ├── 75330ec1305d2beb0e2f34d2195464e2.asciidoc
│ ├── 764f9884b370cbdc82a1c5c42ed40ff3.asciidoc
│ ├── 77243bbf92f2a55e0fca6c2a349a1c15.asciidoc
│ ├── 774d715155cd13713e6e327adf6ce328.asciidoc
│ ├── 78c96113ae4ed0054e581b17542528a7.asciidoc
│ ├── 7b908b1189f076942de8cd497ff1fa59.asciidoc
│ ├── 7cac05cb589f1614fd5b8589153bef06.asciidoc
│ ├── 7cf71671859be7c1ecf673396db377cd.asciidoc
│ ├── 7df191cc7f814e410a4ac7261065e6ef.asciidoc
│ ├── 7e52bec09624cf6c0de5d13f2bfad5a5.asciidoc
│ ├── 7f28f8ae8fcdbd807dadde0b5b007a6d.asciidoc
│ ├── 7f465b7e8ed42df6c42251b4481e699e.asciidoc
│ ├── 7f56755fb6c42f7e6203339a6d0cb6e6.asciidoc
│ ├── 7f697eb436dfa3c30dfe610d8c32d132.asciidoc
│ ├── 804a97ff4d0613e6568e4efb19c52021.asciidoc
│ ├── 81c9aa2678d6166a9662ddf2c011a6a5.asciidoc
│ ├── 83f95657beca9bf5d8264c80c7fb463f.asciidoc
│ ├── 8653e76676de5d327201b77512afa3a0.asciidoc
│ ├── 873fbbc6ab81409058591385fd602736.asciidoc
│ ├── 8871b8fcb6de4f0c7dff22798fb10fb7.asciidoc
│ ├── 899eef71a67a1b2aa11a2166ec7f48f1.asciidoc
│ ├── 89a8ac1509936acc272fc2d72907bc45.asciidoc
│ ├── 8a355eb25d2a01ba62dc1a22dd46f46f.asciidoc
│ ├── 8acc1d67b152e7027e0f0e1a8b4b2431.asciidoc
│ ├── 8baccd8688a6bad1749b8935f9601ea4.asciidoc
│ ├── 8c5977410335d58217e0626618ce6641.asciidoc
│ ├── 8cd00a3aba7c3c158277bc032aac2830.asciidoc
│ ├── 8d9a63d7c31f08bd27d92ece3de1649c.asciidoc
│ ├── 8dcc74dc01f26e853e3b3dfa458b1ad7.asciidoc
│ ├── 8de3206f80e18185a5ad6481f4c2ee07.asciidoc
│ ├── 8e6bfb4441ffa15c86d5dc20fa083571.asciidoc
│ ├── 8eaf4d5dd4ab1335deefa7749fdbbcc3.asciidoc
│ ├── 8f0511f8a5cb176ff2afdd4311799a33.asciidoc
│ ├── 8fdf2344c4fb3de6902ad7c5735270df.asciidoc
│ ├── 913770050ebbf3b9b549a899bc11060a.asciidoc
│ ├── 93f1bdd72e79827dcf9a34efa02fd977.asciidoc
│ ├── 9524a9b7373fa4eb2905183b0e806962.asciidoc
│ ├── 96de5703ba0bd43fd4ac239ec5408542.asciidoc
│ ├── 973a3ff47fc4ce036ecd9bd363fef9f7.asciidoc
│ ├── 978088f989d45dd09339582e9cbc60e0.asciidoc
│ ├── 979d25dff2d8987119410291ad47b0d1.asciidoc
│ ├── 97babc8d19ef0866774576716eb6d19e.asciidoc
│ ├── 98234499cfec70487cec5d013e976a84.asciidoc
│ ├── 98aeb275f829b5f7b8eb2147701565ff.asciidoc
│ ├── 98b121bf47cebd85671a2cb519688d28.asciidoc
│ ├── 98f14fddddea54a7d6149ab7b92e099d.asciidoc
│ ├── 99a52be903945b17e734a1d02a57e958.asciidoc
│ ├── 9a4d5e41c52c20635d1fd9c6e13f6c7a.asciidoc
│ ├── 9a8995fd31351045d99c78e40444c8ea.asciidoc
│ ├── 9e56d79ad9a02b642c361f0b85dd95d7.asciidoc
│ ├── 9efac5b23bf23de8d81a7455905e2979.asciidoc
│ ├── a116949e446f34dc25ae57d4b703d0c1.asciidoc
│ ├── a1db5c822745fe167e9ef854dca3d129.asciidoc
│ ├── a2a25aad1fea9a541b52ac613c78fb64.asciidoc
│ ├── a34d70d7022eb4ba48909d440c80390f.asciidoc
│ ├── a42f33e15b0995bb4b6058659bfdea85.asciidoc
│ ├── a49169b4622918992411fab4ec48191b.asciidoc
│ ├── a4a396cd07657b3977713fb3a742c41b.asciidoc
│ ├── a5a7050fb9dcb9574e081957ade28617.asciidoc
│ ├── a6f8636b03cc5f677b7d89e750328612.asciidoc
│ ├── a71c438cc4df1cafe3109ccff475afdb.asciidoc
│ ├── a7c15fe6b5779c84ce9a34bf4b2a7ab7.asciidoc
│ ├── a80f5db4357bb25b8704d374c18318ed.asciidoc
│ ├── a8fba09a46b2c3524428aa3259b7124f.asciidoc
│ ├── aa6bfe54e2436eb668091fe31c2fbf4d.asciidoc
│ ├── abd4fc3ce7784413a56fe2dcfe2809b5.asciidoc
│ ├── abf329ebefaf58acd4ee30e685731499.asciidoc
│ ├── ac544eb247a29ca42aab13826ca88561.asciidoc
│ ├── ad0dcbc7fc619e952c8825b8f307b7b2.asciidoc
│ ├── ad6ea0c1e46712aa1fd6d3bfa0ec979e.asciidoc
│ ├── ad79228630684d950fe9792a768d24c5.asciidoc
│ ├── ae9b5fbd42af2386ffbf56ad4a697e51.asciidoc
│ ├── ae9ccfaa146731ab9176df90670db1c2.asciidoc
│ ├── af3fb9fa5691a7b37a6dc2a69ff66e64.asciidoc
│ ├── afc29b61c532cf683f749baf013e7bfe.asciidoc
│ ├── b02e4907c9936c1adc16ccce9d49900d.asciidoc
│ ├── b0d64d0a554549e5b2808002a0725493.asciidoc
│ ├── b0eaf67e5cce24ef8889bf20951ccec1.asciidoc
│ ├── b0ec418bf416c62bed602b0a32a6d5f5.asciidoc
│ ├── b1efa1c51a34dd5ab5511b71a399f5b1.asciidoc
│ ├── b214942b938e47f2c486e523546cb574.asciidoc
│ ├── b41dce56b0e640d32b1cf452f87cec17.asciidoc
│ ├── b4392116f2cc57ce8064ccbad30318d5.asciidoc
│ ├── b4a0d0ed512dffc10ee53bca2feca49b.asciidoc
│ ├── b68c85fe1b0d2f264dc0d1cbf530f319.asciidoc
│ ├── b789292f9cf63ce912e058c46d90ce20.asciidoc
│ ├── b918d6b798da673a33e49b94f61dcdc0.asciidoc
│ ├── b919f88e6f47a40d5793479440a90ba6.asciidoc
│ ├── b93ed4ef309819734f0eeea82e8b0f1f.asciidoc
│ ├── b94cee0f74f57742b3948f9b784dfdd4.asciidoc
│ ├── b997885974522ef439d5e345924cc5ba.asciidoc
│ ├── b9a153725b28fdd0a5aabd7f17a8c2d7.asciidoc
│ ├── b9c5d7ca6ca9c6f747201f45337a4abf.asciidoc
│ ├── ba0b4081c98f3387f76b77847c52ee9a.asciidoc
│ ├── bb143628fd04070683eeeadc9406d9cc.asciidoc
│ ├── bc1ad5cc6d3eab98e3ce01f209ba7094.asciidoc
│ ├── bd5918ab903c0889bb1f09c8c2466e43.asciidoc
│ ├── bdb30dd52d32f50994008f4f9c0da5f0.asciidoc
│ ├── be1bd47393646ac6bbee177d1cdb7738.asciidoc
│ ├── be3a6431d01846950dc1a39a7a6a1faa.asciidoc
│ ├── be8f28f31207b173de61be032fcf239c.asciidoc
│ ├── bfcd65ab85d684d36a8550080032958d.asciidoc
│ ├── bfdad8a928ea30d7cf60d0a0a6bc6e2e.asciidoc
│ ├── c22b72c4a52ee098331b3f252c22860d.asciidoc
│ ├── c2c21e2824fbf6b7198ede30419da82b.asciidoc
│ ├── c32a3f8071d87f0a3f5a78e07fe7a669.asciidoc
│ ├── c48264ec5d9b9679fddd72e5c44425b9.asciidoc
│ ├── c4b278ba293abd0d02a0b5ad1a99f84a.asciidoc
│ ├── c5e5873783246c7b1c01d8464fed72c4.asciidoc
│ ├── c612d93e7f682a0d731e385edf9f5d56.asciidoc
│ ├── c849c6c8f8659dbb93e1c14356f74e37.asciidoc
│ ├── cb01106bf524df5e0501d4c655c1aa7b.asciidoc
│ ├── cd247f267968aa0927bfdad56852f8f5.asciidoc
│ ├── cd5bc5bf7cd58d7b1492c9c298b345f6.asciidoc
│ ├── cde4dddae5c06e7f1d38c9d933dbc7ac.asciidoc
│ ├── cdedd5f33f7e5f7acde561e97bff61de.asciidoc
│ ├── cf02e3d8b371bd59f0224967c36330da.asciidoc
│ ├── cfbaea6f0df045c5d940bbb6a9c69cd8.asciidoc
│ ├── cfc37446bd892d1ac42a3c8e8b204e6c.asciidoc
│ ├── d0a8a938a2fa913b6fdbc871079a59dd.asciidoc
│ ├── d17269bb80fb63ec0bf37d219e003dcb.asciidoc
│ ├── d1b3b7d2bb2ab90d15fd10318abd24db.asciidoc
│ ├── d1bcf2eb63a462bfdcf01a68e68d5b4a.asciidoc
│ ├── d222c6a6ec7a3beca6c97011b0874512.asciidoc
│ ├── d3016e4e8025362ad9a05ee86bb2061f.asciidoc
│ ├── d3088d5fa59b3ab110f64fb4f9b0065c.asciidoc
│ ├── d31062ff8c015387889fed4ad86fd914.asciidoc
│ ├── d4b4cefba4318caeba7480187faf2b13.asciidoc
│ ├── d50a3c64890f88af32c6d4ef4899d82a.asciidoc
│ ├── d5dcddc6398b473b6ad9bce5c6adf986.asciidoc
│ ├── d718b63cf1b6591a1d59a0cf4fd995eb.asciidoc
│ ├── d8b115341da772a628a024e7d1644e73.asciidoc
│ ├── d8b2a88b5eca99d3691ad3cd40266736.asciidoc
│ ├── d90a84a24a407731dfc1929ac8327746.asciidoc
│ ├── d9474f66970c6955e24b17c7447e7b5f.asciidoc
│ ├── db6cba451ba562abe953d09ad80cc15c.asciidoc
│ ├── dc15e2373e5ecbe09b4ea0858eb63d47.asciidoc
│ ├── de139866a220124360e5e27d1a736ea4.asciidoc
│ ├── de176bc4788ea286fff9e92418a43ea8.asciidoc
│ ├── df17f920b0deab3529b98df88b781f55.asciidoc
│ ├── dfac8d098b50aa0181161bcd17b38ef4.asciidoc
│ ├── dfb1fe96d806a644214d06f9b4b87878.asciidoc
│ ├── dfef545b1e2c247bafd1347e8e807ac1.asciidoc
│ ├── e0d6e02b998bdea99c9c08dcc3630c5e.asciidoc
│ ├── e17e8852ec3f31781e1364f4dffeb6d0.asciidoc
│ ├── e21e1c26dc8687e7bf7bd2bf019a6698.asciidoc
│ ├── e270f3f721a5712cd11a5ca03554f5b0.asciidoc
│ ├── e2a042c629429855c3bcaefffb26b7fa.asciidoc
│ ├── e30ea6e3823a139d7693d8cce1920a06.asciidoc
│ ├── e4be53736bcc02b03068fd72fdbfe271.asciidoc
│ ├── e567e6dbf86300142573c73789c8fce4.asciidoc
│ ├── e5d2172b524332196cac0f031c043659.asciidoc
│ ├── e5f50b31f165462d883ecbff45f74985.asciidoc
│ ├── e8e451bc8c45bcf16df43804c4fc8329.asciidoc
│ ├── e9c2e15b36372d5281c879d336322b6c.asciidoc
│ ├── e9fe608f105d7e3268a15e409e2cb9ab.asciidoc
│ ├── ea02de2dbe05091fcb0dac72c8ba5f83.asciidoc
│ ├── eb30ba547e4a7b8f54f33ab259aca523.asciidoc
│ ├── ebb6b59fbc9325c17e45f524602d6be2.asciidoc
│ ├── ec27afee074001b0e4e393611010842b.asciidoc
│ ├── ec473de07fe89bcbac1f8e278617fe46.asciidoc
│ ├── ef0f4fa4272c47ff62fb7b422cf975e7.asciidoc
│ ├── ef9111c1648d7820925f12e07d1346c5.asciidoc
│ ├── f085fb032dae56a3b104ab874eaea2ad.asciidoc
│ ├── f0e21e03a07c8fa0209b0aafdb3791e6.asciidoc
│ ├── f29a28fffa7ec604a33a838f48f7ea79.asciidoc
│ ├── f2d68493abd3ca430bd03a7f7f8d18f9.asciidoc
│ ├── f32f0c19b42de3b87dd764fe4ca17e7c.asciidoc
│ ├── f4a1008b3f9baa67bb03ce9ef5ab4cb4.asciidoc
│ ├── f6b5032bf27c2445d28845be0d413970.asciidoc
│ ├── f6d6889667f56b8f49d2858070571a6b.asciidoc
│ ├── f70a54cd9a9f4811bf962e469f2ca2ea.asciidoc
│ ├── f8cc4b331a19ff4df8e4a490f906ee69.asciidoc
│ ├── f9636d7ef1a45be4f36418c875cf6bef.asciidoc
│ ├── fa0f4485cd48f986b7ae8cbb24e331c4.asciidoc
│ ├── fa2fe60f570bd930d2891778c6efbfe6.asciidoc
│ ├── fa88f6f5a7d728ec4f1d05244228cb09.asciidoc
│ ├── fabe14480624a99e8ee42c7338672058.asciidoc
│ ├── fbcf5078a6a9e09790553804054c36b3.asciidoc
│ ├── fc8097bdfb6f3a4017bf4186ccca8a84.asciidoc
│ ├── fdcaba9547180439ff4b6275034a5170.asciidoc
│ ├── fdd38f0d248385a444c777e7acd97846.asciidoc
│ ├── fe5763d32955e8b65eb3048e97b1580c.asciidoc
│ └── feefeb68144002fd1fff57b77b95b85e.asciidoc
├── index-custom-title-page.html
├── reference
│ ├── client-helpers.md
│ ├── configuration.md
│ ├── connecting.md
│ ├── deleting_documents.md
│ ├── enabling_logger.md
│ ├── esql.md
│ ├── getting-started.md
│ ├── getting_documents.md
│ ├── host-config.md
│ ├── http-client.md
│ ├── http-meta-data.md
│ ├── images
│ │ ├── api_key_name.png
│ │ ├── cloud_api_key.png
│ │ ├── cloud_id.png
│ │ ├── create_api_key.png
│ │ └── es_endpoint.jpg
│ ├── index.md
│ ├── index_management.md
│ ├── indexing_documents.md
│ ├── installation.md
│ ├── iterators.md
│ ├── namespaces.md
│ ├── node_pool.md
│ ├── operations.md
│ ├── php_json_objects.md
│ ├── search_operations.md
│ ├── set-retries.md
│ ├── toc.yml
│ └── updating_documents.md
└── release-notes
│ ├── breaking-changes.md
│ ├── deprecations.md
│ ├── index.md
│ ├── known-issues.md
│ └── toc.yml
├── phpunit-integration-cloud-tests.xml
├── phpunit-yaml-serverless-tests.xml
├── phpunit-yaml-stack-tests.xml
└── src
├── Client.php
├── ClientBuilder.php
├── ClientInterface.php
├── Endpoints
├── AbstractEndpoint.php
├── AsyncSearch.php
├── Autoscaling.php
├── Cat.php
├── Ccr.php
├── Cluster.php
├── Connector.php
├── DanglingIndices.php
├── Enrich.php
├── Eql.php
├── Esql.php
├── Features.php
├── Fleet.php
├── Graph.php
├── Ilm.php
├── Indices.php
├── Inference.php
├── Ingest.php
├── License.php
├── Logstash.php
├── Migration.php
├── Ml.php
├── Monitoring.php
├── Nodes.php
├── Profiling.php
├── QueryRules.php
├── Rollup.php
├── SearchApplication.php
├── SearchableSnapshots.php
├── Security.php
├── Shutdown.php
├── Simulate.php
├── Slm.php
├── Snapshot.php
├── Sql.php
├── Ssl.php
├── Synonyms.php
├── Tasks.php
├── TextStructure.php
├── Transform.php
├── Watcher.php
└── Xpack.php
├── Exception
├── ArrayAccessException.php
├── AuthenticationException.php
├── ClientResponseException.php
├── ConfigException.php
├── ContentTypeException.php
├── ElasticsearchException.php
├── HttpClientException.php
├── InvalidArgumentException.php
├── MissingParameterException.php
├── ProductCheckException.php
└── ServerResponseException.php
├── Helper
└── Iterators
│ ├── SearchHitIterator.php
│ └── SearchResponseIterator.php
├── Response
├── Elasticsearch.php
└── ElasticsearchInterface.php
├── Traits
├── ClientEndpointsTrait.php
├── EndpointTrait.php
├── MessageResponseTrait.php
├── NamespaceTrait.php
├── ProductCheckTrait.php
└── ResponseTrait.php
├── Transport
├── Adapter
│ ├── AdapterInterface.php
│ ├── AdapterOptions.php
│ ├── ElasticCurl.php
│ ├── Guzzle.php
│ └── Symfony.php
├── AsyncOnSuccess.php
├── AsyncOnSuccessNoException.php
└── RequestOptions.php
└── Utility.php
/catalog-info.yaml:
--------------------------------------------------------------------------------
1 | # Declare your Buildkite pipelines below
2 | ---
3 | # yaml-language-server: $schema=https://gist.githubusercontent.com/elasticmachine/988b80dae436cafea07d9a4a460a011d/raw/rre.schema.json
4 | apiVersion: backstage.io/v1alpha1
5 | kind: Resource
6 | metadata:
7 | name: buildkite-pipeline-elasticsearch-php
8 | description: Buildkite Pipeline for elasticsearch-php
9 | links:
10 | - title: Pipeline
11 | url: https://buildkite.com/elastic/elasticsearch-php
12 |
13 | spec:
14 | type: buildkite-pipeline
15 | owner: group:devtools-team
16 | system: buildkite
17 | implementation:
18 | apiVersion: buildkite.elastic.dev/v1
19 | kind: Pipeline
20 | metadata:
21 | name: elasticsearch-php
22 | description: Elasticsearch PHP Client
23 | spec:
24 | repository: elastic/elasticsearch-php
25 | pipeline_file: ".buildkite/pipeline.yml"
26 | teams:
27 | devtools-team:
28 | access_level: MANAGE_BUILD_AND_READ
29 | everyone:
30 | access_level: READ_ONLY
31 |
--------------------------------------------------------------------------------
/docs/docset.yml:
--------------------------------------------------------------------------------
1 | project: 'PHP client'
2 | cross_links:
3 | - docs-content
4 | - elasticsearch
5 | toc:
6 | - toc: reference
7 | - toc: release-notes
8 | subs:
9 | es: "Elasticsearch"
10 |
--------------------------------------------------------------------------------
/docs/examples/014b788c879e4aaa1020672e45e25473.asciidoc:
--------------------------------------------------------------------------------
1 | // search.asciidoc:72
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'body' => [
7 | 'transient' => [
8 | 'cluster.routing.use_adaptive_replica_selection' => false,
9 | ],
10 | ],
11 | ];
12 | $response = $client->cluster()->putSettings($params);
13 | ----
14 |
--------------------------------------------------------------------------------
/docs/examples/015294a400986295039e52ebc62033be.asciidoc:
--------------------------------------------------------------------------------
1 | // docs/update.asciidoc:251
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'test',
7 | 'id' => '1',
8 | 'body' => [
9 | 'doc' => [
10 | 'name' => 'new_name',
11 | ],
12 | 'detect_noop' => false,
13 | ],
14 | ];
15 | $response = $client->update($params);
16 | ----
17 |
--------------------------------------------------------------------------------
/docs/examples/025b54db0edc50c24ea48a2bd94366ad.asciidoc:
--------------------------------------------------------------------------------
1 | // docs/update-by-query.asciidoc:606
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'twitter',
7 | ];
8 | $response = $client->search($params);
9 | ----
10 |
--------------------------------------------------------------------------------
/docs/examples/033778305d52746f5ce0a2a922c8e521.asciidoc:
--------------------------------------------------------------------------------
1 | // aggregations/bucket/terms-aggregation.asciidoc:410
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'body' => [
7 | 'aggs' => [
8 | 'genres' => [
9 | 'terms' => [
10 | 'script' => [
11 | 'source' => 'doc[\'genre\'].value',
12 | 'lang' => 'painless',
13 | ],
14 | ],
15 | ],
16 | ],
17 | ],
18 | ];
19 | $response = $client->search($params);
20 | ----
21 |
--------------------------------------------------------------------------------
/docs/examples/047266b0d20fdb62ebc72d51952c8f6d.asciidoc:
--------------------------------------------------------------------------------
1 | // query-dsl/multi-match-query.asciidoc:341
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'body' => [
7 | 'query' => [
8 | 'multi_match' => [
9 | 'query' => 'Will Smith',
10 | 'type' => 'cross_fields',
11 | 'fields' => [
12 | 'first_name',
13 | 'last_name',
14 | ],
15 | 'operator' => 'and',
16 | ],
17 | ],
18 | ],
19 | ];
20 | $response = $client->search($params);
21 | ----
22 |
--------------------------------------------------------------------------------
/docs/examples/048d8abd42d094bbdcf4452a58ccb35b.asciidoc:
--------------------------------------------------------------------------------
1 | // docs/index_.asciidoc:531
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'twitter',
7 | 'id' => '1',
8 | 'body' => [
9 | 'user' => 'kimchy',
10 | 'post_date' => '2009-11-15T14:12:12',
11 | 'message' => 'trying out Elasticsearch',
12 | ],
13 | ];
14 | $response = $client->create($params);
15 | ----
16 |
--------------------------------------------------------------------------------
/docs/examples/04f5dd677c777bcb15d7d5fa63275fc8.asciidoc:
--------------------------------------------------------------------------------
1 | // cluster/health.asciidoc:36
2 |
3 | [source, php]
4 | ----
5 | $response = $client->cluster()->health();
6 | ----
7 |
--------------------------------------------------------------------------------
/docs/examples/04fe1e3a0047b0cdb10987b79fc3f3f3.asciidoc:
--------------------------------------------------------------------------------
1 | // search/request/sort.asciidoc:568
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'body' => [
7 | 'query' => [
8 | 'term' => [
9 | 'user' => 'kimchy',
10 | ],
11 | ],
12 | 'sort' => [
13 | '_script' => [
14 | 'type' => 'number',
15 | 'script' => [
16 | 'lang' => 'painless',
17 | 'source' => 'doc[\'field_name\'].value * params.factor',
18 | 'params' => [
19 | 'factor' => 1.1,
20 | ],
21 | ],
22 | 'order' => 'asc',
23 | ],
24 | ],
25 | ],
26 | ];
27 | $response = $client->search($params);
28 | ----
29 |
--------------------------------------------------------------------------------
/docs/examples/073539a7e38be3cdf13008330b6a536a.asciidoc:
--------------------------------------------------------------------------------
1 | // cat/indices.asciidoc:100
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'twi*',
7 | ];
8 | $response = $client->cat()->indices($params);
9 | ----
10 |
--------------------------------------------------------------------------------
/docs/examples/0989cc65d8924f666ce3eb0820d2d244.asciidoc:
--------------------------------------------------------------------------------
1 | // indices/put-mapping.asciidoc:435
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'users',
7 | 'body' => [
8 | 'user_id' => 12345,
9 | ],
10 | ];
11 | $response = $client->index($params);
12 | $params = [
13 | 'index' => 'users',
14 | 'body' => [
15 | 'user_id' => 12346,
16 | ],
17 | ];
18 | $response = $client->index($params);
19 | ----
20 |
--------------------------------------------------------------------------------
/docs/examples/09d617863a103c82fb4101e6165ea7fe.asciidoc:
--------------------------------------------------------------------------------
1 | // query-dsl/match-all-query.asciidoc:11
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'body' => [
7 | 'query' => [
8 | 'match_all' => [
9 | ],
10 | ],
11 | ],
12 | ];
13 | $response = $client->search($params);
14 | ----
15 |
--------------------------------------------------------------------------------
/docs/examples/09dbd90c5e22ea4a17b4cf9aa72e08ae.asciidoc:
--------------------------------------------------------------------------------
1 | // api-conventions.asciidoc:231
2 |
3 | [source, php]
4 | ----
5 | $response = $client->search();
6 | ----
7 |
--------------------------------------------------------------------------------
/docs/examples/09ecba5814d71e4c44468575eada9878.asciidoc:
--------------------------------------------------------------------------------
1 | // aggregations/bucket/datehistogram-aggregation.asciidoc:214
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'sales',
7 | 'body' => [
8 | 'aggs' => [
9 | 'sales_over_time' => [
10 | 'date_histogram' => [
11 | 'field' => 'date',
12 | 'fixed_interval' => '30d',
13 | ],
14 | ],
15 | ],
16 | ],
17 | ];
18 | $response = $client->search($params);
19 | ----
20 |
--------------------------------------------------------------------------------
/docs/examples/0a958e486ede3f519d48431ab689eded.asciidoc:
--------------------------------------------------------------------------------
1 | // docs/update.asciidoc:271
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'test',
7 | 'id' => '1',
8 | 'body' => [
9 | 'script' => [
10 | 'source' => 'ctx._source.counter += params.count',
11 | 'lang' => 'painless',
12 | 'params' => [
13 | 'count' => 4,
14 | ],
15 | ],
16 | 'upsert' => [
17 | 'counter' => 1,
18 | ],
19 | ],
20 | ];
21 | $response = $client->update($params);
22 | ----
23 |
--------------------------------------------------------------------------------
/docs/examples/0ac9916f47a2483b89c1416684af322a.asciidoc:
--------------------------------------------------------------------------------
1 | // query-dsl/match-query.asciidoc:241
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'body' => [
7 | 'query' => [
8 | 'match' => [
9 | 'message' => [
10 | 'query' => 'to be or not to be',
11 | 'operator' => 'and',
12 | 'zero_terms_query' => 'all',
13 | ],
14 | ],
15 | ],
16 | ],
17 | ];
18 | $response = $client->search($params);
19 | ----
20 |
--------------------------------------------------------------------------------
/docs/examples/0afaf1cad692e6201aa574c8feb6e622.asciidoc:
--------------------------------------------------------------------------------
1 | // aggregations/bucket/terms-aggregation.asciidoc:492
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'body' => [
7 | 'aggs' => [
8 | 'tags' => [
9 | 'terms' => [
10 | 'field' => 'tags',
11 | 'include' => '.*sport.*',
12 | 'exclude' => 'water_.*',
13 | ],
14 | ],
15 | ],
16 | ],
17 | ];
18 | $response = $client->search($params);
19 | ----
20 |
--------------------------------------------------------------------------------
/docs/examples/0ba0b2db24852abccb7c0fc1098d566e.asciidoc:
--------------------------------------------------------------------------------
1 | // docs/get.asciidoc:366
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'twitter',
7 | 'id' => '2',
8 | 'body' => [
9 | 'counter' => 1,
10 | 'tags' => [
11 | 'white',
12 | ],
13 | ],
14 | ];
15 | $response = $client->index($params);
16 | ----
17 |
--------------------------------------------------------------------------------
/docs/examples/0bbd30b9be3e54ff3028b9f4459634d2.asciidoc:
--------------------------------------------------------------------------------
1 | // indices/put-mapping.asciidoc:171
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'my_index',
7 | 'body' => [
8 | 'properties' => [
9 | 'name' => [
10 | 'properties' => [
11 | 'last' => [
12 | 'type' => 'text',
13 | ],
14 | ],
15 | ],
16 | ],
17 | ],
18 | ];
19 | $response = $client->indices()->putMapping($params);
20 | ----
21 |
--------------------------------------------------------------------------------
/docs/examples/0be2c28ee65384774b1e479b47dc3d92.asciidoc:
--------------------------------------------------------------------------------
1 | // indices/update-settings.asciidoc:120
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'twitter',
7 | 'body' => [
8 | 'index' => [
9 | 'refresh_interval' => '1s',
10 | ],
11 | ],
12 | ];
13 | $response = $client->indices()->putSettings($params);
14 | ----
15 |
--------------------------------------------------------------------------------
/docs/examples/0c4ad860a485fe53d8140ad3ccd11dcf.asciidoc:
--------------------------------------------------------------------------------
1 | // query-dsl/terms-query.asciidoc:19
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'body' => [
7 | 'query' => [
8 | 'terms' => [
9 | 'user' => [
10 | 'kimchy',
11 | 'elasticsearch',
12 | ],
13 | 'boost' => 1,
14 | ],
15 | ],
16 | ],
17 | ];
18 | $response = $client->search($params);
19 | ----
20 |
--------------------------------------------------------------------------------
/docs/examples/0cc991e3f7f8511a34730e154b3c5edc.asciidoc:
--------------------------------------------------------------------------------
1 | // docs/reindex.asciidoc:25
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'body' => [
7 | 'source' => [
8 | 'index' => 'twitter',
9 | ],
10 | 'dest' => [
11 | 'index' => 'new_twitter',
12 | ],
13 | ],
14 | ];
15 | $response = $client->reindex($params);
16 | ----
17 |
--------------------------------------------------------------------------------
/docs/examples/0ce3606f1dba490eef83c4317b315b62.asciidoc:
--------------------------------------------------------------------------------
1 | // search/request-body.asciidoc:7
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'twitter',
7 | 'body' => [
8 | 'query' => [
9 | 'term' => [
10 | 'user' => 'kimchy',
11 | ],
12 | ],
13 | ],
14 | ];
15 | $response = $client->search($params);
16 | ----
17 |
--------------------------------------------------------------------------------
/docs/examples/0d664883151008b1051ef2c9ab2d0373.asciidoc:
--------------------------------------------------------------------------------
1 | // docs/update-by-query.asciidoc:537
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'twitter',
7 | 'body' => [
8 | 'slice' => [
9 | 'id' => 0,
10 | 'max' => 2,
11 | ],
12 | 'script' => [
13 | 'source' => 'ctx._source[\'extra\'] = \'test\'',
14 | ],
15 | ],
16 | ];
17 | $response = $client->updateByQuery($params);
18 | $params = [
19 | 'index' => 'twitter',
20 | 'body' => [
21 | 'slice' => [
22 | 'id' => 1,
23 | 'max' => 2,
24 | ],
25 | 'script' => [
26 | 'source' => 'ctx._source[\'extra\'] = \'test\'',
27 | ],
28 | ],
29 | ];
30 | $response = $client->updateByQuery($params);
31 | ----
32 |
--------------------------------------------------------------------------------
/docs/examples/0e118857b815b62118a30c042f079db1.asciidoc:
--------------------------------------------------------------------------------
1 | // query-dsl/multi-match-query.asciidoc:259
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'body' => [
7 | 'query' => [
8 | 'multi_match' => [
9 | 'query' => 'quick brown f',
10 | 'type' => 'phrase_prefix',
11 | 'fields' => [
12 | 'subject',
13 | 'message',
14 | ],
15 | ],
16 | ],
17 | ],
18 | ];
19 | $response = $client->search($params);
20 | ----
21 |
--------------------------------------------------------------------------------
/docs/examples/1027ab1ca767ac1428176ef4f84bfbcf.asciidoc:
--------------------------------------------------------------------------------
1 | // search/request/scroll.asciidoc:206
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'twitter',
7 | 'body' => [
8 | 'slice' => [
9 | 'id' => 0,
10 | 'max' => 2,
11 | ],
12 | 'query' => [
13 | 'match' => [
14 | 'title' => 'elasticsearch',
15 | ],
16 | ],
17 | ],
18 | ];
19 | $response = $client->search($params);
20 | $params = [
21 | 'index' => 'twitter',
22 | 'body' => [
23 | 'slice' => [
24 | 'id' => 1,
25 | 'max' => 2,
26 | ],
27 | 'query' => [
28 | 'match' => [
29 | 'title' => 'elasticsearch',
30 | ],
31 | ],
32 | ],
33 | ];
34 | $response = $client->search($params);
35 | ----
36 |
--------------------------------------------------------------------------------
/docs/examples/1216f8f7367df3aa823012cef310c08a.asciidoc:
--------------------------------------------------------------------------------
1 | // docs/reindex.asciidoc:716
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'body' => [
7 | 'source' => [
8 | 'index' => 'test',
9 | ],
10 | 'dest' => [
11 | 'index' => 'test2',
12 | ],
13 | 'script' => [
14 | 'source' => 'ctx._source.tag = ctx._source.remove("flag")',
15 | ],
16 | ],
17 | ];
18 | $response = $client->reindex($params);
19 | ----
20 |
--------------------------------------------------------------------------------
/docs/examples/12433d2b637d002e8d5c9a1adce69d3b.asciidoc:
--------------------------------------------------------------------------------
1 | // indices/put-mapping.asciidoc:89
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'publications',
7 | ];
8 | $response = $client->indices()->create($params);
9 | ----
10 |
--------------------------------------------------------------------------------
/docs/examples/1252fa45847edba5ec2b2f33da70ec5b.asciidoc:
--------------------------------------------------------------------------------
1 | // api-conventions.asciidoc:282
2 |
3 | [source, php]
4 | ----
5 | $response = $client->cluster()->state();
6 | ----
7 |
--------------------------------------------------------------------------------
/docs/examples/138ccd89f72aa7502dd9578403dcc589.asciidoc:
--------------------------------------------------------------------------------
1 | // docs/get.asciidoc:53
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'twitter',
7 | 'id' => '0',
8 | ];
9 | $response = $client->get($params);
10 | ----
11 |
--------------------------------------------------------------------------------
/docs/examples/14701dcc0cca9665fce2aace0cb62af7.asciidoc:
--------------------------------------------------------------------------------
1 | // docs/delete-by-query.asciidoc:511
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'twitter',
7 | 'body' => [
8 | 'query' => [
9 | 'range' => [
10 | 'likes' => [
11 | 'lt' => 10,
12 | ],
13 | ],
14 | ],
15 | ],
16 | ];
17 | $response = $client->search($params);
18 | ----
19 |
--------------------------------------------------------------------------------
/docs/examples/1577e6e806b3283c9e99f1596d310754.asciidoc:
--------------------------------------------------------------------------------
1 | // docs/reindex.asciidoc:704
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'test',
7 | 'id' => '1',
8 | 'body' => [
9 | 'text' => 'words words',
10 | 'flag' => 'foo',
11 | ],
12 | ];
13 | $response = $client->index($params);
14 | ----
15 |
--------------------------------------------------------------------------------
/docs/examples/15dad5338065baaaa7d475abe85f4c22.asciidoc:
--------------------------------------------------------------------------------
1 | // search/request/sort.asciidoc:515
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'body' => [
7 | 'sort' => [
8 | [
9 | '_geo_distance' => [
10 | 'pin.location' => [
11 | -70,
12 | 40,
13 | ],
14 | 'order' => 'asc',
15 | 'unit' => 'km',
16 | ],
17 | ],
18 | ],
19 | 'query' => [
20 | 'term' => [
21 | 'user' => 'kimchy',
22 | ],
23 | ],
24 | ],
25 | ];
26 | $response = $client->search($params);
27 | ----
28 |
--------------------------------------------------------------------------------
/docs/examples/162b5b693b713f0bfab1209d59443c46.asciidoc:
--------------------------------------------------------------------------------
1 | // query-dsl/bool-query.asciidoc:130
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'body' => [
7 | 'query' => [
8 | 'constant_score' => [
9 | 'filter' => [
10 | 'term' => [
11 | 'status' => 'active',
12 | ],
13 | ],
14 | ],
15 | ],
16 | ],
17 | ];
18 | $response = $client->search($params);
19 | ----
20 |
--------------------------------------------------------------------------------
/docs/examples/179f0a3e84ff4bbac18787a018eabf89.asciidoc:
--------------------------------------------------------------------------------
1 | // query-dsl/multi-match-query.asciidoc:472
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'body' => [
7 | 'query' => [
8 | 'multi_match' => [
9 | 'query' => 'Jon',
10 | 'type' => 'cross_fields',
11 | 'analyzer' => 'standard',
12 | 'fields' => [
13 | 'first',
14 | 'last',
15 | '*.edge',
16 | ],
17 | ],
18 | ],
19 | ],
20 | ];
21 | $response = $client->search($params);
22 | ----
23 |
--------------------------------------------------------------------------------
/docs/examples/17de0020b228df961ad3c6b06233c948.asciidoc:
--------------------------------------------------------------------------------
1 | // indices/put-mapping.asciidoc:351
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'my_index',
7 | 'body' => [
8 | 'properties' => [
9 | 'user_id' => [
10 | 'type' => 'keyword',
11 | 'ignore_above' => 100,
12 | ],
13 | ],
14 | ],
15 | ];
16 | $response = $client->indices()->putMapping($params);
17 | ----
18 |
--------------------------------------------------------------------------------
/docs/examples/189a921df2f5b1fe580937210ce9c1c2.asciidoc:
--------------------------------------------------------------------------------
1 | // search.asciidoc:96
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'body' => [
7 | 'query' => [
8 | 'match_all' => [
9 | ],
10 | ],
11 | 'stats' => [
12 | 'group1',
13 | 'group2',
14 | ],
15 | ],
16 | ];
17 | $response = $client->search($params);
18 | ----
19 |
--------------------------------------------------------------------------------
/docs/examples/18ddb7e7a4bcafd449df956e828ed7a8.asciidoc:
--------------------------------------------------------------------------------
1 | // docs/update-by-query.asciidoc:498
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'task_id' => 'r1A2WoRbTwKZ516z6NEs5A:36619',
7 | ];
8 | $response = $client->tasks()->cancel($params);
9 | ----
10 |
--------------------------------------------------------------------------------
/docs/examples/1aa91d3d48140d6367b6cabca8737b8f.asciidoc:
--------------------------------------------------------------------------------
1 | // docs/bulk.asciidoc:567
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'body' => [
7 | [
8 | 'update' => [
9 | '_id' => '5',
10 | '_index' => 'index1',
11 | ],
12 | ],
13 | [
14 | 'doc' => [
15 | 'my_field' => 'foo',
16 | ],
17 | ],
18 | [
19 | 'update' => [
20 | '_id' => '6',
21 | '_index' => 'index1',
22 | ],
23 | ],
24 | [
25 | 'doc' => [
26 | 'my_field' => 'foo',
27 | ],
28 | ],
29 | [
30 | 'create' => [
31 | '_id' => '7',
32 | '_index' => 'index1',
33 | ],
34 | ],
35 | [
36 | 'my_field' => 'foo',
37 | ],
38 | ],
39 | ];
40 | $response = $client->bulk($params);
41 | ----
42 |
--------------------------------------------------------------------------------
/docs/examples/1b542e3ea87a742f95641d64dcfb1bdb.asciidoc:
--------------------------------------------------------------------------------
1 | // search/count.asciidoc:7
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'twitter',
7 | ];
8 | $response = $client->count($params);
9 | ----
10 |
--------------------------------------------------------------------------------
/docs/examples/1b8655e6ba99fe39933c6eafe78728b7.asciidoc:
--------------------------------------------------------------------------------
1 | // docs/reindex.asciidoc:204
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'body' => [
7 | 'source' => [
8 | 'index' => 'twitter',
9 | 'slice' => [
10 | 'id' => 0,
11 | 'max' => 2,
12 | ],
13 | ],
14 | 'dest' => [
15 | 'index' => 'new_twitter',
16 | ],
17 | ],
18 | ];
19 | $response = $client->reindex($params);
20 | $params = [
21 | 'body' => [
22 | 'source' => [
23 | 'index' => 'twitter',
24 | 'slice' => [
25 | 'id' => 1,
26 | 'max' => 2,
27 | ],
28 | ],
29 | 'dest' => [
30 | 'index' => 'new_twitter',
31 | ],
32 | ],
33 | ];
34 | $response = $client->reindex($params);
35 | ----
36 |
--------------------------------------------------------------------------------
/docs/examples/1b8caf0a6741126c6d0ad83b56fce290.asciidoc:
--------------------------------------------------------------------------------
1 | // indices/templates.asciidoc:146
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'name' => 'template_1',
7 | 'body' => [
8 | 'index_patterns' => [
9 | 'te*',
10 | ],
11 | 'settings' => [
12 | 'number_of_shards' => 1,
13 | ],
14 | 'aliases' => [
15 | 'alias1' => [
16 | ],
17 | 'alias2' => [
18 | 'filter' => [
19 | 'term' => [
20 | 'user' => 'kimchy',
21 | ],
22 | ],
23 | 'routing' => 'kimchy',
24 | ],
25 | '{index}-alias' => [
26 | ],
27 | ],
28 | ],
29 | ];
30 | $response = $client->indices()->putTemplate($params);
31 | ----
32 |
--------------------------------------------------------------------------------
/docs/examples/1bc731a4df952228af6dfa6b48627332.asciidoc:
--------------------------------------------------------------------------------
1 | // docs/reindex.asciidoc:819
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'body' => [
7 | 'max_docs' => 10,
8 | 'source' => [
9 | 'index' => 'twitter',
10 | 'query' => [
11 | 'function_score' => [
12 | 'random_score' => [
13 | ],
14 | 'min_score' => 0.9,
15 | ],
16 | ],
17 | ],
18 | 'dest' => [
19 | 'index' => 'random_twitter',
20 | ],
21 | ],
22 | ];
23 | $response = $client->reindex($params);
24 | ----
25 |
--------------------------------------------------------------------------------
/docs/examples/1c23507edd7a3c18538b68223378e4ab.asciidoc:
--------------------------------------------------------------------------------
1 | // indices/create-index.asciidoc:10
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'twitter',
7 | ];
8 | $response = $client->indices()->create($params);
9 | ----
10 |
--------------------------------------------------------------------------------
/docs/examples/1d65cb6d055c46a1bde809687d835b71.asciidoc:
--------------------------------------------------------------------------------
1 | // docs/get.asciidoc:86
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'twitter',
7 | 'id' => '2',
8 | ];
9 | $response = $client->get($params);
10 | ----
11 |
--------------------------------------------------------------------------------
/docs/examples/1da77e114459e0b77d78a3dcc8fae429.asciidoc:
--------------------------------------------------------------------------------
1 | // indices/put-mapping.asciidoc:114
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'twitter-1',
7 | ];
8 | $response = $client->indices()->create($params);
9 | $params = [
10 | 'index' => 'twitter-2',
11 | ];
12 | $response = $client->indices()->create($params);
13 | $params = [
14 | 'index' => 'twitter-1,twitter-2',
15 | 'body' => [
16 | 'properties' => [
17 | 'user_name' => [
18 | 'type' => 'text',
19 | ],
20 | ],
21 | ],
22 | ];
23 | $response = $client->indices()->putMapping($params);
24 | ----
25 |
--------------------------------------------------------------------------------
/docs/examples/1dbb8cf17fbc45c87c7d2f75f15f9778.asciidoc:
--------------------------------------------------------------------------------
1 | // api-conventions.asciidoc:259
2 |
3 | [source, php]
4 | ----
5 | $response = $client->cluster()->state();
6 | ----
7 |
--------------------------------------------------------------------------------
/docs/examples/1e18a67caf8f06ff2710ec4a8b30f625.asciidoc:
--------------------------------------------------------------------------------
1 | // api-conventions.asciidoc:326
2 |
3 | [source, php]
4 | ----
5 | $response = $client->cluster()->state();
6 | ----
7 |
--------------------------------------------------------------------------------
/docs/examples/1e49eba5b9042c1900a608fe5105ba43.asciidoc:
--------------------------------------------------------------------------------
1 | // docs/delete-by-query.asciidoc:421
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'twitter',
7 | 'body' => [
8 | 'slice' => [
9 | 'id' => 0,
10 | 'max' => 2,
11 | ],
12 | 'query' => [
13 | 'range' => [
14 | 'likes' => [
15 | 'lt' => 10,
16 | ],
17 | ],
18 | ],
19 | ],
20 | ];
21 | $response = $client->deleteByQuery($params);
22 | $params = [
23 | 'index' => 'twitter',
24 | 'body' => [
25 | 'slice' => [
26 | 'id' => 1,
27 | 'max' => 2,
28 | ],
29 | 'query' => [
30 | 'range' => [
31 | 'likes' => [
32 | 'lt' => 10,
33 | ],
34 | ],
35 | ],
36 | ],
37 | ];
38 | $response = $client->deleteByQuery($params);
39 | ----
40 |
--------------------------------------------------------------------------------
/docs/examples/1e50d993bd6517e6c381e82d09f0389e.asciidoc:
--------------------------------------------------------------------------------
1 | // search/request/from-size.asciidoc:22
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'body' => [
7 | 'from' => 5,
8 | 'size' => 20,
9 | 'query' => [
10 | 'term' => [
11 | 'user.id' => '8a4f500d',
12 | ],
13 | ],
14 | ],
15 | ];
16 | $response = $client->search($params);
17 | ----
18 |
--------------------------------------------------------------------------------
/docs/examples/1f336ecc62480c1d56351cc2f82d0d08.asciidoc:
--------------------------------------------------------------------------------
1 | // docs/index_.asciidoc:440
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'twitter',
7 | 'id' => '1',
8 | 'body' => [
9 | 'message' => 'elasticsearch now has versioning support, double cool!',
10 | ],
11 | ];
12 | $response = $client->index($params);
13 | ----
14 |
--------------------------------------------------------------------------------
/docs/examples/1f6fe6833686e38c3711c6f2aa00a078.asciidoc:
--------------------------------------------------------------------------------
1 | // indices/put-mapping.asciidoc:332
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'my_index',
7 | 'body' => [
8 | 'mappings' => [
9 | 'properties' => [
10 | 'user_id' => [
11 | 'type' => 'keyword',
12 | 'ignore_above' => 20,
13 | ],
14 | ],
15 | ],
16 | ],
17 | ];
18 | $response = $client->indices()->create($params);
19 | ----
20 |
--------------------------------------------------------------------------------
/docs/examples/210cf5c76bff517f48e80fa1c2d63907.asciidoc:
--------------------------------------------------------------------------------
1 | // indices/put-mapping.asciidoc:561
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'my_index',
7 | ];
8 | $response = $client->indices()->getMapping($params);
9 | ----
10 |
--------------------------------------------------------------------------------
/docs/examples/213ab768f1b6a895e09403a0880e259a.asciidoc:
--------------------------------------------------------------------------------
1 | // aggregations/metrics/valuecount-aggregation.asciidoc:65
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'sales',
7 | 'body' => [
8 | 'aggs' => [
9 | 'types_count' => [
10 | 'value_count' => [
11 | 'script' => [
12 | 'id' => 'my_script',
13 | 'params' => [
14 | 'field' => 'type',
15 | ],
16 | ],
17 | ],
18 | ],
19 | ],
20 | ],
21 | ];
22 | $response = $client->search($params);
23 | ----
24 |
--------------------------------------------------------------------------------
/docs/examples/216848930c2d344fe0bed0daa70c35b9.asciidoc:
--------------------------------------------------------------------------------
1 | // docs/delete-by-query.asciidoc:593
2 |
3 | [source, php]
4 | ----
5 | $response = $client->tasks()->list();
6 | ----
7 |
--------------------------------------------------------------------------------
/docs/examples/231aa0bb39c35fe199d28fe0e4a62b2e.asciidoc:
--------------------------------------------------------------------------------
1 | // getting-started.asciidoc:495
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'bank',
7 | 'body' => [
8 | 'query' => [
9 | 'match_phrase' => [
10 | 'address' => 'mill lane',
11 | ],
12 | ],
13 | ],
14 | ];
15 | $response = $client->search($params);
16 | ----
17 |
--------------------------------------------------------------------------------
/docs/examples/23ab0f1023b1b2cd5cdf2a8f9ccfd57b.asciidoc:
--------------------------------------------------------------------------------
1 | // indices/aliases.asciidoc:304
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'test1',
7 | 'body' => [
8 | 'mappings' => [
9 | 'properties' => [
10 | 'user' => [
11 | 'type' => 'keyword',
12 | ],
13 | ],
14 | ],
15 | ],
16 | ];
17 | $response = $client->indices()->create($params);
18 | ----
19 |
--------------------------------------------------------------------------------
/docs/examples/2468ab381257d759d8a88af1141f6f9c.asciidoc:
--------------------------------------------------------------------------------
1 | // docs/get.asciidoc:288
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'twitter',
7 | 'id' => '1',
8 | ];
9 | $response = $client->existsSource($params);
10 | ----
11 |
--------------------------------------------------------------------------------
/docs/examples/251ea12c1248385ab409906ac64d9ee9.asciidoc:
--------------------------------------------------------------------------------
1 | // getting-started.asciidoc:544
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'bank',
7 | 'body' => [
8 | 'query' => [
9 | 'bool' => [
10 | 'must' => [
11 | 'match_all' => [
12 | ],
13 | ],
14 | 'filter' => [
15 | 'range' => [
16 | 'balance' => [
17 | 'gte' => 20000,
18 | 'lte' => 30000,
19 | ],
20 | ],
21 | ],
22 | ],
23 | ],
24 | ],
25 | ];
26 | $response = $client->search($params);
27 | ----
28 |
--------------------------------------------------------------------------------
/docs/examples/2533e4b36ae837eaecda08407ecb6383.asciidoc:
--------------------------------------------------------------------------------
1 | // search/suggesters.asciidoc:51
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'body' => [
7 | 'suggest' => [
8 | 'my-suggest-1' => [
9 | 'text' => 'tring out Elasticsearch',
10 | 'term' => [
11 | 'field' => 'message',
12 | ],
13 | ],
14 | 'my-suggest-2' => [
15 | 'text' => 'kmichy',
16 | 'term' => [
17 | 'field' => 'user',
18 | ],
19 | ],
20 | ],
21 | ],
22 | ];
23 | $response = $client->search($params);
24 | ----
25 |
--------------------------------------------------------------------------------
/docs/examples/2891aa10ee9d474780adf94d5607f2db.asciidoc:
--------------------------------------------------------------------------------
1 | // search/request/sort.asciidoc:153
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'index_long,index_double',
7 | 'body' => [
8 | 'sort' => [
9 | [
10 | 'field' => [
11 | 'numeric_type' => 'double',
12 | ],
13 | ],
14 | ],
15 | ],
16 | ];
17 | $response = $client->search($params);
18 | ----
19 |
--------------------------------------------------------------------------------
/docs/examples/28aad2c5942bfb221c2bf1bbdc01658e.asciidoc:
--------------------------------------------------------------------------------
1 | // query-dsl/query-string-query.asciidoc:316
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'body' => [
7 | 'query' => [
8 | 'query_string' => [
9 | 'fields' => [
10 | 'city.*',
11 | ],
12 | 'query' => 'this AND that OR thus',
13 | ],
14 | ],
15 | ],
16 | ];
17 | $response = $client->search($params);
18 | ----
19 |
--------------------------------------------------------------------------------
/docs/examples/2a1de18774f9c68cafa169847832b2bc.asciidoc:
--------------------------------------------------------------------------------
1 | // query-dsl/term-query.asciidoc:94
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'my_index',
7 | 'body' => [
8 | 'mappings' => [
9 | 'properties' => [
10 | 'full_text' => [
11 | 'type' => 'text',
12 | ],
13 | ],
14 | ],
15 | ],
16 | ];
17 | $response = $client->indices()->create($params);
18 | ----
19 |
--------------------------------------------------------------------------------
/docs/examples/2bb2339ac055337abf753bddb7771659.asciidoc:
--------------------------------------------------------------------------------
1 | // aggregations/bucket/datehistogram-aggregation.asciidoc:232
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'sales',
7 | 'body' => [
8 | 'aggs' => [
9 | 'sales_over_time' => [
10 | 'date_histogram' => [
11 | 'field' => 'date',
12 | 'fixed_interval' => '2w',
13 | ],
14 | ],
15 | ],
16 | ],
17 | ];
18 | $response = $client->search($params);
19 | ----
20 |
--------------------------------------------------------------------------------
/docs/examples/2fd69fb0538e4f36ac69a8b8f8bf5ae8.asciidoc:
--------------------------------------------------------------------------------
1 | // docs/update-by-query.asciidoc:355
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'twitter',
7 | 'body' => [
8 | 'script' => [
9 | 'source' => 'ctx._source.likes++',
10 | 'lang' => 'painless',
11 | ],
12 | 'query' => [
13 | 'term' => [
14 | 'user' => 'kimchy',
15 | ],
16 | ],
17 | ],
18 | ];
19 | $response = $client->updateByQuery($params);
20 | ----
21 |
--------------------------------------------------------------------------------
/docs/examples/311c4b632a29b9ead63b02d01f10096b.asciidoc:
--------------------------------------------------------------------------------
1 | // getting-started.asciidoc:251
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'customer',
7 | 'id' => '1',
8 | 'body' => [
9 | 'name' => 'John Doe',
10 | ],
11 | ];
12 | $response = $client->index($params);
13 | ----
14 |
--------------------------------------------------------------------------------
/docs/examples/3342c69b2c2303247217532956fcce85.asciidoc:
--------------------------------------------------------------------------------
1 | // query-dsl/exists-query.asciidoc:20
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'body' => [
7 | 'query' => [
8 | 'exists' => [
9 | 'field' => 'user',
10 | ],
11 | ],
12 | ],
13 | ];
14 | $response = $client->search($params);
15 | ----
16 |
--------------------------------------------------------------------------------
/docs/examples/33f148e3d8676de6cc52f58749898a13.asciidoc:
--------------------------------------------------------------------------------
1 | // query-dsl/multi-match-query.asciidoc:275
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'body' => [
7 | 'query' => [
8 | 'dis_max' => [
9 | 'queries' => [
10 | [
11 | 'match_phrase_prefix' => [
12 | 'subject' => 'quick brown f',
13 | ],
14 | ],
15 | [
16 | 'match_phrase_prefix' => [
17 | 'message' => 'quick brown f',
18 | ],
19 | ],
20 | ],
21 | ],
22 | ],
23 | ],
24 | ];
25 | $response = $client->search($params);
26 | ----
27 |
--------------------------------------------------------------------------------
/docs/examples/34efeade38445b2834749ced59782e25.asciidoc:
--------------------------------------------------------------------------------
1 | // aggregations/bucket/terms-aggregation.asciidoc:263
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'body' => [
7 | 'aggs' => [
8 | 'genres' => [
9 | 'terms' => [
10 | 'field' => 'genre',
11 | 'order' => [
12 | 'playback_stats.max' => 'desc',
13 | ],
14 | ],
15 | 'aggs' => [
16 | 'playback_stats' => [
17 | 'stats' => [
18 | 'field' => 'play_count',
19 | ],
20 | ],
21 | ],
22 | ],
23 | ],
24 | ],
25 | ];
26 | $response = $client->search($params);
27 | ----
28 |
--------------------------------------------------------------------------------
/docs/examples/35e8da9410b8432cf4095f2541ad7b1d.asciidoc:
--------------------------------------------------------------------------------
1 | // aggregations/bucket/terms-aggregation.asciidoc:162
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'body' => [
7 | 'aggs' => [
8 | 'products' => [
9 | 'terms' => [
10 | 'field' => 'product',
11 | 'size' => 5,
12 | 'show_term_doc_count_error' => true,
13 | ],
14 | ],
15 | ],
16 | ],
17 | ];
18 | $response = $client->search($params);
19 | ----
20 |
--------------------------------------------------------------------------------
/docs/examples/3653567181f43a5f64c74f934aa821c2.asciidoc:
--------------------------------------------------------------------------------
1 | // indices/aliases.asciidoc:186
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'body' => [
7 | 'actions' => [
8 | [
9 | 'remove' => [
10 | 'index' => 'test1',
11 | 'alias' => 'alias1',
12 | ],
13 | ],
14 | ],
15 | ],
16 | ];
17 | $response = $client->indices()->updateAliases($params);
18 | ----
19 |
--------------------------------------------------------------------------------
/docs/examples/36818c6d9f434d387819c30bd9addb14.asciidoc:
--------------------------------------------------------------------------------
1 | // docs/index_.asciidoc:237
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'twitter',
7 | 'body' => [
8 | 'user' => 'kimchy',
9 | 'post_date' => '2009-11-15T14:12:12',
10 | 'message' => 'trying out Elasticsearch',
11 | ],
12 | ];
13 | $response = $client->index($params);
14 | ----
15 |
--------------------------------------------------------------------------------
/docs/examples/36b2778f23d0955255f52c075c4d213d.asciidoc:
--------------------------------------------------------------------------------
1 | // docs/reindex.asciidoc:905
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'body' => [
7 | 'source' => [
8 | 'remote' => [
9 | 'host' => 'http://otherhost:9200',
10 | 'username' => 'user',
11 | 'password' => 'pass',
12 | ],
13 | 'index' => 'source',
14 | 'query' => [
15 | 'match' => [
16 | 'test' => 'data',
17 | ],
18 | ],
19 | ],
20 | 'dest' => [
21 | 'index' => 'dest',
22 | ],
23 | ],
24 | ];
25 | $response = $client->reindex($params);
26 | ----
27 |
--------------------------------------------------------------------------------
/docs/examples/3722cb3705b6bc7f486969deace3dd83.asciidoc:
--------------------------------------------------------------------------------
1 | // aggregations/metrics/valuecount-aggregation.asciidoc:46
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'sales',
7 | 'body' => [
8 | 'aggs' => [
9 | 'type_count' => [
10 | 'value_count' => [
11 | 'script' => [
12 | 'source' => 'doc[\'type\'].value',
13 | ],
14 | ],
15 | ],
16 | ],
17 | ],
18 | ];
19 | $response = $client->search($params);
20 | ----
21 |
--------------------------------------------------------------------------------
/docs/examples/381fced1882ca8337143e6bb180a5715.asciidoc:
--------------------------------------------------------------------------------
1 | // docs/update.asciidoc:84
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'test',
7 | 'id' => '1',
8 | 'body' => [
9 | 'counter' => 1,
10 | 'tags' => [
11 | 'red',
12 | ],
13 | ],
14 | ];
15 | $response = $client->index($params);
16 | ----
17 |
--------------------------------------------------------------------------------
/docs/examples/38c1d0f6668e9563c0827f839f9fa505.asciidoc:
--------------------------------------------------------------------------------
1 | // docs/update.asciidoc:218
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'test',
7 | 'id' => '1',
8 | 'body' => [
9 | 'doc' => [
10 | 'name' => 'new_name',
11 | ],
12 | ],
13 | ];
14 | $response = $client->update($params);
15 | ----
16 |
--------------------------------------------------------------------------------
/docs/examples/39a6a038c4b551022afe83de0523634e.asciidoc:
--------------------------------------------------------------------------------
1 | // aggregations/bucket/datehistogram-aggregation.asciidoc:636
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'sales',
7 | 'body' => [
8 | 'aggs' => [
9 | 'sale_date' => [
10 | 'date_histogram' => [
11 | 'field' => 'date',
12 | 'calendar_interval' => 'year',
13 | 'missing' => '2000/01/01',
14 | ],
15 | ],
16 | ],
17 | ],
18 | ];
19 | $response = $client->search($params);
20 | ----
21 |
--------------------------------------------------------------------------------
/docs/examples/3a700f836d8d5da1b656a876554028aa.asciidoc:
--------------------------------------------------------------------------------
1 | // search/request/scroll.asciidoc:172
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'body' => [
7 | 'scroll_id' => [
8 | 'DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAD4WYm9laVYtZndUQlNsdDcwakFMNjU1QQ==',
9 | 'DnF1ZXJ5VGhlbkZldGNoBQAAAAAAAAABFmtSWWRRWUJrU2o2ZExpSGJCVmQxYUEAAAAAAAAAAxZrUllkUVlCa1NqNmRMaUhiQlZkMWFBAAAAAAAAAAIWa1JZZFFZQmtTajZkTGlIYkJWZDFhQQAAAAAAAAAFFmtSWWRRWUJrU2o2ZExpSGJCVmQxYUEAAAAAAAAABBZrUllkUVlCa1NqNmRMaUhiQlZkMWFB',
10 | ],
11 | ],
12 | ];
13 | $response = $client->clearScroll($params);
14 | ----
15 |
--------------------------------------------------------------------------------
/docs/examples/3ae03ba3b56e5e287953094050766738.asciidoc:
--------------------------------------------------------------------------------
1 | // docs/reindex.asciidoc:237
2 |
3 | [source, php]
4 | ----
5 | $response = $client->indices()->refresh();
6 | $params = [
7 | 'index' => 'new_twitter',
8 | ];
9 | $response = $client->search($params);
10 | ----
11 |
--------------------------------------------------------------------------------
/docs/examples/3b04cc894e6a47d57983484010feac0c.asciidoc:
--------------------------------------------------------------------------------
1 | // docs/reindex.asciidoc:804
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'metricbeat-2016.05.30-1',
7 | 'id' => '1',
8 | ];
9 | $response = $client->get($params);
10 | $params = [
11 | 'index' => 'metricbeat-2016.05.31-1',
12 | 'id' => '1',
13 | ];
14 | $response = $client->get($params);
15 | ----
16 |
--------------------------------------------------------------------------------
/docs/examples/3d1ff6097e2359f927c88c2ccdb36252.asciidoc:
--------------------------------------------------------------------------------
1 | // setup/install/check-running.asciidoc:7
2 |
3 | [source, php]
4 | ----
5 | $response = $client->info();
6 | ----
7 |
--------------------------------------------------------------------------------
/docs/examples/3e573bfabe00f8bfb8bb69aa5820768e.asciidoc:
--------------------------------------------------------------------------------
1 | // docs/delete-by-query.asciidoc:456
2 |
3 | [source, php]
4 | ----
5 | $response = $client->indices()->refresh();
6 | $params = [
7 | 'index' => 'twitter',
8 | 'body' => [
9 | 'query' => [
10 | 'range' => [
11 | 'likes' => [
12 | 'lt' => 10,
13 | ],
14 | ],
15 | ],
16 | ],
17 | ];
18 | $response = $client->search($params);
19 | ----
20 |
--------------------------------------------------------------------------------
/docs/examples/3f3b3e207f79303ce6f86e03e928e062.asciidoc:
--------------------------------------------------------------------------------
1 | // getting-started.asciidoc:290
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'customer',
7 | 'id' => '1',
8 | ];
9 | $response = $client->get($params);
10 | ----
11 |
--------------------------------------------------------------------------------
/docs/examples/400e89eb46ead8e9c9e40f123fd5e590.asciidoc:
--------------------------------------------------------------------------------
1 | // docs/reindex.asciidoc:398
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'body' => [
7 | 'source' => [
8 | 'index' => 'source',
9 | 'size' => 100,
10 | ],
11 | 'dest' => [
12 | 'index' => 'dest',
13 | 'routing' => '=cat',
14 | ],
15 | ],
16 | ];
17 | $response = $client->reindex($params);
18 | ----
19 |
--------------------------------------------------------------------------------
/docs/examples/42744a175125df5be0ef77413bf8f608.asciidoc:
--------------------------------------------------------------------------------
1 | // indices/update-settings.asciidoc:79
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'twitter',
7 | 'body' => [
8 | 'index' => [
9 | 'refresh_interval' => null,
10 | ],
11 | ],
12 | ];
13 | $response = $client->indices()->putSettings($params);
14 | ----
15 |
--------------------------------------------------------------------------------
/docs/examples/427f6b5c5376cbf0f71f242a60ca3d9e.asciidoc:
--------------------------------------------------------------------------------
1 | // indices/aliases.asciidoc:394
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'alias2',
7 | ];
8 | $response = $client->search($params);
9 | ----
10 |
--------------------------------------------------------------------------------
/docs/examples/43af86de5e49aa06070092fffc138208.asciidoc:
--------------------------------------------------------------------------------
1 | // query-dsl/exists-query.asciidoc:56
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'body' => [
7 | 'query' => [
8 | 'bool' => [
9 | 'must_not' => [
10 | 'exists' => [
11 | 'field' => 'user',
12 | ],
13 | ],
14 | ],
15 | ],
16 | ],
17 | ];
18 | $response = $client->search($params);
19 | ----
20 |
--------------------------------------------------------------------------------
/docs/examples/4646764bf09911fee7d58630c72d3137.asciidoc:
--------------------------------------------------------------------------------
1 | // aggregations/bucket/terms-aggregation.asciidoc:444
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'body' => [
7 | 'aggs' => [
8 | 'genres' => [
9 | 'terms' => [
10 | 'script' => [
11 | 'id' => 'my_script',
12 | 'params' => [
13 | 'field' => 'genre',
14 | ],
15 | ],
16 | ],
17 | ],
18 | ],
19 | ],
20 | ];
21 | $response = $client->search($params);
22 | ----
23 |
--------------------------------------------------------------------------------
/docs/examples/46658f00edc4865dfe472a392374cd0f.asciidoc:
--------------------------------------------------------------------------------
1 | // indices/templates.asciidoc:249
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'name' => 'template_1',
7 | ];
8 | $response = $client->indices()->getTemplate($params);
9 | ----
10 |
--------------------------------------------------------------------------------
/docs/examples/46c4b0dfb674825f9579203d41e7f404.asciidoc:
--------------------------------------------------------------------------------
1 | // mapping/types/keyword.asciidoc:20
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'my_index',
7 | 'body' => [
8 | 'mappings' => [
9 | 'properties' => [
10 | 'tags' => [
11 | 'type' => 'keyword',
12 | ],
13 | ],
14 | ],
15 | ],
16 | ];
17 | $response = $client->indices()->create($params);
18 | ----
19 |
--------------------------------------------------------------------------------
/docs/examples/47b5ff897f26e9c943cee5c06034181d.asciidoc:
--------------------------------------------------------------------------------
1 | // docs/delete.asciidoc:75
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'twitter',
7 | 'id' => '1',
8 | ];
9 | $response = $client->delete($params);
10 | ----
11 |
--------------------------------------------------------------------------------
/docs/examples/47bb632c6091ad0cd94bc660bdd309a5.asciidoc:
--------------------------------------------------------------------------------
1 | // getting-started.asciidoc:512
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'bank',
7 | 'body' => [
8 | 'query' => [
9 | 'bool' => [
10 | 'must' => [
11 | [
12 | 'match' => [
13 | 'age' => '40',
14 | ],
15 | ],
16 | ],
17 | 'must_not' => [
18 | [
19 | 'match' => [
20 | 'state' => 'ID',
21 | ],
22 | ],
23 | ],
24 | ],
25 | ],
26 | ],
27 | ];
28 | $response = $client->search($params);
29 | ----
30 |
--------------------------------------------------------------------------------
/docs/examples/4acf902c2598b2558f34f20c1744c433.asciidoc:
--------------------------------------------------------------------------------
1 | // docs/update-by-query.asciidoc:564
2 |
3 | [source, php]
4 | ----
5 | $response = $client->indices()->refresh();
6 | $params = [
7 | 'index' => 'twitter',
8 | ];
9 | $response = $client->search($params);
10 | ----
11 |
--------------------------------------------------------------------------------
/docs/examples/4b90feb9d5d3dbfce424dac0341320b7.asciidoc:
--------------------------------------------------------------------------------
1 | // getting-started.asciidoc:461
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'bank',
7 | 'body' => [
8 | 'query' => [
9 | 'match_all' => [
10 | ],
11 | ],
12 | 'sort' => [
13 | [
14 | 'account_number' => 'asc',
15 | ],
16 | ],
17 | 'from' => 10,
18 | 'size' => 10,
19 | ],
20 | ];
21 | $response = $client->search($params);
22 | ----
23 |
--------------------------------------------------------------------------------
/docs/examples/4cd246e5c4c035a2cd4081ae9a3d54e5.asciidoc:
--------------------------------------------------------------------------------
1 | // docs/update.asciidoc:114
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'test',
7 | 'id' => '1',
8 | 'body' => [
9 | 'script' => [
10 | 'source' => 'ctx._source.tags.add(params.tag)',
11 | 'lang' => 'painless',
12 | 'params' => [
13 | 'tag' => 'blue',
14 | ],
15 | ],
16 | ],
17 | ];
18 | $response = $client->update($params);
19 | ----
20 |
--------------------------------------------------------------------------------
/docs/examples/4d46dbb96125b27f46299547de9d8709.asciidoc:
--------------------------------------------------------------------------------
1 | // indices/create-index.asciidoc:190
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'test',
7 | 'body' => [
8 | 'settings' => [
9 | 'index.write.wait_for_active_shards' => '2',
10 | ],
11 | ],
12 | ];
13 | $response = $client->indices()->create($params);
14 | ----
15 |
--------------------------------------------------------------------------------
/docs/examples/4d56b179242fed59e3d6476f817b6055.asciidoc:
--------------------------------------------------------------------------------
1 | // indices/create-index.asciidoc:143
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'test',
7 | 'body' => [
8 | 'aliases' => [
9 | 'alias_1' => [
10 | ],
11 | 'alias_2' => [
12 | 'filter' => [
13 | 'term' => [
14 | 'user' => 'kimchy',
15 | ],
16 | ],
17 | 'routing' => 'kimchy',
18 | ],
19 | ],
20 | ],
21 | ];
22 | $response = $client->indices()->create($params);
23 | ----
24 |
--------------------------------------------------------------------------------
/docs/examples/5043b83a89091fa00edb341ddf7ba370.asciidoc:
--------------------------------------------------------------------------------
1 | // query-dsl/match-query.asciidoc:219
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'body' => [
7 | 'query' => [
8 | 'match' => [
9 | 'message' => [
10 | 'query' => 'this is a testt',
11 | 'fuzziness' => 'AUTO',
12 | ],
13 | ],
14 | ],
15 | ],
16 | ];
17 | $response = $client->search($params);
18 | ----
19 |
--------------------------------------------------------------------------------
/docs/examples/506844befdc5691d835771bcbb1c1a60.asciidoc:
--------------------------------------------------------------------------------
1 | // getting-started.asciidoc:392
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'bank',
7 | 'body' => [
8 | 'query' => [
9 | 'match_all' => [
10 | ],
11 | ],
12 | 'sort' => [
13 | [
14 | 'account_number' => 'asc',
15 | ],
16 | ],
17 | ],
18 | ];
19 | $response = $client->search($params);
20 | ----
21 |
--------------------------------------------------------------------------------
/docs/examples/527324766814561b75aaee853ede49a7.asciidoc:
--------------------------------------------------------------------------------
1 | // aggregations/bucket/terms-aggregation.asciidoc:369
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'body' => [
7 | 'aggs' => [
8 | 'tags' => [
9 | 'terms' => [
10 | 'field' => 'tags',
11 | 'min_doc_count' => 10,
12 | ],
13 | ],
14 | ],
15 | ],
16 | ];
17 | $response = $client->search($params);
18 | ----
19 |
--------------------------------------------------------------------------------
/docs/examples/5275842787967b6db876025f4a1c6942.asciidoc:
--------------------------------------------------------------------------------
1 | // search/suggesters.asciidoc:127
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'body' => [
7 | 'suggest' => [
8 | 'text' => 'tring out Elasticsearch',
9 | 'my-suggest-1' => [
10 | 'term' => [
11 | 'field' => 'message',
12 | ],
13 | ],
14 | 'my-suggest-2' => [
15 | 'term' => [
16 | 'field' => 'user',
17 | ],
18 | ],
19 | ],
20 | ],
21 | ];
22 | $response = $client->search($params);
23 | ----
24 |
--------------------------------------------------------------------------------
/docs/examples/52a87b81e4e0b6b11e23e85db1602a63.asciidoc:
--------------------------------------------------------------------------------
1 | // docs/update-by-query.asciidoc:307
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'twitter',
7 | 'body' => [
8 | 'query' => [
9 | 'term' => [
10 | 'user' => 'kimchy',
11 | ],
12 | ],
13 | ],
14 | ];
15 | $response = $client->updateByQuery($params);
16 | ----
17 |
--------------------------------------------------------------------------------
/docs/examples/52b2bfbdd78f8283b6f4891c48013237.asciidoc:
--------------------------------------------------------------------------------
1 | // docs/reindex.asciidoc:635
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'body' => [
7 | 'max_docs' => 1,
8 | 'source' => [
9 | 'index' => 'twitter',
10 | ],
11 | 'dest' => [
12 | 'index' => 'new_twitter',
13 | ],
14 | ],
15 | ];
16 | $response = $client->reindex($params);
17 | ----
18 |
--------------------------------------------------------------------------------
/docs/examples/52c7e4172a446c394210a07c464c57d2.asciidoc:
--------------------------------------------------------------------------------
1 | // docs/delete-by-query.asciidoc:579
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'task_id' => 'r1A2WoRbTwKZ516z6NEs5A:36619',
7 | ];
8 | $response = $client->deleteByQueryRethrottle($params);
9 | ----
10 |
--------------------------------------------------------------------------------
/docs/examples/53b908c3432118c5a6e460f74d32006b.asciidoc:
--------------------------------------------------------------------------------
1 | // query-dsl/multi-match-query.asciidoc:11
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'body' => [
7 | 'query' => [
8 | 'multi_match' => [
9 | 'query' => 'this is a test',
10 | 'fields' => [
11 | 'subject',
12 | 'message',
13 | ],
14 | ],
15 | ],
16 | ],
17 | ];
18 | $response = $client->search($params);
19 | ----
20 |
--------------------------------------------------------------------------------
/docs/examples/53d938c754f36a912fcbe6473abb463f.asciidoc:
--------------------------------------------------------------------------------
1 | // indices/put-mapping.asciidoc:473
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'body' => [
7 | 'source' => [
8 | 'index' => 'users',
9 | ],
10 | 'dest' => [
11 | 'index' => 'new_users',
12 | ],
13 | ],
14 | ];
15 | $response = $client->reindex($params);
16 | ----
17 |
--------------------------------------------------------------------------------
/docs/examples/54a770f053f3225ea0d1e34334232411.asciidoc:
--------------------------------------------------------------------------------
1 | // docs/update-by-query.asciidoc:343
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'twitter',
7 | ];
8 | $response = $client->updateByQuery($params);
9 | ----
10 |
--------------------------------------------------------------------------------
/docs/examples/58b5003c0a53a39bf509aa3797aad471.asciidoc:
--------------------------------------------------------------------------------
1 | // query-dsl/query-string-query.asciidoc:352
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'body' => [
7 | 'query' => [
8 | 'query_string' => [
9 | 'fields' => [
10 | 'content',
11 | 'name.*^5',
12 | ],
13 | 'query' => 'this AND that OR thus',
14 | ],
15 | ],
16 | ],
17 | ];
18 | $response = $client->search($params);
19 | ----
20 |
--------------------------------------------------------------------------------
/docs/examples/58df61acbfb15b8ef0aaa18b81ae98a6.asciidoc:
--------------------------------------------------------------------------------
1 | // docs/update.asciidoc:164
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'test',
7 | 'id' => '1',
8 | 'body' => [
9 | 'script' => 'ctx._source.remove(\'new_field\')',
10 | ],
11 | ];
12 | $response = $client->update($params);
13 | ----
14 |
--------------------------------------------------------------------------------
/docs/examples/5925c23a173a63bdb30b458248d1df76.asciidoc:
--------------------------------------------------------------------------------
1 | // api-conventions.asciidoc:416
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'twitter',
7 | ];
8 | $response = $client->indices()->getSettings($params);
9 | ----
10 |
--------------------------------------------------------------------------------
/docs/examples/5b7d6f1db88ca6f42c48fa3dbb4341e8.asciidoc:
--------------------------------------------------------------------------------
1 | // indices/get-mapping.asciidoc:78
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => '*',
7 | ];
8 | $response = $client->indices()->getMapping($params);
9 | $params = [
10 | 'index' => '_all',
11 | ];
12 | $response = $client->indices()->getMapping($params);
13 | $response = $client->indices()->getMapping();
14 | ----
15 |
--------------------------------------------------------------------------------
/docs/examples/5be23858b35043fcb7b50fe36b873e6e.asciidoc:
--------------------------------------------------------------------------------
1 | // indices/put-mapping.asciidoc:13
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'twitter',
7 | 'body' => [
8 | 'properties' => [
9 | 'email' => [
10 | 'type' => 'keyword',
11 | ],
12 | ],
13 | ],
14 | ];
15 | $response = $client->indices()->putMapping($params);
16 | ----
17 |
--------------------------------------------------------------------------------
/docs/examples/5c2f486c27bd5346e512265f93375d16.asciidoc:
--------------------------------------------------------------------------------
1 | // query-dsl/range-query.asciidoc:219
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'body' => [
7 | 'query' => [
8 | 'range' => [
9 | 'timestamp' => [
10 | 'time_zone' => '+01:00',
11 | 'gte' => '2020-01-01T00:00:00',
12 | 'lte' => 'now',
13 | ],
14 | ],
15 | ],
16 | ],
17 | ];
18 | $response = $client->search($params);
19 | ----
20 |
--------------------------------------------------------------------------------
/docs/examples/5d32279dcd52b22d9e1178a02a3ad957.asciidoc:
--------------------------------------------------------------------------------
1 | // search.asciidoc:18
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'twitter',
7 | 'body' => [
8 | 'user' => 'kimchy',
9 | 'post_date' => '2009-11-15T14:12:12',
10 | 'message' => 'trying out Elasticsearch',
11 | ],
12 | ];
13 | $response = $client->index($params);
14 | ----
15 |
--------------------------------------------------------------------------------
/docs/examples/5da6efd5b038ada64c9e853c88c1ec47.asciidoc:
--------------------------------------------------------------------------------
1 | // query-dsl/multi-match-query.asciidoc:113
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'body' => [
7 | 'query' => [
8 | 'multi_match' => [
9 | 'query' => 'brown fox',
10 | 'type' => 'best_fields',
11 | 'fields' => [
12 | 'subject',
13 | 'message',
14 | ],
15 | 'tie_breaker' => 0.3,
16 | ],
17 | ],
18 | ],
19 | ];
20 | $response = $client->search($params);
21 | ----
22 |
--------------------------------------------------------------------------------
/docs/examples/5dd695679b5141d9142d3d30ba8d300a.asciidoc:
--------------------------------------------------------------------------------
1 | // aggregations/metrics/valuecount-aggregation.asciidoc:13
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'sales',
7 | 'body' => [
8 | 'aggs' => [
9 | 'types_count' => [
10 | 'value_count' => [
11 | 'field' => 'type',
12 | ],
13 | ],
14 | ],
15 | ],
16 | ];
17 | $response = $client->search($params);
18 | ----
19 |
--------------------------------------------------------------------------------
/docs/examples/5eabcdbf61bfcb484dc694f25c2bba36.asciidoc:
--------------------------------------------------------------------------------
1 | // docs/get.asciidoc:323
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'twitter',
7 | 'id' => '1',
8 | 'body' => [
9 | 'counter' => 1,
10 | 'tags' => [
11 | 'red',
12 | ],
13 | ],
14 | ];
15 | $response = $client->index($params);
16 | ----
17 |
--------------------------------------------------------------------------------
/docs/examples/5f210f74725ea0c9265190346edfa246.asciidoc:
--------------------------------------------------------------------------------
1 | // indices/aliases.asciidoc:236
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'body' => [
7 | 'actions' => [
8 | [
9 | 'add' => [
10 | 'indices' => [
11 | 'test1',
12 | 'test2',
13 | ],
14 | 'alias' => 'alias1',
15 | ],
16 | ],
17 | ],
18 | ],
19 | ];
20 | $response = $client->indices()->updateAliases($params);
21 | ----
22 |
--------------------------------------------------------------------------------
/docs/examples/5f3549ac7fee94682ca0d7439eebdd2a.asciidoc:
--------------------------------------------------------------------------------
1 | // search/request/sort.asciidoc:211
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'index_long,index_double',
7 | 'body' => [
8 | 'sort' => [
9 | [
10 | 'field' => [
11 | 'numeric_type' => 'date_nanos',
12 | ],
13 | ],
14 | ],
15 | ],
16 | ];
17 | $response = $client->search($params);
18 | ----
19 |
--------------------------------------------------------------------------------
/docs/examples/5f3a3eefeefe6fa85ec49d499212d245.asciidoc:
--------------------------------------------------------------------------------
1 | // indices/put-mapping.asciidoc:262
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'my_index',
7 | 'body' => [
8 | 'properties' => [
9 | 'city' => [
10 | 'type' => 'text',
11 | 'fields' => [
12 | 'raw' => [
13 | 'type' => 'keyword',
14 | ],
15 | ],
16 | ],
17 | ],
18 | ],
19 | ];
20 | $response = $client->indices()->putMapping($params);
21 | ----
22 |
--------------------------------------------------------------------------------
/docs/examples/609260ad1d5998be2ca09ff1fe237efa.asciidoc:
--------------------------------------------------------------------------------
1 | // mapping.asciidoc:217
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'my-index',
7 | ];
8 | $response = $client->indices()->getMapping($params);
9 | ----
10 |
--------------------------------------------------------------------------------
/docs/examples/60ee33f3acfdd0fe6f288ac77312c780.asciidoc:
--------------------------------------------------------------------------------
1 | // query-dsl/query-string-query.asciidoc:446
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'body' => [
7 | 'query' => [
8 | 'query_string' => [
9 | 'fields' => [
10 | 'title',
11 | ],
12 | 'query' => 'this that thus',
13 | 'minimum_should_match' => 2,
14 | ],
15 | ],
16 | ],
17 | ];
18 | $response = $client->search($params);
19 | ----
20 |
--------------------------------------------------------------------------------
/docs/examples/6138d6919f3cbaaf61e1092f817d295c.asciidoc:
--------------------------------------------------------------------------------
1 | // query-dsl/match-query.asciidoc:175
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'body' => [
7 | 'query' => [
8 | 'match' => [
9 | 'message' => [
10 | 'query' => 'this is a test',
11 | 'operator' => 'and',
12 | ],
13 | ],
14 | ],
15 | ],
16 | ];
17 | $response = $client->search($params);
18 | ----
19 |
--------------------------------------------------------------------------------
/docs/examples/618d5f3d35921d8cb7e9ccfbe9a4c3e3.asciidoc:
--------------------------------------------------------------------------------
1 | // query-dsl/regexp-query.asciidoc:23
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'body' => [
7 | 'query' => [
8 | 'regexp' => [
9 | 'user' => [
10 | 'value' => 'k.*y',
11 | 'flags' => 'ALL',
12 | 'max_determinized_states' => 10000,
13 | 'rewrite' => 'constant_score',
14 | ],
15 | ],
16 | ],
17 | ],
18 | ];
19 | $response = $client->search($params);
20 | ----
21 |
--------------------------------------------------------------------------------
/docs/examples/621665fdbd7fc103c09bfeed28b67b1a.asciidoc:
--------------------------------------------------------------------------------
1 | // api-conventions.asciidoc:307
2 |
3 | [source, php]
4 | ----
5 | $response = $client->count();
6 | ----
7 |
--------------------------------------------------------------------------------
/docs/examples/625dc94df1f9affb49a082fd99d41620.asciidoc:
--------------------------------------------------------------------------------
1 | // docs/index_.asciidoc:286
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'twitter',
7 | 'body' => [
8 | 'user' => 'kimchy',
9 | 'post_date' => '2009-11-15T14:12:12',
10 | 'message' => 'trying out Elasticsearch',
11 | ],
12 | ];
13 | $response = $client->index($params);
14 | ----
15 |
--------------------------------------------------------------------------------
/docs/examples/626f8c4b3e2cd3d9beaa63a7f5799d7a.asciidoc:
--------------------------------------------------------------------------------
1 | // search/suggesters.asciidoc:8
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'twitter',
7 | 'body' => [
8 | 'query' => [
9 | 'match' => [
10 | 'message' => 'tring out Elasticsearch',
11 | ],
12 | ],
13 | 'suggest' => [
14 | 'my-suggestion' => [
15 | 'text' => 'tring out Elasticsearch',
16 | 'term' => [
17 | 'field' => 'message',
18 | ],
19 | ],
20 | ],
21 | ],
22 | ];
23 | $response = $client->search($params);
24 | ----
25 |
--------------------------------------------------------------------------------
/docs/examples/645796e8047967ca4a7635a22a876f4c.asciidoc:
--------------------------------------------------------------------------------
1 | // getting-started.asciidoc:691
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'bank',
7 | 'body' => [
8 | 'size' => 0,
9 | 'aggs' => [
10 | 'group_by_state' => [
11 | 'terms' => [
12 | 'field' => 'state.keyword',
13 | 'order' => [
14 | 'average_balance' => 'desc',
15 | ],
16 | ],
17 | 'aggs' => [
18 | 'average_balance' => [
19 | 'avg' => [
20 | 'field' => 'balance',
21 | ],
22 | ],
23 | ],
24 | ],
25 | ],
26 | ],
27 | ];
28 | $response = $client->search($params);
29 | ----
30 |
--------------------------------------------------------------------------------
/docs/examples/645c4c6e209719d3a4d25b1a629cb23b.asciidoc:
--------------------------------------------------------------------------------
1 | // query-dsl/function-score-query.asciidoc:241
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'body' => [
7 | 'query' => [
8 | 'function_score' => [
9 | 'random_score' => [
10 | 'seed' => 10,
11 | 'field' => '_seq_no',
12 | ],
13 | ],
14 | ],
15 | ],
16 | ];
17 | $response = $client->search($params);
18 | ----
19 |
--------------------------------------------------------------------------------
/docs/examples/6464124d1677f4552ddddd95a340ca3a.asciidoc:
--------------------------------------------------------------------------------
1 | // api-conventions.asciidoc:353
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'library',
7 | 'body' => [
8 | 'title' => 'Book #1',
9 | 'rating' => 200.1,
10 | ],
11 | ];
12 | $response = $client->index($params);
13 | $params = [
14 | 'index' => 'library',
15 | 'body' => [
16 | 'title' => 'Book #2',
17 | 'rating' => 1.7,
18 | ],
19 | ];
20 | $response = $client->index($params);
21 | $params = [
22 | 'index' => 'library',
23 | 'body' => [
24 | 'title' => 'Book #3',
25 | 'rating' => 0.1,
26 | ],
27 | ];
28 | $response = $client->index($params);
29 | $response = $client->search();
30 | ----
31 |
--------------------------------------------------------------------------------
/docs/examples/64b9baa6d7556b960b29698f3383aa31.asciidoc:
--------------------------------------------------------------------------------
1 | // docs/reindex.asciidoc:971
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'body' => [
7 | 'source' => [
8 | 'remote' => [
9 | 'host' => 'http://otherhost:9200',
10 | ],
11 | 'index' => 'source',
12 | 'size' => 10,
13 | 'query' => [
14 | 'match' => [
15 | 'test' => 'data',
16 | ],
17 | ],
18 | ],
19 | 'dest' => [
20 | 'index' => 'dest',
21 | ],
22 | ],
23 | ];
24 | $response = $client->reindex($params);
25 | ----
26 |
--------------------------------------------------------------------------------
/docs/examples/6799d132c1c7ca3970763acde2337ef9.asciidoc:
--------------------------------------------------------------------------------
1 | // indices/aliases.asciidoc:253
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'body' => [
7 | 'actions' => [
8 | [
9 | 'add' => [
10 | 'index' => 'test*',
11 | 'alias' => 'all_test_indices',
12 | ],
13 | ],
14 | ],
15 | ],
16 | ];
17 | $response = $client->indices()->updateAliases($params);
18 | ----
19 |
--------------------------------------------------------------------------------
/docs/examples/67bba546d835bca8f31df13e3587c348.asciidoc:
--------------------------------------------------------------------------------
1 | // indices/aliases.asciidoc:453
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'test',
7 | 'id' => '1',
8 | ];
9 | $response = $client->get($params);
10 | ----
11 |
--------------------------------------------------------------------------------
/docs/examples/67ceac4bf2d9ac7cc500390544cdcb41.asciidoc:
--------------------------------------------------------------------------------
1 | // query-dsl/range-query.asciidoc:157
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'body' => [
7 | 'query' => [
8 | 'range' => [
9 | 'timestamp' => [
10 | 'gte' => 'now-1d/d',
11 | 'lt' => 'now/d',
12 | ],
13 | ],
14 | ],
15 | ],
16 | ];
17 | $response = $client->search($params);
18 | ----
19 |
--------------------------------------------------------------------------------
/docs/examples/68721288dc9ad8aa1b55099b4d303051.asciidoc:
--------------------------------------------------------------------------------
1 | // query-dsl/multi-match-query.asciidoc:524
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'body' => [
7 | 'query' => [
8 | 'multi_match' => [
9 | 'query' => 'quick brown f',
10 | 'type' => 'bool_prefix',
11 | 'fields' => [
12 | 'subject',
13 | 'message',
14 | ],
15 | ],
16 | ],
17 | ],
18 | ];
19 | $response = $client->search($params);
20 | ----
21 |
--------------------------------------------------------------------------------
/docs/examples/68738b4fd0dda177022be45be95b4c84.asciidoc:
--------------------------------------------------------------------------------
1 | // docs/reindex.asciidoc:174
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'task_id' => 'r1A2WoRbTwKZ516z6NEs5A:36619',
7 | ];
8 | $response = $client->reindexRethrottle($params);
9 | ----
10 |
--------------------------------------------------------------------------------
/docs/examples/69a7be47f85138b10437113ab2f0d72d.asciidoc:
--------------------------------------------------------------------------------
1 | // docs/get.asciidoc:376
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'twitter',
7 | 'id' => '2',
8 | ];
9 | $response = $client->get($params);
10 | ----
11 |
--------------------------------------------------------------------------------
/docs/examples/6a1702dd50690cae833572e48a0ddf25.asciidoc:
--------------------------------------------------------------------------------
1 | // query-dsl/multi-match-query.asciidoc:33
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'body' => [
7 | 'query' => [
8 | 'multi_match' => [
9 | 'query' => 'Will Smith',
10 | 'fields' => [
11 | 'title',
12 | '*_name',
13 | ],
14 | ],
15 | ],
16 | ],
17 | ];
18 | $response = $client->search($params);
19 | ----
20 |
--------------------------------------------------------------------------------
/docs/examples/6a4679531e64c492fce16dc12de6dcb0.asciidoc:
--------------------------------------------------------------------------------
1 | // aggregations/bucket/terms-aggregation.asciidoc:207
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'body' => [
7 | 'aggs' => [
8 | 'genres' => [
9 | 'terms' => [
10 | 'field' => 'genre',
11 | 'order' => [
12 | '_count' => 'asc',
13 | ],
14 | ],
15 | ],
16 | ],
17 | ],
18 | ];
19 | $response = $client->search($params);
20 | ----
21 |
--------------------------------------------------------------------------------
/docs/examples/6a81d00f0d73bc5985e76b3cadab645e.asciidoc:
--------------------------------------------------------------------------------
1 | // mapping/params/fielddata.asciidoc:117
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'my_index',
7 | 'body' => [
8 | 'mappings' => [
9 | 'properties' => [
10 | 'tag' => [
11 | 'type' => 'text',
12 | 'fielddata' => true,
13 | 'fielddata_frequency_filter' => [
14 | 'min' => 0.001,
15 | 'max' => 0.1,
16 | 'min_segment_size' => 500,
17 | ],
18 | ],
19 | ],
20 | ],
21 | ],
22 | ];
23 | $response = $client->indices()->create($params);
24 | ----
25 |
--------------------------------------------------------------------------------
/docs/examples/6bbc613bd4f9aec1bbdbabf5db021d28.asciidoc:
--------------------------------------------------------------------------------
1 | // query-dsl/multi-match-query.asciidoc:228
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'body' => [
7 | 'query' => [
8 | 'bool' => [
9 | 'should' => [
10 | [
11 | 'match' => [
12 | 'title' => 'quick brown fox',
13 | ],
14 | ],
15 | [
16 | 'match' => [
17 | 'title.original' => 'quick brown fox',
18 | ],
19 | ],
20 | [
21 | 'match' => [
22 | 'title.shingles' => 'quick brown fox',
23 | ],
24 | ],
25 | ],
26 | ],
27 | ],
28 | ],
29 | ];
30 | $response = $client->search($params);
31 | ----
32 |
--------------------------------------------------------------------------------
/docs/examples/6bf63f2ec6ba55fcaf1092f48212bf25.asciidoc:
--------------------------------------------------------------------------------
1 | // indices/put-mapping.asciidoc:527
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'my_index',
7 | 'body' => [
8 | 'mappings' => [
9 | 'properties' => [
10 | 'user_identifier' => [
11 | 'type' => 'keyword',
12 | ],
13 | ],
14 | ],
15 | ],
16 | ];
17 | $response = $client->indices()->create($params);
18 | ----
19 |
--------------------------------------------------------------------------------
/docs/examples/6d1e75312a28a5ba23837abf768f2510.asciidoc:
--------------------------------------------------------------------------------
1 | // api-conventions.asciidoc:612
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'twitter',
7 | ];
8 | $response = $client->search($params);
9 | ----
10 |
--------------------------------------------------------------------------------
/docs/examples/6f097c298a7abf4c032c4314920c49c8.asciidoc:
--------------------------------------------------------------------------------
1 | // docs/reindex.asciidoc:657
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'body' => [
7 | 'source' => [
8 | 'index' => [
9 | 'twitter',
10 | 'blog',
11 | ],
12 | ],
13 | 'dest' => [
14 | 'index' => 'all_together',
15 | ],
16 | ],
17 | ];
18 | $response = $client->reindex($params);
19 | ----
20 |
--------------------------------------------------------------------------------
/docs/examples/6f21a878fee3b43c5332b81aaddbeac7.asciidoc:
--------------------------------------------------------------------------------
1 | // query-dsl/query-string-query.asciidoc:528
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'body' => [
7 | 'query' => [
8 | 'query_string' => [
9 | 'fields' => [
10 | 'title',
11 | 'content',
12 | ],
13 | 'query' => 'this OR that OR thus',
14 | 'type' => 'cross_fields',
15 | 'minimum_should_match' => 2,
16 | ],
17 | ],
18 | ],
19 | ];
20 | $response = $client->search($params);
21 | ----
22 |
--------------------------------------------------------------------------------
/docs/examples/6faf10a73f7d5fffbcb037bdb2cbaff8.asciidoc:
--------------------------------------------------------------------------------
1 | // aggregations/bucket/datehistogram-aggregation.asciidoc:669
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'sales',
7 | 'body' => [
8 | 'aggs' => [
9 | 'dayOfWeek' => [
10 | 'terms' => [
11 | 'script' => [
12 | 'lang' => 'painless',
13 | 'source' => 'doc[\'date\'].value.dayOfWeekEnum.value',
14 | ],
15 | ],
16 | ],
17 | ],
18 | ],
19 | ];
20 | $response = $client->search($params);
21 | ----
22 |
--------------------------------------------------------------------------------
/docs/examples/70f0aa5853697e265ef3b1df72940951.asciidoc:
--------------------------------------------------------------------------------
1 | // aggregations/bucket/datehistogram-aggregation.asciidoc:380
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'my_index',
7 | 'id' => '1',
8 | 'body' => [
9 | 'date' => '2015-10-01T00:30:00Z',
10 | ],
11 | ];
12 | $response = $client->index($params);
13 | $params = [
14 | 'index' => 'my_index',
15 | 'id' => '2',
16 | 'body' => [
17 | 'date' => '2015-10-01T01:30:00Z',
18 | ],
19 | ];
20 | $response = $client->index($params);
21 | $params = [
22 | 'index' => 'my_index',
23 | 'body' => [
24 | 'aggs' => [
25 | 'by_day' => [
26 | 'date_histogram' => [
27 | 'field' => 'date',
28 | 'calendar_interval' => 'day',
29 | ],
30 | ],
31 | ],
32 | ],
33 | ];
34 | $response = $client->search($params);
35 | ----
36 |
--------------------------------------------------------------------------------
/docs/examples/710c7871f20f176d51209b1574b0d61b.asciidoc:
--------------------------------------------------------------------------------
1 | // docs/get.asciidoc:335
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'twitter',
7 | 'id' => '1',
8 | ];
9 | $response = $client->get($params);
10 | ----
11 |
--------------------------------------------------------------------------------
/docs/examples/71b5b2ba9557d0f296ff2de91727d2f6.asciidoc:
--------------------------------------------------------------------------------
1 | // aggregations/bucket/terms-aggregation.asciidoc:243
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'body' => [
7 | 'aggs' => [
8 | 'genres' => [
9 | 'terms' => [
10 | 'field' => 'genre',
11 | 'order' => [
12 | 'max_play_count' => 'desc',
13 | ],
14 | ],
15 | 'aggs' => [
16 | 'max_play_count' => [
17 | 'max' => [
18 | 'field' => 'play_count',
19 | ],
20 | ],
21 | ],
22 | ],
23 | ],
24 | ],
25 | ];
26 | $response = $client->search($params);
27 | ----
28 |
--------------------------------------------------------------------------------
/docs/examples/71ba9033107882f61cdc3b32fc73568d.asciidoc:
--------------------------------------------------------------------------------
1 | // mapping.asciidoc:176
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'my-index',
7 | 'body' => [
8 | 'properties' => [
9 | 'employee-id' => [
10 | 'type' => 'keyword',
11 | 'index' => false,
12 | ],
13 | ],
14 | ],
15 | ];
16 | $response = $client->indices()->putMapping($params);
17 | ----
18 |
--------------------------------------------------------------------------------
/docs/examples/72231b7debac60c95b9869a97dafda3a.asciidoc:
--------------------------------------------------------------------------------
1 | // query-dsl/match-phrase-query.asciidoc:30
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'body' => [
7 | 'query' => [
8 | 'match_phrase' => [
9 | 'message' => [
10 | 'query' => 'this is a test',
11 | 'analyzer' => 'my_analyzer',
12 | ],
13 | ],
14 | ],
15 | ],
16 | ];
17 | $response = $client->search($params);
18 | ----
19 |
--------------------------------------------------------------------------------
/docs/examples/72beebe779a258c225dee7b023e60c52.asciidoc:
--------------------------------------------------------------------------------
1 | // search/request/scroll.asciidoc:148
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'metric' => 'indices',
7 | 'index_metric' => 'search',
8 | ];
9 | $response = $client->nodes()->stats($params);
10 | ----
11 |
--------------------------------------------------------------------------------
/docs/examples/734c2e2a1e45b84f1e4e65b51356fcd7.asciidoc:
--------------------------------------------------------------------------------
1 | // indices/put-mapping.asciidoc:454
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'new_users',
7 | 'body' => [
8 | 'mappings' => [
9 | 'properties' => [
10 | 'user_id' => [
11 | 'type' => 'keyword',
12 | ],
13 | ],
14 | ],
15 | ],
16 | ];
17 | $response = $client->indices()->create($params);
18 | ----
19 |
--------------------------------------------------------------------------------
/docs/examples/73e5c88ad1488b213fb278ee1cb42289.asciidoc:
--------------------------------------------------------------------------------
1 | // aggregations/bucket/datehistogram-aggregation.asciidoc:138
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'sales',
7 | 'body' => [
8 | 'aggs' => [
9 | 'sales_over_time' => [
10 | 'date_histogram' => [
11 | 'field' => 'date',
12 | 'calendar_interval' => '2d',
13 | ],
14 | ],
15 | ],
16 | ],
17 | ];
18 | $response = $client->search($params);
19 | ----
20 |
--------------------------------------------------------------------------------
/docs/examples/745f9b8cdb8e91073f6e520e1d9f8c05.asciidoc:
--------------------------------------------------------------------------------
1 | // docs/get.asciidoc:73
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'twitter',
7 | 'id' => '0',
8 | ];
9 | $response = $client->get($params);
10 | ----
11 |
--------------------------------------------------------------------------------
/docs/examples/7477671958734843dd67cf0b8e6c7515.asciidoc:
--------------------------------------------------------------------------------
1 | // search/request/sort.asciidoc:192
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'index_long',
7 | 'body' => [
8 | 'mappings' => [
9 | 'properties' => [
10 | 'field' => [
11 | 'type' => 'date_nanos',
12 | ],
13 | ],
14 | ],
15 | ],
16 | ];
17 | $response = $client->indices()->create($params);
18 | ----
19 |
--------------------------------------------------------------------------------
/docs/examples/75330ec1305d2beb0e2f34d2195464e2.asciidoc:
--------------------------------------------------------------------------------
1 | // query-dsl/match-all-query.asciidoc:23
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'body' => [
7 | 'query' => [
8 | 'match_all' => [
9 | 'boost' => 1.2,
10 | ],
11 | ],
12 | ],
13 | ];
14 | $response = $client->search($params);
15 | ----
16 |
--------------------------------------------------------------------------------
/docs/examples/764f9884b370cbdc82a1c5c42ed40ff3.asciidoc:
--------------------------------------------------------------------------------
1 | // docs/reindex.asciidoc:609
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'body' => [
7 | 'source' => [
8 | 'index' => 'twitter',
9 | 'query' => [
10 | 'term' => [
11 | 'user' => 'kimchy',
12 | ],
13 | ],
14 | ],
15 | 'dest' => [
16 | 'index' => 'new_twitter',
17 | ],
18 | ],
19 | ];
20 | $response = $client->reindex($params);
21 | ----
22 |
--------------------------------------------------------------------------------
/docs/examples/77243bbf92f2a55e0fca6c2a349a1c15.asciidoc:
--------------------------------------------------------------------------------
1 | // search/request/sort.asciidoc:539
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'body' => [
7 | 'sort' => [
8 | [
9 | '_geo_distance' => [
10 | 'pin.location' => [
11 | [
12 | -70,
13 | 40,
14 | ],
15 | [
16 | -71,
17 | 42,
18 | ],
19 | ],
20 | 'order' => 'asc',
21 | 'unit' => 'km',
22 | ],
23 | ],
24 | ],
25 | 'query' => [
26 | 'term' => [
27 | 'user' => 'kimchy',
28 | ],
29 | ],
30 | ],
31 | ];
32 | $response = $client->search($params);
33 | ----
34 |
--------------------------------------------------------------------------------
/docs/examples/774d715155cd13713e6e327adf6ce328.asciidoc:
--------------------------------------------------------------------------------
1 | // aggregations/bucket/terms-aggregation.asciidoc:723
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'body' => [
7 | 'aggs' => [
8 | 'tags' => [
9 | 'terms' => [
10 | 'field' => 'tags',
11 | 'execution_hint' => 'map',
12 | ],
13 | ],
14 | ],
15 | ],
16 | ];
17 | $response = $client->search($params);
18 | ----
19 |
--------------------------------------------------------------------------------
/docs/examples/78c96113ae4ed0054e581b17542528a7.asciidoc:
--------------------------------------------------------------------------------
1 | // docs/reindex.asciidoc:373
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'body' => [
7 | 'source' => [
8 | 'index' => 'source',
9 | 'query' => [
10 | 'match' => [
11 | 'company' => 'cat',
12 | ],
13 | ],
14 | ],
15 | 'dest' => [
16 | 'index' => 'dest',
17 | 'routing' => '=cat',
18 | ],
19 | ],
20 | ];
21 | $response = $client->reindex($params);
22 | ----
23 |
--------------------------------------------------------------------------------
/docs/examples/7b908b1189f076942de8cd497ff1fa59.asciidoc:
--------------------------------------------------------------------------------
1 | // query-dsl/multi-match-query.asciidoc:212
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'body' => [
7 | 'query' => [
8 | 'multi_match' => [
9 | 'query' => 'quick brown fox',
10 | 'type' => 'most_fields',
11 | 'fields' => [
12 | 'title',
13 | 'title.original',
14 | 'title.shingles',
15 | ],
16 | ],
17 | ],
18 | ],
19 | ];
20 | $response = $client->search($params);
21 | ----
22 |
--------------------------------------------------------------------------------
/docs/examples/7cac05cb589f1614fd5b8589153bef06.asciidoc:
--------------------------------------------------------------------------------
1 | // docs/update.asciidoc:325
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'test',
7 | 'id' => '1',
8 | 'body' => [
9 | 'doc' => [
10 | 'name' => 'new_name',
11 | ],
12 | 'doc_as_upsert' => true,
13 | ],
14 | ];
15 | $response = $client->update($params);
16 | ----
17 |
--------------------------------------------------------------------------------
/docs/examples/7cf71671859be7c1ecf673396db377cd.asciidoc:
--------------------------------------------------------------------------------
1 | // indices/aliases.asciidoc:320
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'body' => [
7 | 'actions' => [
8 | [
9 | 'add' => [
10 | 'index' => 'test1',
11 | 'alias' => 'alias2',
12 | 'filter' => [
13 | 'term' => [
14 | 'user' => 'kimchy',
15 | ],
16 | ],
17 | ],
18 | ],
19 | ],
20 | ],
21 | ];
22 | $response = $client->indices()->updateAliases($params);
23 | ----
24 |
--------------------------------------------------------------------------------
/docs/examples/7df191cc7f814e410a4ac7261065e6ef.asciidoc:
--------------------------------------------------------------------------------
1 | // docs/update-by-query.asciidoc:420
2 |
3 | [source, php]
4 | ----
5 | $response = $client->tasks()->list();
6 | ----
7 |
--------------------------------------------------------------------------------
/docs/examples/7e52bec09624cf6c0de5d13f2bfad5a5.asciidoc:
--------------------------------------------------------------------------------
1 | // search/request/scroll.asciidoc:45
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'twitter',
7 | 'body' => [
8 | 'size' => 100,
9 | 'query' => [
10 | 'match' => [
11 | 'title' => 'elasticsearch',
12 | ],
13 | ],
14 | ],
15 | ];
16 | $response = $client->search($params);
17 | ----
18 |
--------------------------------------------------------------------------------
/docs/examples/7f28f8ae8fcdbd807dadde0b5b007a6d.asciidoc:
--------------------------------------------------------------------------------
1 | // aggregations/bucket/terms-aggregation.asciidoc:641
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'body' => [
7 | 'aggs' => [
8 | 'actors' => [
9 | 'terms' => [
10 | 'field' => 'actors',
11 | 'size' => 10,
12 | ],
13 | 'aggs' => [
14 | 'costars' => [
15 | 'terms' => [
16 | 'field' => 'actors',
17 | 'size' => 5,
18 | ],
19 | ],
20 | ],
21 | ],
22 | ],
23 | ],
24 | ];
25 | $response = $client->search($params);
26 | ----
27 |
--------------------------------------------------------------------------------
/docs/examples/7f465b7e8ed42df6c42251b4481e699e.asciidoc:
--------------------------------------------------------------------------------
1 | // mapping/params/format.asciidoc:13
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'my_index',
7 | 'body' => [
8 | 'mappings' => [
9 | 'properties' => [
10 | 'date' => [
11 | 'type' => 'date',
12 | 'format' => 'yyyy-MM-dd',
13 | ],
14 | ],
15 | ],
16 | ],
17 | ];
18 | $response = $client->indices()->create($params);
19 | ----
20 |
--------------------------------------------------------------------------------
/docs/examples/7f56755fb6c42f7e6203339a6d0cb6e6.asciidoc:
--------------------------------------------------------------------------------
1 | // query-dsl/match-query.asciidoc:268
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'body' => [
7 | 'query' => [
8 | 'match' => [
9 | 'message' => [
10 | 'query' => 'ny city',
11 | 'auto_generate_synonyms_phrase_query' => false,
12 | ],
13 | ],
14 | ],
15 | ],
16 | ];
17 | $response = $client->search($params);
18 | ----
19 |
--------------------------------------------------------------------------------
/docs/examples/7f697eb436dfa3c30dfe610d8c32d132.asciidoc:
--------------------------------------------------------------------------------
1 | // docs/reindex.asciidoc:1002
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'body' => [
7 | 'source' => [
8 | 'remote' => [
9 | 'host' => 'http://otherhost:9200',
10 | 'socket_timeout' => '1m',
11 | 'connect_timeout' => '10s',
12 | ],
13 | 'index' => 'source',
14 | 'query' => [
15 | 'match' => [
16 | 'test' => 'data',
17 | ],
18 | ],
19 | ],
20 | 'dest' => [
21 | 'index' => 'dest',
22 | ],
23 | ],
24 | ];
25 | $response = $client->reindex($params);
26 | ----
27 |
--------------------------------------------------------------------------------
/docs/examples/804a97ff4d0613e6568e4efb19c52021.asciidoc:
--------------------------------------------------------------------------------
1 | // docs/index_.asciidoc:188
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'body' => [
7 | 'persistent' => [
8 | 'action.auto_create_index' => 'twitter,index10,-index1*,+ind*',
9 | ],
10 | ],
11 | ];
12 | $response = $client->cluster()->putSettings($params);
13 | $params = [
14 | 'body' => [
15 | 'persistent' => [
16 | 'action.auto_create_index' => 'false',
17 | ],
18 | ],
19 | ];
20 | $response = $client->cluster()->putSettings($params);
21 | $params = [
22 | 'body' => [
23 | 'persistent' => [
24 | 'action.auto_create_index' => 'true',
25 | ],
26 | ],
27 | ];
28 | $response = $client->cluster()->putSettings($params);
29 | ----
30 |
--------------------------------------------------------------------------------
/docs/examples/81c9aa2678d6166a9662ddf2c011a6a5.asciidoc:
--------------------------------------------------------------------------------
1 | // query-dsl/match-all-query.asciidoc:39
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'body' => [
7 | 'query' => [
8 | 'match_none' => [
9 | ],
10 | ],
11 | ],
12 | ];
13 | $response = $client->search($params);
14 | ----
15 |
--------------------------------------------------------------------------------
/docs/examples/83f95657beca9bf5d8264c80c7fb463f.asciidoc:
--------------------------------------------------------------------------------
1 | // query-dsl/match-phrase-query.asciidoc:11
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'body' => [
7 | 'query' => [
8 | 'match_phrase' => [
9 | 'message' => 'this is a test',
10 | ],
11 | ],
12 | ],
13 | ];
14 | $response = $client->search($params);
15 | ----
16 |
--------------------------------------------------------------------------------
/docs/examples/8653e76676de5d327201b77512afa3a0.asciidoc:
--------------------------------------------------------------------------------
1 | // indices/update-settings.asciidoc:13
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'twitter',
7 | 'body' => [
8 | 'index' => [
9 | 'number_of_replicas' => 2,
10 | ],
11 | ],
12 | ];
13 | $response = $client->indices()->putSettings($params);
14 | ----
15 |
--------------------------------------------------------------------------------
/docs/examples/8871b8fcb6de4f0c7dff22798fb10fb7.asciidoc:
--------------------------------------------------------------------------------
1 | // docs/reindex.asciidoc:850
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'body' => [
7 | 'source' => [
8 | 'index' => 'twitter',
9 | ],
10 | 'dest' => [
11 | 'index' => 'new_twitter',
12 | 'version_type' => 'external',
13 | ],
14 | 'script' => [
15 | 'source' => 'if (ctx._source.foo == \'bar\') {ctx._version++; ctx._source.remove(\'foo\')}',
16 | 'lang' => 'painless',
17 | ],
18 | ],
19 | ];
20 | $response = $client->reindex($params);
21 | ----
22 |
--------------------------------------------------------------------------------
/docs/examples/899eef71a67a1b2aa11a2166ec7f48f1.asciidoc:
--------------------------------------------------------------------------------
1 | // search/request/sort.asciidoc:369
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'body' => [
7 | 'sort' => [
8 | [
9 | 'price' => [
10 | 'unmapped_type' => 'long',
11 | ],
12 | ],
13 | ],
14 | 'query' => [
15 | 'term' => [
16 | 'product' => 'chocolate',
17 | ],
18 | ],
19 | ],
20 | ];
21 | $response = $client->search($params);
22 | ----
23 |
--------------------------------------------------------------------------------
/docs/examples/89a8ac1509936acc272fc2d72907bc45.asciidoc:
--------------------------------------------------------------------------------
1 | // docs/get.asciidoc:269
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'twitter',
7 | 'id' => '1',
8 | ];
9 | $response = $client->getSource($params);
10 | ----
11 |
--------------------------------------------------------------------------------
/docs/examples/8a355eb25d2a01ba62dc1a22dd46f46f.asciidoc:
--------------------------------------------------------------------------------
1 | // aggregations/bucket/datehistogram-aggregation.asciidoc:303
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'sales',
7 | 'body' => [
8 | 'aggs' => [
9 | 'sales_over_time' => [
10 | 'date_histogram' => [
11 | 'field' => 'date',
12 | 'calendar_interval' => '1M',
13 | 'format' => 'yyyy-MM-dd',
14 | ],
15 | ],
16 | ],
17 | ],
18 | ];
19 | $response = $client->search($params);
20 | ----
21 |
--------------------------------------------------------------------------------
/docs/examples/8acc1d67b152e7027e0f0e1a8b4b2431.asciidoc:
--------------------------------------------------------------------------------
1 | // search.asciidoc:32
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'twitter',
7 | 'body' => [
8 | 'query' => [
9 | 'bool' => [
10 | 'must' => [
11 | 'query_string' => [
12 | 'query' => 'some query string here',
13 | ],
14 | ],
15 | 'filter' => [
16 | 'term' => [
17 | 'user' => 'kimchy',
18 | ],
19 | ],
20 | ],
21 | ],
22 | ],
23 | ];
24 | $response = $client->search($params);
25 | ----
26 |
--------------------------------------------------------------------------------
/docs/examples/8baccd8688a6bad1749b8935f9601ea4.asciidoc:
--------------------------------------------------------------------------------
1 | // mapping/types/nested.asciidoc:22
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'my_index',
7 | 'id' => '1',
8 | 'body' => [
9 | 'group' => 'fans',
10 | 'user' => [
11 | [
12 | 'first' => 'John',
13 | 'last' => 'Smith',
14 | ],
15 | [
16 | 'first' => 'Alice',
17 | 'last' => 'White',
18 | ],
19 | ],
20 | ],
21 | ];
22 | $response = $client->index($params);
23 | ----
24 |
--------------------------------------------------------------------------------
/docs/examples/8c5977410335d58217e0626618ce6641.asciidoc:
--------------------------------------------------------------------------------
1 | // query-dsl/terms-query.asciidoc:160
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'my_index',
7 | 'id' => '2',
8 | 'body' => [
9 | 'color' => 'blue',
10 | ],
11 | ];
12 | $response = $client->index($params);
13 | ----
14 |
--------------------------------------------------------------------------------
/docs/examples/8d9a63d7c31f08bd27d92ece3de1649c.asciidoc:
--------------------------------------------------------------------------------
1 | // mapping/fields/id-field.asciidoc:12
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'my_index',
7 | 'id' => '1',
8 | 'body' => [
9 | 'text' => 'Document with ID 1',
10 | ],
11 | ];
12 | $response = $client->index($params);
13 | $params = [
14 | 'index' => 'my_index',
15 | 'id' => '2',
16 | 'body' => [
17 | 'text' => 'Document with ID 2',
18 | ],
19 | ];
20 | $response = $client->index($params);
21 | $params = [
22 | 'index' => 'my_index',
23 | 'body' => [
24 | 'query' => [
25 | 'terms' => [
26 | '_id' => [
27 | '1',
28 | '2',
29 | ],
30 | ],
31 | ],
32 | ],
33 | ];
34 | $response = $client->search($params);
35 | ----
36 |
--------------------------------------------------------------------------------
/docs/examples/8dcc74dc01f26e853e3b3dfa458b1ad7.asciidoc:
--------------------------------------------------------------------------------
1 | // indices/templates.asciidoc:231
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'name' => 'template_1',
7 | 'body' => [
8 | 'index_patterns' => [
9 | 'myindex-*',
10 | ],
11 | 'order' => 0,
12 | 'settings' => [
13 | 'number_of_shards' => 1,
14 | ],
15 | 'version' => 123,
16 | ],
17 | ];
18 | $response = $client->indices()->putTemplate($params);
19 | ----
20 |
--------------------------------------------------------------------------------
/docs/examples/8de3206f80e18185a5ad6481f4c2ee07.asciidoc:
--------------------------------------------------------------------------------
1 | // aggregations/bucket/datehistogram-aggregation.asciidoc:431
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'my_index',
7 | 'body' => [
8 | 'aggs' => [
9 | 'by_day' => [
10 | 'date_histogram' => [
11 | 'field' => 'date',
12 | 'calendar_interval' => 'day',
13 | 'time_zone' => '-01:00',
14 | ],
15 | ],
16 | ],
17 | ],
18 | ];
19 | $response = $client->search($params);
20 | ----
21 |
--------------------------------------------------------------------------------
/docs/examples/8e6bfb4441ffa15c86d5dc20fa083571.asciidoc:
--------------------------------------------------------------------------------
1 | // setup/logging-config.asciidoc:155
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'body' => [
7 | 'transient' => [
8 | 'logger.org.elasticsearch.transport' => 'trace',
9 | ],
10 | ],
11 | ];
12 | $response = $client->cluster()->putSettings($params);
13 | ----
14 |
--------------------------------------------------------------------------------
/docs/examples/8eaf4d5dd4ab1335deefa7749fdbbcc3.asciidoc:
--------------------------------------------------------------------------------
1 | // query-dsl/function-score-query.asciidoc:269
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'body' => [
7 | 'query' => [
8 | 'function_score' => [
9 | 'field_value_factor' => [
10 | 'field' => 'likes',
11 | 'factor' => 1.2,
12 | 'modifier' => 'sqrt',
13 | 'missing' => 1,
14 | ],
15 | ],
16 | ],
17 | ],
18 | ];
19 | $response = $client->search($params);
20 | ----
21 |
--------------------------------------------------------------------------------
/docs/examples/8f0511f8a5cb176ff2afdd4311799a33.asciidoc:
--------------------------------------------------------------------------------
1 | // search/count.asciidoc:99
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'twitter',
7 | 'id' => '1',
8 | 'body' => [
9 | 'user' => 'kimchy',
10 | ],
11 | ];
12 | $response = $client->index($params);
13 | $params = [
14 | 'index' => 'twitter',
15 | ];
16 | $response = $client->count($params);
17 | $params = [
18 | 'index' => 'twitter',
19 | 'body' => [
20 | 'query' => [
21 | 'term' => [
22 | 'user' => 'kimchy',
23 | ],
24 | ],
25 | ],
26 | ];
27 | $response = $client->count($params);
28 | ----
29 |
--------------------------------------------------------------------------------
/docs/examples/8fdf2344c4fb3de6902ad7c5735270df.asciidoc:
--------------------------------------------------------------------------------
1 | // docs/get.asciidoc:65
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'twitter',
7 | 'id' => '0',
8 | ];
9 | $response = $client->get($params);
10 | ----
11 |
--------------------------------------------------------------------------------
/docs/examples/913770050ebbf3b9b549a899bc11060a.asciidoc:
--------------------------------------------------------------------------------
1 | // docs/get.asciidoc:302
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'twitter',
7 | 'body' => [
8 | 'mappings' => [
9 | 'properties' => [
10 | 'counter' => [
11 | 'type' => 'integer',
12 | 'store' => false,
13 | ],
14 | 'tags' => [
15 | 'type' => 'keyword',
16 | 'store' => true,
17 | ],
18 | ],
19 | ],
20 | ],
21 | ];
22 | $response = $client->indices()->create($params);
23 | ----
24 |
--------------------------------------------------------------------------------
/docs/examples/93f1bdd72e79827dcf9a34efa02fd977.asciidoc:
--------------------------------------------------------------------------------
1 | // aggregations/bucket/terms-aggregation.asciidoc:224
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'body' => [
7 | 'aggs' => [
8 | 'genres' => [
9 | 'terms' => [
10 | 'field' => 'genre',
11 | 'order' => [
12 | '_key' => 'asc',
13 | ],
14 | ],
15 | ],
16 | ],
17 | ],
18 | ];
19 | $response = $client->search($params);
20 | ----
21 |
--------------------------------------------------------------------------------
/docs/examples/9524a9b7373fa4eb2905183b0e806962.asciidoc:
--------------------------------------------------------------------------------
1 | // aggregations/bucket/datehistogram-aggregation.asciidoc:567
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'sales',
7 | 'body' => [
8 | 'aggs' => [
9 | 'sales_over_time' => [
10 | 'date_histogram' => [
11 | 'field' => 'date',
12 | 'calendar_interval' => '1M',
13 | 'format' => 'yyyy-MM-dd',
14 | 'keyed' => true,
15 | ],
16 | ],
17 | ],
18 | ],
19 | ];
20 | $response = $client->search($params);
21 | ----
22 |
--------------------------------------------------------------------------------
/docs/examples/96de5703ba0bd43fd4ac239ec5408542.asciidoc:
--------------------------------------------------------------------------------
1 | // docs/update.asciidoc:96
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'test',
7 | 'id' => '1',
8 | 'body' => [
9 | 'script' => [
10 | 'source' => 'ctx._source.counter += params.count',
11 | 'lang' => 'painless',
12 | 'params' => [
13 | 'count' => 4,
14 | ],
15 | ],
16 | ],
17 | ];
18 | $response = $client->update($params);
19 | ----
20 |
--------------------------------------------------------------------------------
/docs/examples/973a3ff47fc4ce036ecd9bd363fef9f7.asciidoc:
--------------------------------------------------------------------------------
1 | // docs/reindex.asciidoc:784
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'body' => [
7 | 'source' => [
8 | 'index' => 'metricbeat-*',
9 | ],
10 | 'dest' => [
11 | 'index' => 'metricbeat',
12 | ],
13 | 'script' => [
14 | 'lang' => 'painless',
15 | 'source' => 'ctx._index = \'metricbeat-\' + (ctx._index.substring(\'metricbeat-\'.length(), ctx._index.length())) + \'-1\'',
16 | ],
17 | ],
18 | ];
19 | $response = $client->reindex($params);
20 | ----
21 |
--------------------------------------------------------------------------------
/docs/examples/978088f989d45dd09339582e9cbc60e0.asciidoc:
--------------------------------------------------------------------------------
1 | // api-conventions.asciidoc:88
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => '%3Clogstash-%7Bnow%2Fd%7D%3E',
7 | 'body' => [
8 | 'query' => [
9 | 'match' => [
10 | 'test' => 'data',
11 | ],
12 | ],
13 | ],
14 | ];
15 | $response = $client->search($params);
16 | ----
17 |
--------------------------------------------------------------------------------
/docs/examples/979d25dff2d8987119410291ad47b0d1.asciidoc:
--------------------------------------------------------------------------------
1 | // search/request/sort.asciidoc:444
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'body' => [
7 | 'sort' => [
8 | [
9 | '_geo_distance' => [
10 | 'pin.location' => [
11 | 'lat' => 40,
12 | 'lon' => -70,
13 | ],
14 | 'order' => 'asc',
15 | 'unit' => 'km',
16 | ],
17 | ],
18 | ],
19 | 'query' => [
20 | 'term' => [
21 | 'user' => 'kimchy',
22 | ],
23 | ],
24 | ],
25 | ];
26 | $response = $client->search($params);
27 | ----
28 |
--------------------------------------------------------------------------------
/docs/examples/97babc8d19ef0866774576716eb6d19e.asciidoc:
--------------------------------------------------------------------------------
1 | // docs/update-by-query.asciidoc:727
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'test',
7 | ];
8 | $response = $client->updateByQuery($params);
9 | $params = [
10 | 'index' => 'test',
11 | 'body' => [
12 | 'query' => [
13 | 'match' => [
14 | 'flag' => 'foo',
15 | ],
16 | ],
17 | ],
18 | ];
19 | $response = $client->search($params);
20 | ----
21 |
--------------------------------------------------------------------------------
/docs/examples/98234499cfec70487cec5d013e976a84.asciidoc:
--------------------------------------------------------------------------------
1 | // docs/get.asciidoc:253
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'twitter',
7 | 'id' => '0',
8 | ];
9 | $response = $client->exists($params);
10 | ----
11 |
--------------------------------------------------------------------------------
/docs/examples/98aeb275f829b5f7b8eb2147701565ff.asciidoc:
--------------------------------------------------------------------------------
1 | // docs/update.asciidoc:177
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'test',
7 | 'id' => '1',
8 | 'body' => [
9 | 'script' => [
10 | 'source' => 'if (ctx._source.tags.contains(params.tag)) { ctx.op = \'delete\' } else { ctx.op = \'none\' }',
11 | 'lang' => 'painless',
12 | 'params' => [
13 | 'tag' => 'green',
14 | ],
15 | ],
16 | ],
17 | ];
18 | $response = $client->update($params);
19 | ----
20 |
--------------------------------------------------------------------------------
/docs/examples/98b121bf47cebd85671a2cb519688d28.asciidoc:
--------------------------------------------------------------------------------
1 | // aggregations/bucket/terms-aggregation.asciidoc:520
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'body' => [
7 | 'aggs' => [
8 | 'JapaneseCars' => [
9 | 'terms' => [
10 | 'field' => 'make',
11 | 'include' => [
12 | 'mazda',
13 | 'honda',
14 | ],
15 | ],
16 | ],
17 | 'ActiveCarManufacturers' => [
18 | 'terms' => [
19 | 'field' => 'make',
20 | 'exclude' => [
21 | 'rover',
22 | 'jensen',
23 | ],
24 | ],
25 | ],
26 | ],
27 | ],
28 | ];
29 | $response = $client->search($params);
30 | ----
31 |
--------------------------------------------------------------------------------
/docs/examples/98f14fddddea54a7d6149ab7b92e099d.asciidoc:
--------------------------------------------------------------------------------
1 | // indices/delete-index.asciidoc:10
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'twitter',
7 | ];
8 | $response = $client->indices()->delete($params);
9 | ----
10 |
--------------------------------------------------------------------------------
/docs/examples/99a52be903945b17e734a1d02a57e958.asciidoc:
--------------------------------------------------------------------------------
1 | // mapping.asciidoc:263
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'my-index',
7 | 'fields' => 'employee-id',
8 | ];
9 | $response = $client->indices()->getFieldMapping($params);
10 | ----
11 |
--------------------------------------------------------------------------------
/docs/examples/9a4d5e41c52c20635d1fd9c6e13f6c7a.asciidoc:
--------------------------------------------------------------------------------
1 | // docs/reindex.asciidoc:768
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'metricbeat-2016.05.30',
7 | 'id' => '1',
8 | 'body' => [
9 | 'system.cpu.idle.pct' => 0.908,
10 | ],
11 | ];
12 | $response = $client->index($params);
13 | $params = [
14 | 'index' => 'metricbeat-2016.05.31',
15 | 'id' => '1',
16 | 'body' => [
17 | 'system.cpu.idle.pct' => 0.105,
18 | ],
19 | ];
20 | $response = $client->index($params);
21 | ----
22 |
--------------------------------------------------------------------------------
/docs/examples/9a8995fd31351045d99c78e40444c8ea.asciidoc:
--------------------------------------------------------------------------------
1 | // aggregations/bucket/terms-aggregation.asciidoc:57
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'body' => [
7 | 'aggs' => [
8 | 'genres' => [
9 | 'terms' => [
10 | 'field' => 'genre',
11 | ],
12 | ],
13 | ],
14 | ],
15 | ];
16 | $response = $client->search($params);
17 | ----
18 |
--------------------------------------------------------------------------------
/docs/examples/9e56d79ad9a02b642c361f0b85dd95d7.asciidoc:
--------------------------------------------------------------------------------
1 | // query-dsl/terms-query.asciidoc:127
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'my_index',
7 | 'body' => [
8 | 'mappings' => [
9 | 'properties' => [
10 | 'color' => [
11 | 'type' => 'keyword',
12 | ],
13 | ],
14 | ],
15 | ],
16 | ];
17 | $response = $client->indices()->create($params);
18 | ----
19 |
--------------------------------------------------------------------------------
/docs/examples/a116949e446f34dc25ae57d4b703d0c1.asciidoc:
--------------------------------------------------------------------------------
1 | // query-dsl/range-query.asciidoc:16
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'body' => [
7 | 'query' => [
8 | 'range' => [
9 | 'age' => [
10 | 'gte' => 10,
11 | 'lte' => 20,
12 | 'boost' => 2,
13 | ],
14 | ],
15 | ],
16 | ],
17 | ];
18 | $response = $client->search($params);
19 | ----
20 |
--------------------------------------------------------------------------------
/docs/examples/a1db5c822745fe167e9ef854dca3d129.asciidoc:
--------------------------------------------------------------------------------
1 | // search/request/sort.asciidoc:491
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'body' => [
7 | 'sort' => [
8 | [
9 | '_geo_distance' => [
10 | 'pin.location' => 'drm3btev3e86',
11 | 'order' => 'asc',
12 | 'unit' => 'km',
13 | ],
14 | ],
15 | ],
16 | 'query' => [
17 | 'term' => [
18 | 'user' => 'kimchy',
19 | ],
20 | ],
21 | ],
22 | ];
23 | $response = $client->search($params);
24 | ----
25 |
--------------------------------------------------------------------------------
/docs/examples/a2a25aad1fea9a541b52ac613c78fb64.asciidoc:
--------------------------------------------------------------------------------
1 | // query-dsl/query-string-query.asciidoc:297
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'body' => [
7 | 'query' => [
8 | 'query_string' => [
9 | 'fields' => [
10 | 'content',
11 | 'name^5',
12 | ],
13 | 'query' => 'this AND that OR thus',
14 | 'tie_breaker' => 0,
15 | ],
16 | ],
17 | ],
18 | ];
19 | $response = $client->search($params);
20 | ----
21 |
--------------------------------------------------------------------------------
/docs/examples/a34d70d7022eb4ba48909d440c80390f.asciidoc:
--------------------------------------------------------------------------------
1 | // api-conventions.asciidoc:142
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => '%3Clogstash-%7Bnow%2Fd-2d%7D%3E%2C%3Clogstash-%7Bnow%2Fd-1d%7D%3E%2C%3Clogstash-%7Bnow%2Fd%7D%3E',
7 | 'body' => [
8 | 'query' => [
9 | 'match' => [
10 | 'test' => 'data',
11 | ],
12 | ],
13 | ],
14 | ];
15 | $response = $client->search($params);
16 | ----
17 |
--------------------------------------------------------------------------------
/docs/examples/a42f33e15b0995bb4b6058659bfdea85.asciidoc:
--------------------------------------------------------------------------------
1 | // query-dsl/function-score-query.asciidoc:19
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'body' => [
7 | 'query' => [
8 | 'function_score' => [
9 | 'query' => [
10 | 'match_all' => [
11 | ],
12 | ],
13 | 'boost' => '5',
14 | 'random_score' => [
15 | ],
16 | 'boost_mode' => 'multiply',
17 | ],
18 | ],
19 | ],
20 | ];
21 | $response = $client->search($params);
22 | ----
23 |
--------------------------------------------------------------------------------
/docs/examples/a49169b4622918992411fab4ec48191b.asciidoc:
--------------------------------------------------------------------------------
1 | // aggregations/bucket/terms-aggregation.asciidoc:466
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'body' => [
7 | 'aggs' => [
8 | 'genres' => [
9 | 'terms' => [
10 | 'field' => 'genre',
11 | 'script' => [
12 | 'source' => '\'Genre: \' +_value',
13 | 'lang' => 'painless',
14 | ],
15 | ],
16 | ],
17 | ],
18 | ],
19 | ];
20 | $response = $client->search($params);
21 | ----
22 |
--------------------------------------------------------------------------------
/docs/examples/a4a396cd07657b3977713fb3a742c41b.asciidoc:
--------------------------------------------------------------------------------
1 | // docs/update-by-query.asciidoc:12
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'twitter',
7 | ];
8 | $response = $client->updateByQuery($params);
9 | ----
10 |
--------------------------------------------------------------------------------
/docs/examples/a5a7050fb9dcb9574e081957ade28617.asciidoc:
--------------------------------------------------------------------------------
1 | // docs/delete-by-query.asciidoc:494
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'twitter',
7 | 'body' => [
8 | 'query' => [
9 | 'range' => [
10 | 'likes' => [
11 | 'lt' => 10,
12 | ],
13 | ],
14 | ],
15 | ],
16 | ];
17 | $response = $client->deleteByQuery($params);
18 | ----
19 |
--------------------------------------------------------------------------------
/docs/examples/a6f8636b03cc5f677b7d89e750328612.asciidoc:
--------------------------------------------------------------------------------
1 | // api-conventions.asciidoc:580
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'twitter',
7 | ];
8 | $response = $client->search($params);
9 | ----
10 |
--------------------------------------------------------------------------------
/docs/examples/a71c438cc4df1cafe3109ccff475afdb.asciidoc:
--------------------------------------------------------------------------------
1 | // mapping/types/numeric.asciidoc:22
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'my_index',
7 | 'body' => [
8 | 'mappings' => [
9 | 'properties' => [
10 | 'number_of_bytes' => [
11 | 'type' => 'integer',
12 | ],
13 | 'time_in_seconds' => [
14 | 'type' => 'float',
15 | ],
16 | 'price' => [
17 | 'type' => 'scaled_float',
18 | 'scaling_factor' => 100,
19 | ],
20 | ],
21 | ],
22 | ],
23 | ];
24 | $response = $client->indices()->create($params);
25 | ----
26 |
--------------------------------------------------------------------------------
/docs/examples/a7c15fe6b5779c84ce9a34bf4b2a7ab7.asciidoc:
--------------------------------------------------------------------------------
1 | // mapping/params/fielddata.asciidoc:84
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'my_index',
7 | 'body' => [
8 | 'properties' => [
9 | 'my_field' => [
10 | 'type' => 'text',
11 | 'fielddata' => true,
12 | ],
13 | ],
14 | ],
15 | ];
16 | $response = $client->indices()->putMapping($params);
17 | ----
18 |
--------------------------------------------------------------------------------
/docs/examples/a80f5db4357bb25b8704d374c18318ed.asciidoc:
--------------------------------------------------------------------------------
1 | // query-dsl/term-query.asciidoc:165
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'my_index',
7 | 'body' => [
8 | 'query' => [
9 | 'match' => [
10 | 'full_text' => 'Quick Brown Foxes!',
11 | ],
12 | ],
13 | ],
14 | ];
15 | $response = $client->search($params);
16 | ----
17 |
--------------------------------------------------------------------------------
/docs/examples/a8fba09a46b2c3524428aa3259b7124f.asciidoc:
--------------------------------------------------------------------------------
1 | // indices/get-mapping.asciidoc:11
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'twitter',
7 | ];
8 | $response = $client->indices()->getMapping($params);
9 | ----
10 |
--------------------------------------------------------------------------------
/docs/examples/aa6bfe54e2436eb668091fe31c2fbf4d.asciidoc:
--------------------------------------------------------------------------------
1 | // aggregations/bucket/datehistogram-aggregation.asciidoc:502
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'my_index',
7 | 'id' => '1',
8 | 'body' => [
9 | 'date' => '2015-10-01T05:30:00Z',
10 | ],
11 | ];
12 | $response = $client->index($params);
13 | $params = [
14 | 'index' => 'my_index',
15 | 'id' => '2',
16 | 'body' => [
17 | 'date' => '2015-10-01T06:30:00Z',
18 | ],
19 | ];
20 | $response = $client->index($params);
21 | $params = [
22 | 'index' => 'my_index',
23 | 'body' => [
24 | 'aggs' => [
25 | 'by_day' => [
26 | 'date_histogram' => [
27 | 'field' => 'date',
28 | 'calendar_interval' => 'day',
29 | 'offset' => '+6h',
30 | ],
31 | ],
32 | ],
33 | ],
34 | ];
35 | $response = $client->search($params);
36 | ----
37 |
--------------------------------------------------------------------------------
/docs/examples/abd4fc3ce7784413a56fe2dcfe2809b5.asciidoc:
--------------------------------------------------------------------------------
1 | // docs/update-by-query.asciidoc:700
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'test',
7 | 'body' => [
8 | 'query' => [
9 | 'match' => [
10 | 'flag' => 'foo',
11 | ],
12 | ],
13 | ],
14 | ];
15 | $response = $client->search($params);
16 | ----
17 |
--------------------------------------------------------------------------------
/docs/examples/abf329ebefaf58acd4ee30e685731499.asciidoc:
--------------------------------------------------------------------------------
1 | // search/request/sort.asciidoc:122
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'index_double',
7 | 'body' => [
8 | 'mappings' => [
9 | 'properties' => [
10 | 'field' => [
11 | 'type' => 'double',
12 | ],
13 | ],
14 | ],
15 | ],
16 | ];
17 | $response = $client->indices()->create($params);
18 | ----
19 |
--------------------------------------------------------------------------------
/docs/examples/ac544eb247a29ca42aab13826ca88561.asciidoc:
--------------------------------------------------------------------------------
1 | // docs/update.asciidoc:135
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'test',
7 | 'id' => '1',
8 | 'body' => [
9 | 'script' => [
10 | 'source' => 'if (ctx._source.tags.contains(params.tag)) { ctx._source.tags.remove(ctx._source.tags.indexOf(params.tag)) }',
11 | 'lang' => 'painless',
12 | 'params' => [
13 | 'tag' => 'blue',
14 | ],
15 | ],
16 | ],
17 | ];
18 | $response = $client->update($params);
19 | ----
20 |
--------------------------------------------------------------------------------
/docs/examples/ad0dcbc7fc619e952c8825b8f307b7b2.asciidoc:
--------------------------------------------------------------------------------
1 | // query-dsl/multi-match-query.asciidoc:400
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'body' => [
7 | 'query' => [
8 | 'multi_match' => [
9 | 'query' => 'Jon',
10 | 'type' => 'cross_fields',
11 | 'fields' => [
12 | 'first',
13 | 'first.edge',
14 | 'last',
15 | 'last.edge',
16 | ],
17 | ],
18 | ],
19 | ],
20 | ];
21 | $response = $client->search($params);
22 | ----
23 |
--------------------------------------------------------------------------------
/docs/examples/ad6ea0c1e46712aa1fd6d3bfa0ec979e.asciidoc:
--------------------------------------------------------------------------------
1 | // query-dsl/query-string-query.asciidoc:42
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'body' => [
7 | 'query' => [
8 | 'query_string' => [
9 | 'query' => '(new york city) OR (big apple)',
10 | 'default_field' => 'content',
11 | ],
12 | ],
13 | ],
14 | ];
15 | $response = $client->search($params);
16 | ----
17 |
--------------------------------------------------------------------------------
/docs/examples/ad79228630684d950fe9792a768d24c5.asciidoc:
--------------------------------------------------------------------------------
1 | // indices/aliases.asciidoc:462
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'body' => [
7 | 'actions' => [
8 | [
9 | 'add' => [
10 | 'index' => 'test',
11 | 'alias' => 'alias1',
12 | 'is_write_index' => false,
13 | ],
14 | ],
15 | [
16 | 'add' => [
17 | 'index' => 'test2',
18 | 'alias' => 'alias1',
19 | 'is_write_index' => true,
20 | ],
21 | ],
22 | ],
23 | ],
24 | ];
25 | $response = $client->indices()->updateAliases($params);
26 | ----
27 |
--------------------------------------------------------------------------------
/docs/examples/ae9b5fbd42af2386ffbf56ad4a697e51.asciidoc:
--------------------------------------------------------------------------------
1 | // search/request/sort.asciidoc:30
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'my_index',
7 | 'body' => [
8 | 'sort' => [
9 | [
10 | 'post_date' => [
11 | 'order' => 'asc',
12 | ],
13 | ],
14 | 'user',
15 | [
16 | 'name' => 'desc',
17 | ],
18 | [
19 | 'age' => 'desc',
20 | ],
21 | '_score',
22 | ],
23 | 'query' => [
24 | 'term' => [
25 | 'user' => 'kimchy',
26 | ],
27 | ],
28 | ],
29 | ];
30 | $response = $client->search($params);
31 | ----
32 |
--------------------------------------------------------------------------------
/docs/examples/af3fb9fa5691a7b37a6dc2a69ff66e64.asciidoc:
--------------------------------------------------------------------------------
1 | // indices/aliases.asciidoc:204
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'body' => [
7 | 'actions' => [
8 | [
9 | 'remove' => [
10 | 'index' => 'test1',
11 | 'alias' => 'alias1',
12 | ],
13 | ],
14 | [
15 | 'add' => [
16 | 'index' => 'test1',
17 | 'alias' => 'alias2',
18 | ],
19 | ],
20 | ],
21 | ],
22 | ];
23 | $response = $client->indices()->updateAliases($params);
24 | ----
25 |
--------------------------------------------------------------------------------
/docs/examples/afc29b61c532cf683f749baf013e7bfe.asciidoc:
--------------------------------------------------------------------------------
1 | // indices/put-mapping.asciidoc:544
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'my_index',
7 | 'body' => [
8 | 'properties' => [
9 | 'user_id' => [
10 | 'type' => 'alias',
11 | 'path' => 'user_identifier',
12 | ],
13 | ],
14 | ],
15 | ];
16 | $response = $client->indices()->putMapping($params);
17 | ----
18 |
--------------------------------------------------------------------------------
/docs/examples/b02e4907c9936c1adc16ccce9d49900d.asciidoc:
--------------------------------------------------------------------------------
1 | // cluster/health.asciidoc:150
2 |
3 | [source, php]
4 | ----
5 | $response = $client->cluster()->health();
6 | ----
7 |
--------------------------------------------------------------------------------
/docs/examples/b0d64d0a554549e5b2808002a0725493.asciidoc:
--------------------------------------------------------------------------------
1 | // search/request/scroll.asciidoc:161
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'body' => [
7 | 'scroll_id' => 'DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAD4WYm9laVYtZndUQlNsdDcwakFMNjU1QQ==',
8 | ],
9 | ];
10 | $response = $client->clearScroll($params);
11 | ----
12 |
--------------------------------------------------------------------------------
/docs/examples/b0eaf67e5cce24ef8889bf20951ccec1.asciidoc:
--------------------------------------------------------------------------------
1 | // query-dsl/multi-match-query.asciidoc:130
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'body' => [
7 | 'query' => [
8 | 'dis_max' => [
9 | 'queries' => [
10 | [
11 | 'match' => [
12 | 'subject' => 'brown fox',
13 | ],
14 | ],
15 | [
16 | 'match' => [
17 | 'message' => 'brown fox',
18 | ],
19 | ],
20 | ],
21 | 'tie_breaker' => 0.3,
22 | ],
23 | ],
24 | ],
25 | ];
26 | $response = $client->search($params);
27 | ----
28 |
--------------------------------------------------------------------------------
/docs/examples/b0ec418bf416c62bed602b0a32a6d5f5.asciidoc:
--------------------------------------------------------------------------------
1 | // indices/aliases.asciidoc:441
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'alias1',
7 | 'id' => '1',
8 | 'body' => [
9 | 'foo' => 'bar',
10 | ],
11 | ];
12 | $response = $client->index($params);
13 | ----
14 |
--------------------------------------------------------------------------------
/docs/examples/b1efa1c51a34dd5ab5511b71a399f5b1.asciidoc:
--------------------------------------------------------------------------------
1 | // docs/reindex.asciidoc:417
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'body' => [
7 | 'source' => [
8 | 'index' => 'source',
9 | ],
10 | 'dest' => [
11 | 'index' => 'dest',
12 | 'pipeline' => 'some_ingest_pipeline',
13 | ],
14 | ],
15 | ];
16 | $response = $client->reindex($params);
17 | ----
18 |
--------------------------------------------------------------------------------
/docs/examples/b214942b938e47f2c486e523546cb574.asciidoc:
--------------------------------------------------------------------------------
1 | // mapping/types/nested.asciidoc:58
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'my_index',
7 | 'body' => [
8 | 'query' => [
9 | 'bool' => [
10 | 'must' => [
11 | [
12 | 'match' => [
13 | 'user.first' => 'Alice',
14 | ],
15 | ],
16 | [
17 | 'match' => [
18 | 'user.last' => 'Smith',
19 | ],
20 | ],
21 | ],
22 | ],
23 | ],
24 | ],
25 | ];
26 | $response = $client->search($params);
27 | ----
28 |
--------------------------------------------------------------------------------
/docs/examples/b41dce56b0e640d32b1cf452f87cec17.asciidoc:
--------------------------------------------------------------------------------
1 | // search/request/scroll.asciidoc:63
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'body' => [
7 | 'scroll' => '1m',
8 | 'scroll_id' => 'DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAD4WYm9laVYtZndUQlNsdDcwakFMNjU1QQ==',
9 | ],
10 | ];
11 | $response = $client->scroll($params);
12 | ----
13 |
--------------------------------------------------------------------------------
/docs/examples/b4392116f2cc57ce8064ccbad30318d5.asciidoc:
--------------------------------------------------------------------------------
1 | // indices/aliases.asciidoc:170
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'body' => [
7 | 'actions' => [
8 | [
9 | 'add' => [
10 | 'index' => 'test1',
11 | 'alias' => 'alias1',
12 | ],
13 | ],
14 | ],
15 | ],
16 | ];
17 | $response = $client->indices()->updateAliases($params);
18 | ----
19 |
--------------------------------------------------------------------------------
/docs/examples/b68c85fe1b0d2f264dc0d1cbf530f319.asciidoc:
--------------------------------------------------------------------------------
1 | // query-dsl/function-score-query.asciidoc:175
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'body' => [
7 | 'query' => [
8 | 'function_score' => [
9 | 'query' => [
10 | 'match' => [
11 | 'message' => 'elasticsearch',
12 | ],
13 | ],
14 | 'script_score' => [
15 | 'script' => [
16 | 'params' => [
17 | 'a' => 5,
18 | 'b' => 1.2,
19 | ],
20 | 'source' => 'params.a / Math.pow(params.b, doc[\'likes\'].value)',
21 | ],
22 | ],
23 | ],
24 | ],
25 | ],
26 | ];
27 | $response = $client->search($params);
28 | ----
29 |
--------------------------------------------------------------------------------
/docs/examples/b789292f9cf63ce912e058c46d90ce20.asciidoc:
--------------------------------------------------------------------------------
1 | // aggregations/bucket/datehistogram-aggregation.asciidoc:119
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'sales',
7 | 'body' => [
8 | 'aggs' => [
9 | 'sales_over_time' => [
10 | 'date_histogram' => [
11 | 'field' => 'date',
12 | 'calendar_interval' => 'month',
13 | ],
14 | ],
15 | ],
16 | ],
17 | ];
18 | $response = $client->search($params);
19 | ----
20 |
--------------------------------------------------------------------------------
/docs/examples/b918d6b798da673a33e49b94f61dcdc0.asciidoc:
--------------------------------------------------------------------------------
1 | // docs/index_.asciidoc:411
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'twitter',
7 | 'id' => '1',
8 | 'body' => [
9 | 'user' => 'kimchy',
10 | 'post_date' => '2009-11-15T14:12:12',
11 | 'message' => 'trying out Elasticsearch',
12 | ],
13 | ];
14 | $response = $client->index($params);
15 | ----
16 |
--------------------------------------------------------------------------------
/docs/examples/b93ed4ef309819734f0eeea82e8b0f1f.asciidoc:
--------------------------------------------------------------------------------
1 | // aggregations/bucket/filter-aggregation.asciidoc:9
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'sales',
7 | 'body' => [
8 | 'aggs' => [
9 | 't_shirts' => [
10 | 'filter' => [
11 | 'term' => [
12 | 'type' => 't-shirt',
13 | ],
14 | ],
15 | 'aggs' => [
16 | 'avg_price' => [
17 | 'avg' => [
18 | 'field' => 'price',
19 | ],
20 | ],
21 | ],
22 | ],
23 | ],
24 | ],
25 | ];
26 | $response = $client->search($params);
27 | ----
28 |
--------------------------------------------------------------------------------
/docs/examples/b94cee0f74f57742b3948f9b784dfdd4.asciidoc:
--------------------------------------------------------------------------------
1 | // search/request/scroll.asciidoc:194
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'scroll_id' => 'DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAD4WYm9laVYtZndUQlNsdDcwakFMNjU1QQ==,DnF1ZXJ5VGhlbkZldGNoBQAAAAAAAAABFmtSWWRRWUJrU2o2ZExpSGJCVmQxYUEAAAAAAAAAAxZrUllkUVlCa1NqNmRMaUhiQlZkMWFBAAAAAAAAAAIWa1JZZFFZQmtTajZkTGlIYkJWZDFhQQAAAAAAAAAFFmtSWWRRWUJrU2o2ZExpSGJCVmQxYUEAAAAAAAAABBZrUllkUVlCa1NqNmRMaUhiQlZkMWFB',
7 | ];
8 | $response = $client->clearScroll($params);
9 | ----
10 |
--------------------------------------------------------------------------------
/docs/examples/b997885974522ef439d5e345924cc5ba.asciidoc:
--------------------------------------------------------------------------------
1 | // search/request/sort.asciidoc:94
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'my_index',
7 | 'id' => '1',
8 | 'body' => [
9 | 'product' => 'chocolate',
10 | 'price' => [
11 | 20,
12 | 4,
13 | ],
14 | ],
15 | ];
16 | $response = $client->index($params);
17 | $params = [
18 | 'body' => [
19 | 'query' => [
20 | 'term' => [
21 | 'product' => 'chocolate',
22 | ],
23 | ],
24 | 'sort' => [
25 | [
26 | 'price' => [
27 | 'order' => 'asc',
28 | 'mode' => 'avg',
29 | ],
30 | ],
31 | ],
32 | ],
33 | ];
34 | $response = $client->search($params);
35 | ----
36 |
--------------------------------------------------------------------------------
/docs/examples/b9a153725b28fdd0a5aabd7f17a8c2d7.asciidoc:
--------------------------------------------------------------------------------
1 | // api-conventions.asciidoc:386
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'twitter',
7 | ];
8 | $response = $client->indices()->getSettings($params);
9 | ----
10 |
--------------------------------------------------------------------------------
/docs/examples/b9c5d7ca6ca9c6f747201f45337a4abf.asciidoc:
--------------------------------------------------------------------------------
1 | // indices/create-index.asciidoc:99
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'twitter',
7 | 'body' => [
8 | 'settings' => [
9 | 'number_of_shards' => 3,
10 | 'number_of_replicas' => 2,
11 | ],
12 | ],
13 | ];
14 | $response = $client->indices()->create($params);
15 | ----
16 |
--------------------------------------------------------------------------------
/docs/examples/ba0b4081c98f3387f76b77847c52ee9a.asciidoc:
--------------------------------------------------------------------------------
1 | // indices/update-settings.asciidoc:169
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'twitter',
7 | ];
8 | $response = $client->indices()->close($params);
9 | $params = [
10 | 'index' => 'twitter',
11 | 'body' => [
12 | 'analysis' => [
13 | 'analyzer' => [
14 | 'content' => [
15 | 'type' => 'custom',
16 | 'tokenizer' => 'whitespace',
17 | ],
18 | ],
19 | ],
20 | ],
21 | ];
22 | $response = $client->indices()->putSettings($params);
23 | $params = [
24 | 'index' => 'twitter',
25 | ];
26 | $response = $client->indices()->open($params);
27 | ----
28 |
--------------------------------------------------------------------------------
/docs/examples/bb143628fd04070683eeeadc9406d9cc.asciidoc:
--------------------------------------------------------------------------------
1 | // docs/index_.asciidoc:498
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'twitter',
7 | 'id' => '1',
8 | 'body' => [
9 | 'user' => 'kimchy',
10 | 'post_date' => '2009-11-15T14:12:12',
11 | 'message' => 'trying out Elasticsearch',
12 | ],
13 | ];
14 | $response = $client->index($params);
15 | ----
16 |
--------------------------------------------------------------------------------
/docs/examples/bc1ad5cc6d3eab98e3ce01f209ba7094.asciidoc:
--------------------------------------------------------------------------------
1 | // indices/aliases.asciidoc:348
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'body' => [
7 | 'actions' => [
8 | [
9 | 'add' => [
10 | 'index' => 'test',
11 | 'alias' => 'alias1',
12 | 'routing' => '1',
13 | ],
14 | ],
15 | ],
16 | ],
17 | ];
18 | $response = $client->indices()->updateAliases($params);
19 | ----
20 |
--------------------------------------------------------------------------------
/docs/examples/bd5918ab903c0889bb1f09c8c2466e43.asciidoc:
--------------------------------------------------------------------------------
1 | // indices/put-mapping.asciidoc:417
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'users',
7 | 'body' => [
8 | 'mappings' => [
9 | 'properties' => [
10 | 'user_id' => [
11 | 'type' => 'long',
12 | ],
13 | ],
14 | ],
15 | ],
16 | ];
17 | $response = $client->indices()->create($params);
18 | ----
19 |
--------------------------------------------------------------------------------
/docs/examples/bdb30dd52d32f50994008f4f9c0da5f0.asciidoc:
--------------------------------------------------------------------------------
1 | // docs/update-by-query.asciidoc:517
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'task_id' => 'r1A2WoRbTwKZ516z6NEs5A:36619',
7 | ];
8 | $response = $client->updateByQueryRethrottle($params);
9 | ----
10 |
--------------------------------------------------------------------------------
/docs/examples/be1bd47393646ac6bbee177d1cdb7738.asciidoc:
--------------------------------------------------------------------------------
1 | // query-dsl/query-string-query.asciidoc:472
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'body' => [
7 | 'query' => [
8 | 'query_string' => [
9 | 'fields' => [
10 | 'title',
11 | 'content',
12 | ],
13 | 'query' => 'this that thus',
14 | 'minimum_should_match' => 2,
15 | ],
16 | ],
17 | ],
18 | ];
19 | $response = $client->search($params);
20 | ----
21 |
--------------------------------------------------------------------------------
/docs/examples/be3a6431d01846950dc1a39a7a6a1faa.asciidoc:
--------------------------------------------------------------------------------
1 | // docs/update-by-query.asciidoc:478
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'task_id' => 'r1A2WoRbTwKZ516z6NEs5A:36619',
7 | ];
8 | $response = $client->tasks()->get($params);
9 | ----
10 |
--------------------------------------------------------------------------------
/docs/examples/be8f28f31207b173de61be032fcf239c.asciidoc:
--------------------------------------------------------------------------------
1 | // indices/get-index.asciidoc:11
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'twitter',
7 | ];
8 | $response = $client->indices()->get($params);
9 | ----
10 |
--------------------------------------------------------------------------------
/docs/examples/bfcd65ab85d684d36a8550080032958d.asciidoc:
--------------------------------------------------------------------------------
1 | // search/request-body.asciidoc:65
2 |
3 | [source, php]
4 | ----
5 | $response = $client->search();
6 | ----
7 |
--------------------------------------------------------------------------------
/docs/examples/bfdad8a928ea30d7cf60d0a0a6bc6e2e.asciidoc:
--------------------------------------------------------------------------------
1 | // docs/bulk.asciidoc:646
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'body' => [
7 | [
8 | 'update' => [
9 | '_id' => '5',
10 | '_index' => 'index1',
11 | ],
12 | ],
13 | [
14 | 'doc' => [
15 | 'my_field' => 'baz',
16 | ],
17 | ],
18 | [
19 | 'update' => [
20 | '_id' => '6',
21 | '_index' => 'index1',
22 | ],
23 | ],
24 | [
25 | 'doc' => [
26 | 'my_field' => 'baz',
27 | ],
28 | ],
29 | [
30 | 'update' => [
31 | '_id' => '7',
32 | '_index' => 'index1',
33 | ],
34 | ],
35 | [
36 | 'doc' => [
37 | 'my_field' => 'baz',
38 | ],
39 | ],
40 | ],
41 | ];
42 | $response = $client->bulk($params);
43 | ----
44 |
--------------------------------------------------------------------------------
/docs/examples/c22b72c4a52ee098331b3f252c22860d.asciidoc:
--------------------------------------------------------------------------------
1 | // docs/delete-by-query.asciidoc:369
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'twitter,blog',
7 | 'body' => [
8 | 'query' => [
9 | 'match_all' => [
10 | ],
11 | ],
12 | ],
13 | ];
14 | $response = $client->deleteByQuery($params);
15 | ----
16 |
--------------------------------------------------------------------------------
/docs/examples/c2c21e2824fbf6b7198ede30419da82b.asciidoc:
--------------------------------------------------------------------------------
1 | // search/request/scroll.asciidoc:186
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'scroll_id' => '_all',
7 | ];
8 | $response = $client->clearScroll($params);
9 | ----
10 |
--------------------------------------------------------------------------------
/docs/examples/c32a3f8071d87f0a3f5a78e07fe7a669.asciidoc:
--------------------------------------------------------------------------------
1 | // docs/delete-by-query.asciidoc:383
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'twitter',
7 | 'body' => [
8 | 'query' => [
9 | 'range' => [
10 | 'age' => [
11 | 'gte' => 10,
12 | ],
13 | ],
14 | ],
15 | ],
16 | ];
17 | $response = $client->deleteByQuery($params);
18 | ----
19 |
--------------------------------------------------------------------------------
/docs/examples/c48264ec5d9b9679fddd72e5c44425b9.asciidoc:
--------------------------------------------------------------------------------
1 | // cluster/health.asciidoc:186
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'twitter',
7 | ];
8 | $response = $client->cluster()->health($params);
9 | ----
10 |
--------------------------------------------------------------------------------
/docs/examples/c4b278ba293abd0d02a0b5ad1a99f84a.asciidoc:
--------------------------------------------------------------------------------
1 | // docs/update-by-query.asciidoc:396
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'id' => 'set-foo',
7 | 'body' => [
8 | 'description' => 'sets foo',
9 | 'processors' => [
10 | [
11 | 'set' => [
12 | 'field' => 'foo',
13 | 'value' => 'bar',
14 | ],
15 | ],
16 | ],
17 | ],
18 | ];
19 | $response = $client->ingest()->putPipeline($params);
20 | $params = [
21 | 'index' => 'twitter',
22 | ];
23 | $response = $client->updateByQuery($params);
24 | ----
25 |
--------------------------------------------------------------------------------
/docs/examples/c5e5873783246c7b1c01d8464fed72c4.asciidoc:
--------------------------------------------------------------------------------
1 | // docs/delete.asciidoc:172
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'twitter',
7 | 'id' => '1',
8 | ];
9 | $response = $client->delete($params);
10 | ----
11 |
--------------------------------------------------------------------------------
/docs/examples/c612d93e7f682a0d731e385edf9f5d56.asciidoc:
--------------------------------------------------------------------------------
1 | // query-dsl/nested-query.asciidoc:23
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'my_index',
7 | 'body' => [
8 | 'mappings' => [
9 | 'properties' => [
10 | 'obj1' => [
11 | 'type' => 'nested',
12 | ],
13 | ],
14 | ],
15 | ],
16 | ];
17 | $response = $client->indices()->create($params);
18 | ----
19 |
--------------------------------------------------------------------------------
/docs/examples/c849c6c8f8659dbb93e1c14356f74e37.asciidoc:
--------------------------------------------------------------------------------
1 | // indices/put-mapping.asciidoc:239
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'my_index',
7 | 'body' => [
8 | 'mappings' => [
9 | 'properties' => [
10 | 'city' => [
11 | 'type' => 'text',
12 | ],
13 | ],
14 | ],
15 | ],
16 | ];
17 | $response = $client->indices()->create($params);
18 | ----
19 |
--------------------------------------------------------------------------------
/docs/examples/cb01106bf524df5e0501d4c655c1aa7b.asciidoc:
--------------------------------------------------------------------------------
1 | // docs/reindex.asciidoc:264
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'body' => [
7 | 'source' => [
8 | 'index' => 'twitter',
9 | ],
10 | 'dest' => [
11 | 'index' => 'new_twitter',
12 | ],
13 | ],
14 | ];
15 | $response = $client->reindex($params);
16 | ----
17 |
--------------------------------------------------------------------------------
/docs/examples/cd247f267968aa0927bfdad56852f8f5.asciidoc:
--------------------------------------------------------------------------------
1 | // getting-started.asciidoc:482
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'bank',
7 | 'body' => [
8 | 'query' => [
9 | 'match' => [
10 | 'address' => 'mill lane',
11 | ],
12 | ],
13 | ],
14 | ];
15 | $response = $client->search($params);
16 | ----
17 |
--------------------------------------------------------------------------------
/docs/examples/cd5bc5bf7cd58d7b1492c9c298b345f6.asciidoc:
--------------------------------------------------------------------------------
1 | // aggregations/bucket/terms-aggregation.asciidoc:672
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'body' => [
7 | 'aggs' => [
8 | 'actors' => [
9 | 'terms' => [
10 | 'field' => 'actors',
11 | 'size' => 10,
12 | 'collect_mode' => 'breadth_first',
13 | ],
14 | 'aggs' => [
15 | 'costars' => [
16 | 'terms' => [
17 | 'field' => 'actors',
18 | 'size' => 5,
19 | ],
20 | ],
21 | ],
22 | ],
23 | ],
24 | ],
25 | ];
26 | $response = $client->search($params);
27 | ----
28 |
--------------------------------------------------------------------------------
/docs/examples/cde4dddae5c06e7f1d38c9d933dbc7ac.asciidoc:
--------------------------------------------------------------------------------
1 | // docs/update-by-query.asciidoc:326
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'twitter,blog',
7 | ];
8 | $response = $client->updateByQuery($params);
9 | ----
10 |
--------------------------------------------------------------------------------
/docs/examples/cdedd5f33f7e5f7acde561e97bff61de.asciidoc:
--------------------------------------------------------------------------------
1 | // query-dsl/term-query.asciidoc:132
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'my_index',
7 | 'body' => [
8 | 'query' => [
9 | 'term' => [
10 | 'full_text' => 'Quick Brown Foxes!',
11 | ],
12 | ],
13 | ],
14 | ];
15 | $response = $client->search($params);
16 | ----
17 |
--------------------------------------------------------------------------------
/docs/examples/cf02e3d8b371bd59f0224967c36330da.asciidoc:
--------------------------------------------------------------------------------
1 | // indices/get-mapping.asciidoc:68
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'twitter,kimchy',
7 | ];
8 | $response = $client->indices()->getMapping($params);
9 | ----
10 |
--------------------------------------------------------------------------------
/docs/examples/cfbaea6f0df045c5d940bbb6a9c69cd8.asciidoc:
--------------------------------------------------------------------------------
1 | // getting-started.asciidoc:665
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'bank',
7 | 'body' => [
8 | 'size' => 0,
9 | 'aggs' => [
10 | 'group_by_state' => [
11 | 'terms' => [
12 | 'field' => 'state.keyword',
13 | ],
14 | 'aggs' => [
15 | 'average_balance' => [
16 | 'avg' => [
17 | 'field' => 'balance',
18 | ],
19 | ],
20 | ],
21 | ],
22 | ],
23 | ],
24 | ];
25 | $response = $client->search($params);
26 | ----
27 |
--------------------------------------------------------------------------------
/docs/examples/cfc37446bd892d1ac42a3c8e8b204e6c.asciidoc:
--------------------------------------------------------------------------------
1 | // docs/reindex.asciidoc:735
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'test2',
7 | 'id' => '1',
8 | ];
9 | $response = $client->get($params);
10 | ----
11 |
--------------------------------------------------------------------------------
/docs/examples/d0a8a938a2fa913b6fdbc871079a59dd.asciidoc:
--------------------------------------------------------------------------------
1 | // query-dsl/term-query.asciidoc:28
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'body' => [
7 | 'query' => [
8 | 'term' => [
9 | 'user' => [
10 | 'value' => 'Kimchy',
11 | 'boost' => 1,
12 | ],
13 | ],
14 | ],
15 | ],
16 | ];
17 | $response = $client->search($params);
18 | ----
19 |
--------------------------------------------------------------------------------
/docs/examples/d17269bb80fb63ec0bf37d219e003dcb.asciidoc:
--------------------------------------------------------------------------------
1 | // search/request/sort.asciidoc:391
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'body' => [
7 | 'sort' => [
8 | [
9 | '_geo_distance' => [
10 | 'pin.location' => [
11 | -70,
12 | 40,
13 | ],
14 | 'order' => 'asc',
15 | 'unit' => 'km',
16 | 'mode' => 'min',
17 | 'distance_type' => 'arc',
18 | 'ignore_unmapped' => true,
19 | ],
20 | ],
21 | ],
22 | 'query' => [
23 | 'term' => [
24 | 'user' => 'kimchy',
25 | ],
26 | ],
27 | ],
28 | ];
29 | $response = $client->search($params);
30 | ----
31 |
--------------------------------------------------------------------------------
/docs/examples/d1b3b7d2bb2ab90d15fd10318abd24db.asciidoc:
--------------------------------------------------------------------------------
1 | // search/request/sort.asciidoc:11
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'my_index',
7 | 'body' => [
8 | 'mappings' => [
9 | 'properties' => [
10 | 'post_date' => [
11 | 'type' => 'date',
12 | ],
13 | 'user' => [
14 | 'type' => 'keyword',
15 | ],
16 | 'name' => [
17 | 'type' => 'keyword',
18 | ],
19 | 'age' => [
20 | 'type' => 'integer',
21 | ],
22 | ],
23 | ],
24 | ],
25 | ];
26 | $response = $client->indices()->create($params);
27 | ----
28 |
--------------------------------------------------------------------------------
/docs/examples/d1bcf2eb63a462bfdcf01a68e68d5b4a.asciidoc:
--------------------------------------------------------------------------------
1 | // query-dsl/terms-query.asciidoc:186
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'my_index',
7 | 'body' => [
8 | 'query' => [
9 | 'terms' => [
10 | 'color' => [
11 | 'index' => 'my_index',
12 | 'id' => '2',
13 | 'path' => 'color',
14 | ],
15 | ],
16 | ],
17 | ],
18 | ];
19 | $response = $client->search($params);
20 | ----
21 |
--------------------------------------------------------------------------------
/docs/examples/d222c6a6ec7a3beca6c97011b0874512.asciidoc:
--------------------------------------------------------------------------------
1 | // docs/get.asciidoc:278
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'twitter',
7 | 'id' => '1',
8 | ];
9 | $response = $client->getSource($params);
10 | ----
11 |
--------------------------------------------------------------------------------
/docs/examples/d3016e4e8025362ad9a05ee86bb2061f.asciidoc:
--------------------------------------------------------------------------------
1 | // indices/aliases.asciidoc:12
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'body' => [
7 | 'actions' => [
8 | [
9 | 'add' => [
10 | 'index' => 'twitter',
11 | 'alias' => 'alias1',
12 | ],
13 | ],
14 | ],
15 | ],
16 | ];
17 | $response = $client->indices()->updateAliases($params);
18 | ----
19 |
--------------------------------------------------------------------------------
/docs/examples/d3088d5fa59b3ab110f64fb4f9b0065c.asciidoc:
--------------------------------------------------------------------------------
1 | // query-dsl/terms-query.asciidoc:145
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'my_index',
7 | 'id' => '1',
8 | 'body' => [
9 | 'color' => [
10 | 'blue',
11 | 'green',
12 | ],
13 | ],
14 | ];
15 | $response = $client->index($params);
16 | ----
17 |
--------------------------------------------------------------------------------
/docs/examples/d31062ff8c015387889fed4ad86fd914.asciidoc:
--------------------------------------------------------------------------------
1 | // query-dsl/wildcard-query.asciidoc:21
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'body' => [
7 | 'query' => [
8 | 'wildcard' => [
9 | 'user' => [
10 | 'value' => 'ki*y',
11 | 'boost' => 1,
12 | 'rewrite' => 'constant_score',
13 | ],
14 | ],
15 | ],
16 | ],
17 | ];
18 | $response = $client->search($params);
19 | ----
20 |
--------------------------------------------------------------------------------
/docs/examples/d4b4cefba4318caeba7480187faf2b13.asciidoc:
--------------------------------------------------------------------------------
1 | // query-dsl/term-query.asciidoc:113
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'my_index',
7 | 'id' => '1',
8 | 'body' => [
9 | 'full_text' => 'Quick Brown Foxes!',
10 | ],
11 | ];
12 | $response = $client->index($params);
13 | ----
14 |
--------------------------------------------------------------------------------
/docs/examples/d50a3c64890f88af32c6d4ef4899d82a.asciidoc:
--------------------------------------------------------------------------------
1 | // search/request/sort.asciidoc:470
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'body' => [
7 | 'sort' => [
8 | [
9 | '_geo_distance' => [
10 | 'pin.location' => '40,-70',
11 | 'order' => 'asc',
12 | 'unit' => 'km',
13 | ],
14 | ],
15 | ],
16 | 'query' => [
17 | 'term' => [
18 | 'user' => 'kimchy',
19 | ],
20 | ],
21 | ],
22 | ];
23 | $response = $client->search($params);
24 | ----
25 |
--------------------------------------------------------------------------------
/docs/examples/d5dcddc6398b473b6ad9bce5c6adf986.asciidoc:
--------------------------------------------------------------------------------
1 | // search/request/scroll.asciidoc:95
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'body' => [
7 | 'sort' => [
8 | '_doc',
9 | ],
10 | ],
11 | ];
12 | $response = $client->search($params);
13 | ----
14 |
--------------------------------------------------------------------------------
/docs/examples/d718b63cf1b6591a1d59a0cf4fd995eb.asciidoc:
--------------------------------------------------------------------------------
1 | // docs/index_.asciidoc:544
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'twitter',
7 | 'id' => '1',
8 | 'body' => [
9 | 'user' => 'kimchy',
10 | 'post_date' => '2009-11-15T14:12:12',
11 | 'message' => 'trying out Elasticsearch',
12 | ],
13 | ];
14 | $response = $client->index($params);
15 | ----
16 |
--------------------------------------------------------------------------------
/docs/examples/d8b115341da772a628a024e7d1644e73.asciidoc:
--------------------------------------------------------------------------------
1 | // docs/update-by-query.asciidoc:334
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'twitter',
7 | ];
8 | $response = $client->updateByQuery($params);
9 | ----
10 |
--------------------------------------------------------------------------------
/docs/examples/d8b2a88b5eca99d3691ad3cd40266736.asciidoc:
--------------------------------------------------------------------------------
1 | // mapping.asciidoc:147
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'my-index',
7 | 'body' => [
8 | 'mappings' => [
9 | 'properties' => [
10 | 'age' => [
11 | 'type' => 'integer',
12 | ],
13 | 'email' => [
14 | 'type' => 'keyword',
15 | ],
16 | 'name' => [
17 | 'type' => 'text',
18 | ],
19 | ],
20 | ],
21 | ],
22 | ];
23 | $response = $client->indices()->create($params);
24 | ----
25 |
--------------------------------------------------------------------------------
/docs/examples/d90a84a24a407731dfc1929ac8327746.asciidoc:
--------------------------------------------------------------------------------
1 | // docs/delete.asciidoc:131
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'twitter',
7 | 'id' => '1',
8 | ];
9 | $response = $client->delete($params);
10 | ----
11 |
--------------------------------------------------------------------------------
/docs/examples/d9474f66970c6955e24b17c7447e7b5f.asciidoc:
--------------------------------------------------------------------------------
1 | // indices/put-mapping.asciidoc:149
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'my_index',
7 | 'body' => [
8 | 'mappings' => [
9 | 'properties' => [
10 | 'name' => [
11 | 'properties' => [
12 | 'first' => [
13 | 'type' => 'text',
14 | ],
15 | ],
16 | ],
17 | ],
18 | ],
19 | ],
20 | ];
21 | $response = $client->indices()->create($params);
22 | ----
23 |
--------------------------------------------------------------------------------
/docs/examples/db6cba451ba562abe953d09ad80cc15c.asciidoc:
--------------------------------------------------------------------------------
1 | // query-dsl/query-string-query.asciidoc:333
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'body' => [
7 | 'query' => [
8 | 'query_string' => [
9 | 'query' => 'city.\*:(this AND that OR thus)',
10 | ],
11 | ],
12 | ],
13 | ];
14 | $response = $client->search($params);
15 | ----
16 |
--------------------------------------------------------------------------------
/docs/examples/de139866a220124360e5e27d1a736ea4.asciidoc:
--------------------------------------------------------------------------------
1 | // search/request/sort.asciidoc:262
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'body' => [
7 | 'query' => [
8 | 'term' => [
9 | 'product' => 'chocolate',
10 | ],
11 | ],
12 | 'sort' => [
13 | [
14 | 'offer.price' => [
15 | 'mode' => 'avg',
16 | 'order' => 'asc',
17 | 'nested' => [
18 | 'path' => 'offer',
19 | 'filter' => [
20 | 'term' => [
21 | 'offer.color' => 'blue',
22 | ],
23 | ],
24 | ],
25 | ],
26 | ],
27 | ],
28 | ],
29 | ];
30 | $response = $client->search($params);
31 | ----
32 |
--------------------------------------------------------------------------------
/docs/examples/de176bc4788ea286fff9e92418a43ea8.asciidoc:
--------------------------------------------------------------------------------
1 | // indices/aliases.asciidoc:276
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'test',
7 | ];
8 | $response = $client->indices()->create($params);
9 | $params = [
10 | 'index' => 'test_2',
11 | ];
12 | $response = $client->indices()->create($params);
13 | $params = [
14 | 'body' => [
15 | 'actions' => [
16 | [
17 | 'add' => [
18 | 'index' => 'test_2',
19 | 'alias' => 'test',
20 | ],
21 | ],
22 | [
23 | 'remove_index' => [
24 | 'index' => 'test',
25 | ],
26 | ],
27 | ],
28 | ],
29 | ];
30 | $response = $client->indices()->updateAliases($params);
31 | ----
32 |
--------------------------------------------------------------------------------
/docs/examples/dfac8d098b50aa0181161bcd17b38ef4.asciidoc:
--------------------------------------------------------------------------------
1 | // indices/update-settings.asciidoc:103
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'twitter',
7 | 'body' => [
8 | 'index' => [
9 | 'refresh_interval' => '-1',
10 | ],
11 | ],
12 | ];
13 | $response = $client->indices()->putSettings($params);
14 | ----
15 |
--------------------------------------------------------------------------------
/docs/examples/dfb1fe96d806a644214d06f9b4b87878.asciidoc:
--------------------------------------------------------------------------------
1 | // docs/delete-by-query.asciidoc:401
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'twitter',
7 | 'body' => [
8 | 'query' => [
9 | 'term' => [
10 | 'user' => 'kimchy',
11 | ],
12 | ],
13 | ],
14 | ];
15 | $response = $client->deleteByQuery($params);
16 | ----
17 |
--------------------------------------------------------------------------------
/docs/examples/dfef545b1e2c247bafd1347e8e807ac1.asciidoc:
--------------------------------------------------------------------------------
1 | // indices/create-index.asciidoc:123
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'test',
7 | 'body' => [
8 | 'settings' => [
9 | 'number_of_shards' => 1,
10 | ],
11 | 'mappings' => [
12 | 'properties' => [
13 | 'field1' => [
14 | 'type' => 'text',
15 | ],
16 | ],
17 | ],
18 | ],
19 | ];
20 | $response = $client->indices()->create($params);
21 | ----
22 |
--------------------------------------------------------------------------------
/docs/examples/e0d6e02b998bdea99c9c08dcc3630c5e.asciidoc:
--------------------------------------------------------------------------------
1 | // query-dsl/match-query.asciidoc:18
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'body' => [
7 | 'query' => [
8 | 'match' => [
9 | 'message' => [
10 | 'query' => 'this is a test',
11 | ],
12 | ],
13 | ],
14 | ],
15 | ];
16 | $response = $client->search($params);
17 | ----
18 |
--------------------------------------------------------------------------------
/docs/examples/e17e8852ec3f31781e1364f4dffeb6d0.asciidoc:
--------------------------------------------------------------------------------
1 | // query-dsl/query-string-query.asciidoc:281
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'body' => [
7 | 'query' => [
8 | 'query_string' => [
9 | 'query' => '(content:this OR name:this) AND (content:that OR name:that)',
10 | ],
11 | ],
12 | ],
13 | ];
14 | $response = $client->search($params);
15 | ----
16 |
--------------------------------------------------------------------------------
/docs/examples/e21e1c26dc8687e7bf7bd2bf019a6698.asciidoc:
--------------------------------------------------------------------------------
1 | // docs/delete-by-query.asciidoc:356
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'twitter',
7 | 'body' => [
8 | 'query' => [
9 | 'match_all' => [
10 | ],
11 | ],
12 | ],
13 | ];
14 | $response = $client->deleteByQuery($params);
15 | ----
16 |
--------------------------------------------------------------------------------
/docs/examples/e270f3f721a5712cd11a5ca03554f5b0.asciidoc:
--------------------------------------------------------------------------------
1 | // query-dsl/multi-match-query.asciidoc:170
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'body' => [
7 | 'query' => [
8 | 'multi_match' => [
9 | 'query' => 'Will Smith',
10 | 'type' => 'best_fields',
11 | 'fields' => [
12 | 'first_name',
13 | 'last_name',
14 | ],
15 | 'operator' => 'and',
16 | ],
17 | ],
18 | ],
19 | ];
20 | $response = $client->search($params);
21 | ----
22 |
--------------------------------------------------------------------------------
/docs/examples/e2a042c629429855c3bcaefffb26b7fa.asciidoc:
--------------------------------------------------------------------------------
1 | // mapping/types/date.asciidoc:77
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'my_index',
7 | 'body' => [
8 | 'mappings' => [
9 | 'properties' => [
10 | 'date' => [
11 | 'type' => 'date',
12 | 'format' => 'yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||epoch_millis',
13 | ],
14 | ],
15 | ],
16 | ],
17 | ];
18 | $response = $client->indices()->create($params);
19 | ----
20 |
--------------------------------------------------------------------------------
/docs/examples/e30ea6e3823a139d7693d8cce1920a06.asciidoc:
--------------------------------------------------------------------------------
1 | // query-dsl/multi-match-query.asciidoc:50
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'body' => [
7 | 'query' => [
8 | 'multi_match' => [
9 | 'query' => 'this is a test',
10 | 'fields' => [
11 | 'subject^3',
12 | 'message',
13 | ],
14 | ],
15 | ],
16 | ],
17 | ];
18 | $response = $client->search($params);
19 | ----
20 |
--------------------------------------------------------------------------------
/docs/examples/e4be53736bcc02b03068fd72fdbfe271.asciidoc:
--------------------------------------------------------------------------------
1 | // indices/put-mapping.asciidoc:97
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'publications',
7 | 'body' => [
8 | 'properties' => [
9 | 'title' => [
10 | 'type' => 'text',
11 | ],
12 | ],
13 | ],
14 | ];
15 | $response = $client->indices()->putMapping($params);
16 | ----
17 |
--------------------------------------------------------------------------------
/docs/examples/e567e6dbf86300142573c73789c8fce4.asciidoc:
--------------------------------------------------------------------------------
1 | // docs/reindex.asciidoc:280
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'new_twitter',
7 | ];
8 | $response = $client->search($params);
9 | ----
10 |
--------------------------------------------------------------------------------
/docs/examples/e5d2172b524332196cac0f031c043659.asciidoc:
--------------------------------------------------------------------------------
1 | // indices/create-index.asciidoc:81
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'twitter',
7 | 'body' => [
8 | 'settings' => [
9 | 'index' => [
10 | 'number_of_shards' => 3,
11 | 'number_of_replicas' => 2,
12 | ],
13 | ],
14 | ],
15 | ];
16 | $response = $client->indices()->create($params);
17 | ----
18 |
--------------------------------------------------------------------------------
/docs/examples/e5f50b31f165462d883ecbff45f74985.asciidoc:
--------------------------------------------------------------------------------
1 | // indices/templates.asciidoc:20
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'name' => 'template_1',
7 | 'body' => [
8 | 'index_patterns' => [
9 | 'te*',
10 | 'bar*',
11 | ],
12 | 'settings' => [
13 | 'number_of_shards' => 1,
14 | ],
15 | 'mappings' => [
16 | '_source' => [
17 | 'enabled' => false,
18 | ],
19 | 'properties' => [
20 | 'host_name' => [
21 | 'type' => 'keyword',
22 | ],
23 | 'created_at' => [
24 | 'type' => 'date',
25 | 'format' => 'EEE MMM dd HH:mm:ss Z yyyy',
26 | ],
27 | ],
28 | ],
29 | ],
30 | ];
31 | $response = $client->indices()->putTemplate($params);
32 | ----
33 |
--------------------------------------------------------------------------------
/docs/examples/e8e451bc8c45bcf16df43804c4fc8329.asciidoc:
--------------------------------------------------------------------------------
1 | // search/request/sort.asciidoc:597
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'body' => [
7 | 'track_scores' => true,
8 | 'sort' => [
9 | [
10 | 'post_date' => [
11 | 'order' => 'desc',
12 | ],
13 | ],
14 | [
15 | 'name' => 'desc',
16 | ],
17 | [
18 | 'age' => 'desc',
19 | ],
20 | ],
21 | 'query' => [
22 | 'term' => [
23 | 'user' => 'kimchy',
24 | ],
25 | ],
26 | ],
27 | ];
28 | $response = $client->search($params);
29 | ----
30 |
--------------------------------------------------------------------------------
/docs/examples/e9c2e15b36372d5281c879d336322b6c.asciidoc:
--------------------------------------------------------------------------------
1 | // docs/reindex.asciidoc:683
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'body' => [
7 | 'source' => [
8 | 'index' => 'twitter',
9 | '_source' => [
10 | 'user',
11 | '_doc',
12 | ],
13 | ],
14 | 'dest' => [
15 | 'index' => 'new_twitter',
16 | ],
17 | ],
18 | ];
19 | $response = $client->reindex($params);
20 | ----
21 |
--------------------------------------------------------------------------------
/docs/examples/ea02de2dbe05091fcb0dac72c8ba5f83.asciidoc:
--------------------------------------------------------------------------------
1 | // docs/update-by-query.asciidoc:593
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'twitter',
7 | 'body' => [
8 | 'script' => [
9 | 'source' => 'ctx._source[\'extra\'] = \'test\'',
10 | ],
11 | ],
12 | ];
13 | $response = $client->updateByQuery($params);
14 | ----
15 |
--------------------------------------------------------------------------------
/docs/examples/eb30ba547e4a7b8f54f33ab259aca523.asciidoc:
--------------------------------------------------------------------------------
1 | // docs/update.asciidoc:153
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'test',
7 | 'id' => '1',
8 | 'body' => [
9 | 'script' => 'ctx._source.new_field = \'value_of_new_field\'',
10 | ],
11 | ];
12 | $response = $client->update($params);
13 | ----
14 |
--------------------------------------------------------------------------------
/docs/examples/ebb6b59fbc9325c17e45f524602d6be2.asciidoc:
--------------------------------------------------------------------------------
1 | // docs/delete-by-query.asciidoc:10
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'twitter',
7 | 'body' => [
8 | 'query' => [
9 | 'match' => [
10 | 'message' => 'some message',
11 | ],
12 | ],
13 | ],
14 | ];
15 | $response = $client->deleteByQuery($params);
16 | ----
17 |
--------------------------------------------------------------------------------
/docs/examples/ec27afee074001b0e4e393611010842b.asciidoc:
--------------------------------------------------------------------------------
1 | // query-dsl/function-score-query.asciidoc:380
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'body' => [
7 | 'query' => [
8 | 'function_score' => [
9 | 'gauss' => [
10 | 'date' => [
11 | 'origin' => '2013-09-17',
12 | 'scale' => '10d',
13 | 'offset' => '5d',
14 | 'decay' => 0.5,
15 | ],
16 | ],
17 | ],
18 | ],
19 | ],
20 | ];
21 | $response = $client->search($params);
22 | ----
23 |
--------------------------------------------------------------------------------
/docs/examples/ec473de07fe89bcbac1f8e278617fe46.asciidoc:
--------------------------------------------------------------------------------
1 | // query-dsl/function-score-query.asciidoc:137
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'body' => [
7 | 'query' => [
8 | 'function_score' => [
9 | 'query' => [
10 | 'match' => [
11 | 'message' => 'elasticsearch',
12 | ],
13 | ],
14 | 'script_score' => [
15 | 'script' => [
16 | 'source' => 'Math.log(2 + doc[\'likes\'].value)',
17 | ],
18 | ],
19 | ],
20 | ],
21 | ],
22 | ];
23 | $response = $client->search($params);
24 | ----
25 |
--------------------------------------------------------------------------------
/docs/examples/ef0f4fa4272c47ff62fb7b422cf975e7.asciidoc:
--------------------------------------------------------------------------------
1 | // search/request/sort.asciidoc:345
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'body' => [
7 | 'sort' => [
8 | [
9 | 'price' => [
10 | 'missing' => '_last',
11 | ],
12 | ],
13 | ],
14 | 'query' => [
15 | 'term' => [
16 | 'product' => 'chocolate',
17 | ],
18 | ],
19 | ],
20 | ];
21 | $response = $client->search($params);
22 | ----
23 |
--------------------------------------------------------------------------------
/docs/examples/ef9111c1648d7820925f12e07d1346c5.asciidoc:
--------------------------------------------------------------------------------
1 | // mapping/params/fielddata.asciidoc:56
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'my_index',
7 | 'body' => [
8 | 'mappings' => [
9 | 'properties' => [
10 | 'my_field' => [
11 | 'type' => 'text',
12 | 'fields' => [
13 | 'keyword' => [
14 | 'type' => 'keyword',
15 | ],
16 | ],
17 | ],
18 | ],
19 | ],
20 | ],
21 | ];
22 | $response = $client->indices()->create($params);
23 | ----
24 |
--------------------------------------------------------------------------------
/docs/examples/f085fb032dae56a3b104ab874eaea2ad.asciidoc:
--------------------------------------------------------------------------------
1 | // aggregations/bucket/terms-aggregation.asciidoc:748
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'body' => [
7 | 'aggs' => [
8 | 'tags' => [
9 | 'terms' => [
10 | 'field' => 'tags',
11 | 'missing' => 'N/A',
12 | ],
13 | ],
14 | ],
15 | ],
16 | ];
17 | $response = $client->search($params);
18 | ----
19 |
--------------------------------------------------------------------------------
/docs/examples/f0e21e03a07c8fa0209b0aafdb3791e6.asciidoc:
--------------------------------------------------------------------------------
1 | // indices/aliases.asciidoc:222
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'body' => [
7 | 'actions' => [
8 | [
9 | 'add' => [
10 | 'index' => 'test1',
11 | 'alias' => 'alias1',
12 | ],
13 | ],
14 | [
15 | 'add' => [
16 | 'index' => 'test2',
17 | 'alias' => 'alias1',
18 | ],
19 | ],
20 | ],
21 | ],
22 | ];
23 | $response = $client->indices()->updateAliases($params);
24 | ----
25 |
--------------------------------------------------------------------------------
/docs/examples/f2d68493abd3ca430bd03a7f7f8d18f9.asciidoc:
--------------------------------------------------------------------------------
1 | // query-dsl/query-string-query.asciidoc:265
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'body' => [
7 | 'query' => [
8 | 'query_string' => [
9 | 'fields' => [
10 | 'content',
11 | 'name',
12 | ],
13 | 'query' => 'this AND that',
14 | ],
15 | ],
16 | ],
17 | ];
18 | $response = $client->search($params);
19 | ----
20 |
--------------------------------------------------------------------------------
/docs/examples/f32f0c19b42de3b87dd764fe4ca17e7c.asciidoc:
--------------------------------------------------------------------------------
1 | // query-dsl/query-string-query.asciidoc:418
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'body' => [
7 | 'query' => [
8 | 'query_string' => [
9 | 'default_field' => 'title',
10 | 'query' => 'ny city',
11 | 'auto_generate_synonyms_phrase_query' => false,
12 | ],
13 | ],
14 | ],
15 | ];
16 | $response = $client->search($params);
17 | ----
18 |
--------------------------------------------------------------------------------
/docs/examples/f4a1008b3f9baa67bb03ce9ef5ab4cb4.asciidoc:
--------------------------------------------------------------------------------
1 | // search/request/sort.asciidoc:180
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'index_double',
7 | 'body' => [
8 | 'mappings' => [
9 | 'properties' => [
10 | 'field' => [
11 | 'type' => 'date',
12 | ],
13 | ],
14 | ],
15 | ],
16 | ];
17 | $response = $client->indices()->create($params);
18 | ----
19 |
--------------------------------------------------------------------------------
/docs/examples/f6b5032bf27c2445d28845be0d413970.asciidoc:
--------------------------------------------------------------------------------
1 | // search/request/sort.asciidoc:134
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'index_long',
7 | 'body' => [
8 | 'mappings' => [
9 | 'properties' => [
10 | 'field' => [
11 | 'type' => 'long',
12 | ],
13 | ],
14 | ],
15 | ],
16 | ];
17 | $response = $client->indices()->create($params);
18 | ----
19 |
--------------------------------------------------------------------------------
/docs/examples/f6d6889667f56b8f49d2858070571a6b.asciidoc:
--------------------------------------------------------------------------------
1 | // indices/aliases.asciidoc:415
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'body' => [
7 | 'actions' => [
8 | [
9 | 'add' => [
10 | 'index' => 'test',
11 | 'alias' => 'alias1',
12 | 'is_write_index' => true,
13 | ],
14 | ],
15 | [
16 | 'add' => [
17 | 'index' => 'test2',
18 | 'alias' => 'alias1',
19 | ],
20 | ],
21 | ],
22 | ],
23 | ];
24 | $response = $client->indices()->updateAliases($params);
25 | ----
26 |
--------------------------------------------------------------------------------
/docs/examples/f70a54cd9a9f4811bf962e469f2ca2ea.asciidoc:
--------------------------------------------------------------------------------
1 | // query-dsl/bool-query.asciidoc:88
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'body' => [
7 | 'query' => [
8 | 'bool' => [
9 | 'filter' => [
10 | 'term' => [
11 | 'status' => 'active',
12 | ],
13 | ],
14 | ],
15 | ],
16 | ],
17 | ];
18 | $response = $client->search($params);
19 | ----
20 |
--------------------------------------------------------------------------------
/docs/examples/f8cc4b331a19ff4df8e4a490f906ee69.asciidoc:
--------------------------------------------------------------------------------
1 | // getting-started.asciidoc:167
2 |
3 | [source, php]
4 | ----
5 | $response = $client->cat()->health();
6 | ----
7 |
--------------------------------------------------------------------------------
/docs/examples/f9636d7ef1a45be4f36418c875cf6bef.asciidoc:
--------------------------------------------------------------------------------
1 | // docs/update.asciidoc:296
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'sessions',
7 | 'id' => 'dh3sgudg8gsrgl',
8 | 'body' => [
9 | 'scripted_upsert' => true,
10 | 'script' => [
11 | 'id' => 'my_web_session_summariser',
12 | 'params' => [
13 | 'pageViewEvent' => [
14 | 'url' => 'foo.com/bar',
15 | 'response' => 404,
16 | 'time' => '2014-01-01 12:32',
17 | ],
18 | ],
19 | ],
20 | 'upsert' => [
21 | ],
22 | ],
23 | ];
24 | $response = $client->update($params);
25 | ----
26 |
--------------------------------------------------------------------------------
/docs/examples/fa0f4485cd48f986b7ae8cbb24e331c4.asciidoc:
--------------------------------------------------------------------------------
1 | // indices/aliases.asciidoc:368
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'body' => [
7 | 'actions' => [
8 | [
9 | 'add' => [
10 | 'index' => 'test',
11 | 'alias' => 'alias2',
12 | 'search_routing' => '1,2',
13 | 'index_routing' => '2',
14 | ],
15 | ],
16 | ],
17 | ],
18 | ];
19 | $response = $client->indices()->updateAliases($params);
20 | ----
21 |
--------------------------------------------------------------------------------
/docs/examples/fa2fe60f570bd930d2891778c6efbfe6.asciidoc:
--------------------------------------------------------------------------------
1 | // query-dsl/match-query.asciidoc:150
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'body' => [
7 | 'query' => [
8 | 'match' => [
9 | 'message' => 'this is a test',
10 | ],
11 | ],
12 | ],
13 | ];
14 | $response = $client->search($params);
15 | ----
16 |
--------------------------------------------------------------------------------
/docs/examples/fa88f6f5a7d728ec4f1d05244228cb09.asciidoc:
--------------------------------------------------------------------------------
1 | // query-dsl/bool-query.asciidoc:107
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'body' => [
7 | 'query' => [
8 | 'bool' => [
9 | 'must' => [
10 | 'match_all' => [
11 | ],
12 | ],
13 | 'filter' => [
14 | 'term' => [
15 | 'status' => 'active',
16 | ],
17 | ],
18 | ],
19 | ],
20 | ],
21 | ];
22 | $response = $client->search($params);
23 | ----
24 |
--------------------------------------------------------------------------------
/docs/examples/fabe14480624a99e8ee42c7338672058.asciidoc:
--------------------------------------------------------------------------------
1 | // indices/create-index.asciidoc:203
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'test',
7 | ];
8 | $response = $client->indices()->create($params);
9 | ----
10 |
--------------------------------------------------------------------------------
/docs/examples/fbcf5078a6a9e09790553804054c36b3.asciidoc:
--------------------------------------------------------------------------------
1 | // docs/get.asciidoc:224
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'twitter',
7 | 'id' => '0',
8 | ];
9 | $response = $client->get($params);
10 | ----
11 |
--------------------------------------------------------------------------------
/docs/examples/fdcaba9547180439ff4b6275034a5170.asciidoc:
--------------------------------------------------------------------------------
1 | // search/request/scroll.asciidoc:268
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'twitter',
7 | 'body' => [
8 | 'slice' => [
9 | 'field' => 'date',
10 | 'id' => 0,
11 | 'max' => 10,
12 | ],
13 | 'query' => [
14 | 'match' => [
15 | 'title' => 'elasticsearch',
16 | ],
17 | ],
18 | ],
19 | ];
20 | $response = $client->search($params);
21 | ----
22 |
--------------------------------------------------------------------------------
/docs/examples/fdd38f0d248385a444c777e7acd97846.asciidoc:
--------------------------------------------------------------------------------
1 | // query-dsl/query-string-query.asciidoc:496
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'body' => [
7 | 'query' => [
8 | 'query_string' => [
9 | 'fields' => [
10 | 'title',
11 | 'content',
12 | ],
13 | 'query' => 'this OR that OR thus',
14 | 'minimum_should_match' => 2,
15 | ],
16 | ],
17 | ],
18 | ];
19 | $response = $client->search($params);
20 | ----
21 |
--------------------------------------------------------------------------------
/docs/examples/fe5763d32955e8b65eb3048e97b1580c.asciidoc:
--------------------------------------------------------------------------------
1 | // indices/update-settings.asciidoc:133
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'twitter',
7 | ];
8 | $response = $client->indices()->forcemerge($params);
9 | ----
10 |
--------------------------------------------------------------------------------
/docs/examples/feefeb68144002fd1fff57b77b95b85e.asciidoc:
--------------------------------------------------------------------------------
1 | // getting-started.asciidoc:578
2 |
3 | [source, php]
4 | ----
5 | $params = [
6 | 'index' => 'bank',
7 | 'body' => [
8 | 'size' => 0,
9 | 'aggs' => [
10 | 'group_by_state' => [
11 | 'terms' => [
12 | 'field' => 'state.keyword',
13 | ],
14 | ],
15 | ],
16 | ],
17 | ];
18 | $response = $client->search($params);
19 | ----
20 |
--------------------------------------------------------------------------------
/docs/reference/client-helpers.md:
--------------------------------------------------------------------------------
1 | ---
2 | mapped_pages:
3 | - https://www.elastic.co/guide/en/elasticsearch/client/php-api/current/client-helpers.html
4 | ---
5 |
6 | # Client helpers [client-helpers]
7 |
8 | The PHP client comes with the following helpers:
9 |
10 | * [Iterators](/reference/iterators.md)
11 | * [ES|QL](/reference/esql.md)
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/docs/reference/deleting_documents.md:
--------------------------------------------------------------------------------
1 | ---
2 | mapped_pages:
3 | - https://www.elastic.co/guide/en/elasticsearch/client/php-api/current/deleting_documents.html
4 | ---
5 |
6 | # Deleting documents [deleting_documents]
7 |
8 | Finally, you can delete documents by specifying their full `/index/_doc_/id` path:
9 |
10 | ```php
11 | $params = [
12 | 'index' => 'my_index',
13 | 'id' => 'my_id'
14 | ];
15 |
16 | // Delete doc at /my_index/_doc_/my_id
17 | $response = $client->delete($params);
18 | ```
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/docs/reference/getting_documents.md:
--------------------------------------------------------------------------------
1 | ---
2 | mapped_pages:
3 | - https://www.elastic.co/guide/en/elasticsearch/client/php-api/current/getting_documents.html
4 | ---
5 |
6 | # Getting documents [getting_documents]
7 |
8 | {{es}} provides realtime GETs of documents. This means that as soon as the document is indexed and your client receives an acknowledgement, you can immediately retrieve the document from any shard. Get operations are performed by requesting a document by its full `index/type/id` path:
9 |
10 | ```php
11 | $params = [
12 | 'index' => 'my_index',
13 | 'id' => 'my_id'
14 | ];
15 |
16 | // Get doc at /my_index/_doc/my_id
17 | $response = $client->get($params);
18 | ```
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/docs/reference/images/api_key_name.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/elastic/elasticsearch-php/62d4bb5248a5f68e2e55322d0ecdd081630886d2/docs/reference/images/api_key_name.png
--------------------------------------------------------------------------------
/docs/reference/images/cloud_api_key.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/elastic/elasticsearch-php/62d4bb5248a5f68e2e55322d0ecdd081630886d2/docs/reference/images/cloud_api_key.png
--------------------------------------------------------------------------------
/docs/reference/images/cloud_id.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/elastic/elasticsearch-php/62d4bb5248a5f68e2e55322d0ecdd081630886d2/docs/reference/images/cloud_id.png
--------------------------------------------------------------------------------
/docs/reference/images/create_api_key.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/elastic/elasticsearch-php/62d4bb5248a5f68e2e55322d0ecdd081630886d2/docs/reference/images/create_api_key.png
--------------------------------------------------------------------------------
/docs/reference/images/es_endpoint.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/elastic/elasticsearch-php/62d4bb5248a5f68e2e55322d0ecdd081630886d2/docs/reference/images/es_endpoint.jpg
--------------------------------------------------------------------------------
/docs/reference/toc.yml:
--------------------------------------------------------------------------------
1 | toc:
2 | - file: index.md
3 | - file: getting-started.md
4 | - file: installation.md
5 | - file: connecting.md
6 | - file: configuration.md
7 | children:
8 | - file: php_json_objects.md
9 | - file: host-config.md
10 | - file: set-retries.md
11 | - file: http-meta-data.md
12 | - file: enabling_logger.md
13 | - file: http-client.md
14 | - file: namespaces.md
15 | - file: node_pool.md
16 | - file: operations.md
17 | children:
18 | - file: index_management.md
19 | - file: search_operations.md
20 | - file: indexing_documents.md
21 | - file: getting_documents.md
22 | - file: updating_documents.md
23 | - file: deleting_documents.md
24 | - file: client-helpers.md
25 | children:
26 | - file: iterators.md
27 | - file: esql.md
--------------------------------------------------------------------------------
/docs/release-notes/known-issues.md:
--------------------------------------------------------------------------------
1 | ---
2 | navigation_title: "Known issues"
3 |
4 | ---
5 |
6 | # Elasticsearch PHP Client known issues [elasticsearch-php-client-known-issues]
7 |
8 | ## 9.0.0
9 |
10 | _No known issues_
11 |
12 | % Use the following template to add entries to this page.
13 |
14 | % :::{dropdown} Title of known issue
15 | % **Details**
16 | % On [Month/Day/Year], a known issue was discovered that [description of known issue].
17 |
18 | % **Workaround**
19 | % Workaround description.
20 |
21 | % **Resolved**
22 | % On [Month/Day/Year], this issue was resolved.
23 |
24 | :::
--------------------------------------------------------------------------------
/docs/release-notes/toc.yml:
--------------------------------------------------------------------------------
1 | toc:
2 | - file: index.md
3 | - file: known-issues.md
4 | - file: breaking-changes.md
5 | - file: deprecations.md
--------------------------------------------------------------------------------
/phpunit-integration-cloud-tests.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | src
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 | tests/Integration
14 |
15 |
16 |
17 |
18 | cloud
19 |
20 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/phpunit-yaml-serverless-tests.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | tests/Yaml
9 |
10 |
11 |
12 |
13 | serverless
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 | src
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/phpunit-yaml-stack-tests.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | tests/Yaml
9 |
10 |
11 |
12 |
13 | stack
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 | src
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/src/Endpoints/AbstractEndpoint.php:
--------------------------------------------------------------------------------
1 | client = $client;
29 | }
30 | }
--------------------------------------------------------------------------------
/src/Exception/ArrayAccessException.php:
--------------------------------------------------------------------------------
1 | response = $response;
26 | return $this;
27 | }
28 |
29 | public function getResponse(): ResponseInterface
30 | {
31 | return $this->response;
32 | }
33 | }
--------------------------------------------------------------------------------
/src/Transport/Adapter/AdapterInterface.php:
--------------------------------------------------------------------------------
1 |