From 2c6181e0308a681aefada4c694a4fa1bd8ac1a8c Mon Sep 17 00:00:00 2001 From: Miguel Grinberg Date: Fri, 9 Aug 2024 12:26:34 +0100 Subject: [PATCH 1/2] Release 8.15.0 --- .../00fea15cbca83be9d5f1a024ff2ec708.asciidoc | 18 ----- .../0db06c3cba57cf442ac7fab89966e1e1.asciidoc | 4 +- .../0e5d25c7bb738c42d471020d678e2966.asciidoc | 2 +- .../0e5db64154a722a5cbdb84b588ce2ce8.asciidoc | 2 +- .../10535507a9735fcf06600444b9067d4c.asciidoc | 2 +- .../10c3fe2265bb34964bd1005f9da66773.asciidoc | 18 ----- .../1233be1d4c9c7ca54126f1a0693b26de.asciidoc | 4 +- .../13ecdf99114098c76b050397d9c3d4e6.asciidoc | 2 +- .../156bc64c94f9f3334fbce25165d2286a.asciidoc | 2 +- .../197dc41c8df9629e145b3064c63b2ccc.asciidoc | 19 ------ .../19f1f9f25933f8e7aba59a10881c648b.asciidoc | 19 ++++++ .../1e0f203aced9344382081ab095c44dde.asciidoc | 2 +- .../1fcc4a3280be399753dcfd5c489ff682.asciidoc | 27 ++++++++ .../2646710ece0c4c843aebeacd370d0396.asciidoc | 2 +- .../2826510e4aeb1c0d8dc43d317ed7624a.asciidoc | 2 +- .../2932e6f71e247cf52e11d2f38f114ddf.asciidoc | 2 +- .../2c090fe7ec7b66b3f5c178d71c46323b.asciidoc | 4 +- .../2fe28d9a91b3081a9ec4601af8fb7b1c.asciidoc | 4 +- .../3541d4a85e27b2c3896a7a7ee98b4b37.asciidoc | 2 +- .../36063ff9a318dba7bb0be3a230655dc8.asciidoc | 2 +- .../36b86b97feedcf5632824eefc251d6ed.asciidoc | 10 --- .../36d229f734adcdab00be266a7ce038b1.asciidoc | 20 ++++++ .../36da9668fef56910370f16bfb772cc40.asciidoc | 2 +- .../38ba93890494bfa7beece58dffa44f98.asciidoc | 18 +++++ .../39ce44333d28ed2b833722d3e3cb06f3.asciidoc | 2 +- .../3eb4cdd4a799a117ac1ff5f02b18a512.asciidoc | 2 +- .../3f3b3e207f79303ce6f86e03e928e062.asciidoc | 10 --- .../4955bae30f265b9e436f82b015de6d7e.asciidoc | 2 +- .../4982c547be1ad9455ae836990aea92c5.asciidoc | 17 +++++ .../4bef98a2dac575a50ee0783c2269f1db.asciidoc | 20 ++++++ .../4c95d54b32df4dc49e9762b6c1ae2c05.asciidoc | 2 +- .../4ca15672fc5ab1d80a127d086b6d2837.asciidoc | 2 +- .../4e3414fc712b16311f9e433dd366f49d.asciidoc | 4 +- .../51390ca10aa22d7104e8970f09ea4512.asciidoc | 24 +++++++ .../51b40610ae05730b4c6afd25647d7ae0.asciidoc | 4 +- .../5553cf7a02c22f616cd994747f2dd5a5.asciidoc | 2 +- .../5837d5f50665ac0a26181d3aaeb3f204.asciidoc | 2 +- .../59d736a4d064ed2013c7ead8e32e0998.asciidoc | 17 ----- .../5b8119b4d9a09f4643be5a5b40875c8f.asciidoc | 4 +- .../5db5349162a4fbe74bffb646926a2495.asciidoc | 22 ++++++ ...62c311e7ab4de8b79e532929a5069975.asciidoc} | 6 ++ .../633c8a9fc57268979d8735c557705809.asciidoc | 2 +- .../63d1c07d22a3ca3b0ec6d950547c011c.asciidoc | 2 +- .../63ecdab34940af053acc409164914c32.asciidoc | 67 +++++++++++++++++++ .../6cd083045bf06e80b83889a939a18451.asciidoc | 2 +- .../7011fcdd231804f9c3894154ae2c3fbc.asciidoc | 2 +- .../70cc66bf4054ebf0ad4955cb99d9ab80.asciidoc | 2 +- .../73be1f93d789264e5b972ddb5991bc66.asciidoc | 2 +- .../7429b16221fe741fd31b0584786dd0b0.asciidoc | 14 ++++ .../746e0a1cb5984f2672963b363505c7b3.asciidoc | 2 +- .../75e229852d1404040bb2e83723c0f1db.asciidoc | 10 --- .../7709a48020a6cefbbe547fb944541cdb.asciidoc | 16 +++++ .../77113c65e1755313183a8969233a5a07.asciidoc | 2 +- .../77b90f6787195767b6da60d8532714b4.asciidoc | 19 ------ .../77d0780c5faea4c9ec51a322a6811b3b.asciidoc | 2 +- .../794d9a321b944347d2a8834a07b5eb22.asciidoc | 22 ++++++ .../7a0eb2222fe282d3aab66e12feff2a3b.asciidoc | 6 +- .../7a2b9a7b2b6553a48bd4db60a939c0fc.asciidoc | 2 +- .../7c24d4bef3f2045407fbf1b95c5416f9.asciidoc | 2 +- .../7fef68840761c6982c14ad7af96caf37.asciidoc | 2 +- .../8575c966b004fb124c7afd6bb5827b50.asciidoc | 15 ----- .../858fde15fb0a0340873b123043f8c3b4.asciidoc | 2 +- .../8593715fcc70315a0816b435551258e0.asciidoc | 20 ++++++ .../8619bd17bbfe33490b1f277007f654db.asciidoc | 18 ----- .../873fbbc6ab81409058591385fd602736.asciidoc | 2 +- .../87416e6a1ca2da324dbed6deb05303eb.asciidoc | 2 +- .../87733deeea4b441b595d19a0f97346f0.asciidoc | 2 +- .../8d7193902a353872740a3324c60c5001.asciidoc | 2 +- .../8e286a205a1f84f888a6d99f2620c80e.asciidoc | 2 +- .../8e68cdfad45e7e6dff254d931eea29d4.asciidoc | 2 +- .../90112d594b934c0111b7303b9f91cb7f.asciidoc | 11 --- .../90631797c7fbda43902abf2cc0ea8304.asciidoc | 2 +- .../926c0134aeaad53bd0f3bdad9c430217.asciidoc | 2 +- .../937ffc65cbb20505a8aba25b37a796a5.asciidoc | 2 +- .../93bd651aff81daa2b86f9f2089e6d088.asciidoc | 4 +- .../97babc8d19ef0866774576716eb6d19e.asciidoc | 2 +- .../9a02bd47c000a3d9a8911233c37c890f.asciidoc | 4 +- .../9a203aae3e1412d919546276fb52a5ca.asciidoc | 18 ----- .../9a4d5e41c52c20635d1fd9c6e13f6c7a.asciidoc | 4 +- .../9cfbc41bb7b6fbdb26550dd2789c274e.asciidoc | 2 +- .../9d79645ab3a9da3f63c54a1516214a5a.asciidoc | 2 +- .../9de4ea9d5f3d427a71ee07d998cb5611.asciidoc | 2 +- .../9e0e3ce27967f164f4585c5231ba9c75.asciidoc | 2 +- .../9f16fca9813304e398ee052aa857dbcd.asciidoc | 17 ----- .../a4a3c3cd09efa75168dab90105afb2e9.asciidoc | 2 +- .../aa6282d4bc92c753c4bd7a5b166abece.asciidoc | 2 +- .../ad57ccba0a060da4f5313692fa26a235.asciidoc | 2 +- .../afef5cac988592b97ae289ab39c2f437.asciidoc | 2 +- .../b14122481ae1f158f1a9a1bfbc4a41b1.asciidoc | 2 +- .../b45a8c6fc746e9c90fd181e69a605fad.asciidoc | 2 +- .../b6f690896001f8f9ad5bf24e1304a552.asciidoc | 21 ++++++ .../b7a9f60b3646efe3834ca8381f8aa560.asciidoc | 2 +- .../bb975b342de7e838ebf6a36aaa1a8749.asciidoc | 2 +- .../bcc75fc01b45e482638c65b8fbdf09fa.asciidoc | 9 --- .../bd7330af2609bdd8aa10958f5e640b93.asciidoc | 2 +- .../be5b415d7f33d6f0397ac2f8b5c10521.asciidoc | 2 +- .../be5c5a9c25901737585e4fff9195da3c.asciidoc | 18 +++++ .../bed14cc152522ca0726ac3746ebc31db.asciidoc | 2 +- .../c1a895497066a3dac674d4b1a119048d.asciidoc | 2 +- .../c1bb395546102279296534522061829f.asciidoc | 2 +- .../c6151a0788a10a7f40da684d72c3255c.asciidoc | 2 +- .../cda045dfd79acd160ed8668f2ee17ea7.asciidoc | 2 +- .../ce2c2e8f5a2e4daf051b6e10122e5aae.asciidoc | 18 +++++ .../cedb56a71cc743d80263ce352bb21720.asciidoc | 14 ---- .../d04f0c8c44e8b4fb55f2e7d9d05977e7.asciidoc | 45 ------------- .../d4fb482a51d67a1af48e429af6019a46.asciidoc | 2 +- .../d7919fb6f4d02dde1390775eb8365b79.asciidoc | 2 +- .../df34c8ebaaa59a3ee0e3f28e2443bc30.asciidoc | 6 +- .../dfce1be1d035aff0b8fdf4a8839f7795.asciidoc | 16 +++++ .../e1f6ea7c0937cf7e6ea7e8209e52e8bb.asciidoc | 2 +- .../ed688d86eeaa4d7969acb0f574eb917f.asciidoc | 2 +- .../eee6110831c08b9c1b3f56b24656e95b.asciidoc | 17 ----- .../f09817fd13ff3dce52eb79d0722409c3.asciidoc | 2 +- .../f1b24217b1d9ba6ea5e4fa6e6f412022.asciidoc | 2 +- .../f38262ef72f73816ec35fa4c9c85760d.asciidoc | 29 ++++++++ .../f9cb2547ab04461a12bfd25a35be5f96.asciidoc | 27 ++++++++ .../fc8a426f8a5112e61e2acb913982a8d9.asciidoc | 2 +- .../fe6a21b4a6b33cd6abc522947d6f3ea2.asciidoc | 2 +- .../fe7169bab8e626f582c9ea87585d0f35.asciidoc | 2 +- docs/guide/release-notes.asciidoc | 14 ++++ elasticsearch/_version.py | 2 +- 121 files changed, 552 insertions(+), 382 deletions(-) delete mode 100644 docs/examples/00fea15cbca83be9d5f1a024ff2ec708.asciidoc delete mode 100644 docs/examples/10c3fe2265bb34964bd1005f9da66773.asciidoc delete mode 100644 docs/examples/197dc41c8df9629e145b3064c63b2ccc.asciidoc create mode 100644 docs/examples/19f1f9f25933f8e7aba59a10881c648b.asciidoc create mode 100644 docs/examples/1fcc4a3280be399753dcfd5c489ff682.asciidoc delete mode 100644 docs/examples/36b86b97feedcf5632824eefc251d6ed.asciidoc create mode 100644 docs/examples/36d229f734adcdab00be266a7ce038b1.asciidoc create mode 100644 docs/examples/38ba93890494bfa7beece58dffa44f98.asciidoc delete mode 100644 docs/examples/3f3b3e207f79303ce6f86e03e928e062.asciidoc create mode 100644 docs/examples/4982c547be1ad9455ae836990aea92c5.asciidoc create mode 100644 docs/examples/4bef98a2dac575a50ee0783c2269f1db.asciidoc create mode 100644 docs/examples/51390ca10aa22d7104e8970f09ea4512.asciidoc delete mode 100644 docs/examples/59d736a4d064ed2013c7ead8e32e0998.asciidoc create mode 100644 docs/examples/5db5349162a4fbe74bffb646926a2495.asciidoc rename docs/examples/{c725c72ead2dae0205a5a34a50d7ad83.asciidoc => 62c311e7ab4de8b79e532929a5069975.asciidoc} (90%) create mode 100644 docs/examples/63ecdab34940af053acc409164914c32.asciidoc create mode 100644 docs/examples/7429b16221fe741fd31b0584786dd0b0.asciidoc delete mode 100644 docs/examples/75e229852d1404040bb2e83723c0f1db.asciidoc create mode 100644 docs/examples/7709a48020a6cefbbe547fb944541cdb.asciidoc delete mode 100644 docs/examples/77b90f6787195767b6da60d8532714b4.asciidoc create mode 100644 docs/examples/794d9a321b944347d2a8834a07b5eb22.asciidoc delete mode 100644 docs/examples/8575c966b004fb124c7afd6bb5827b50.asciidoc create mode 100644 docs/examples/8593715fcc70315a0816b435551258e0.asciidoc delete mode 100644 docs/examples/8619bd17bbfe33490b1f277007f654db.asciidoc delete mode 100644 docs/examples/90112d594b934c0111b7303b9f91cb7f.asciidoc delete mode 100644 docs/examples/9a203aae3e1412d919546276fb52a5ca.asciidoc delete mode 100644 docs/examples/9f16fca9813304e398ee052aa857dbcd.asciidoc create mode 100644 docs/examples/b6f690896001f8f9ad5bf24e1304a552.asciidoc delete mode 100644 docs/examples/bcc75fc01b45e482638c65b8fbdf09fa.asciidoc create mode 100644 docs/examples/be5c5a9c25901737585e4fff9195da3c.asciidoc create mode 100644 docs/examples/ce2c2e8f5a2e4daf051b6e10122e5aae.asciidoc delete mode 100644 docs/examples/cedb56a71cc743d80263ce352bb21720.asciidoc delete mode 100644 docs/examples/d04f0c8c44e8b4fb55f2e7d9d05977e7.asciidoc create mode 100644 docs/examples/dfce1be1d035aff0b8fdf4a8839f7795.asciidoc delete mode 100644 docs/examples/eee6110831c08b9c1b3f56b24656e95b.asciidoc create mode 100644 docs/examples/f38262ef72f73816ec35fa4c9c85760d.asciidoc create mode 100644 docs/examples/f9cb2547ab04461a12bfd25a35be5f96.asciidoc diff --git a/docs/examples/00fea15cbca83be9d5f1a024ff2ec708.asciidoc b/docs/examples/00fea15cbca83be9d5f1a024ff2ec708.asciidoc deleted file mode 100644 index 4e63a4e907..0000000000 --- a/docs/examples/00fea15cbca83be9d5f1a024ff2ec708.asciidoc +++ /dev/null @@ -1,18 +0,0 @@ -// inference/put-inference.asciidoc:381 - -[source, python] ----- -resp = client.inference.put_model( - task_type="text_embedding", - inference_id="my-e5-model", - body={ - "service": "elasticsearch", - "service_settings": { - "num_allocations": 1, - "num_threads": 1, - "model_id": ".multilingual-e5-small", - }, - }, -) -print(resp) ----- \ No newline at end of file diff --git a/docs/examples/0db06c3cba57cf442ac7fab89966e1e1.asciidoc b/docs/examples/0db06c3cba57cf442ac7fab89966e1e1.asciidoc index b08ce02679..63dbade850 100644 --- a/docs/examples/0db06c3cba57cf442ac7fab89966e1e1.asciidoc +++ b/docs/examples/0db06c3cba57cf442ac7fab89966e1e1.asciidoc @@ -5,7 +5,7 @@ resp = client.index( index="my-index-000001", id="1", - refresh=True, + refresh="true", body={ "my_id": "1", "text": "This is a question", @@ -17,7 +17,7 @@ print(resp) resp = client.index( index="my-index-000001", id="2", - refresh=True, + refresh="true", body={ "my_id": "2", "text": "This is another question", diff --git a/docs/examples/0e5d25c7bb738c42d471020d678e2966.asciidoc b/docs/examples/0e5d25c7bb738c42d471020d678e2966.asciidoc index aff06a881f..dfd50fe7a1 100644 --- a/docs/examples/0e5d25c7bb738c42d471020d678e2966.asciidoc +++ b/docs/examples/0e5d25c7bb738c42d471020d678e2966.asciidoc @@ -1,4 +1,4 @@ -// ml/trained-models/apis/start-trained-model-deployment.asciidoc:173 +// ml/trained-models/apis/start-trained-model-deployment.asciidoc:200 [source, python] ---- diff --git a/docs/examples/0e5db64154a722a5cbdb84b588ce2ce8.asciidoc b/docs/examples/0e5db64154a722a5cbdb84b588ce2ce8.asciidoc index 5831d48ab9..97c6ae00bc 100644 --- a/docs/examples/0e5db64154a722a5cbdb84b588ce2ce8.asciidoc +++ b/docs/examples/0e5db64154a722a5cbdb84b588ce2ce8.asciidoc @@ -1,4 +1,4 @@ -// mapping/types/numeric.asciidoc:275 +// mapping/types/numeric.asciidoc:287 [source, python] ---- diff --git a/docs/examples/10535507a9735fcf06600444b9067d4c.asciidoc b/docs/examples/10535507a9735fcf06600444b9067d4c.asciidoc index 2e19678f8f..55a00b8fa3 100644 --- a/docs/examples/10535507a9735fcf06600444b9067d4c.asciidoc +++ b/docs/examples/10535507a9735fcf06600444b9067d4c.asciidoc @@ -1,4 +1,4 @@ -// mapping/types/text.asciidoc:181 +// mapping/types/text.asciidoc:184 [source, python] ---- diff --git a/docs/examples/10c3fe2265bb34964bd1005f9da66773.asciidoc b/docs/examples/10c3fe2265bb34964bd1005f9da66773.asciidoc deleted file mode 100644 index 08c365b91c..0000000000 --- a/docs/examples/10c3fe2265bb34964bd1005f9da66773.asciidoc +++ /dev/null @@ -1,18 +0,0 @@ -// inference/put-inference.asciidoc:488 - -[source, python] ----- -resp = client.inference.put_model( - task_type="text_embedding", - inference_id="my-msmarco-minilm-model", - body={ - "service": "elasticsearch", - "service_settings": { - "num_allocations": 1, - "num_threads": 1, - "model_id": "msmarco-MiniLM-L12-cos-v5", - }, - }, -) -print(resp) ----- \ No newline at end of file diff --git a/docs/examples/1233be1d4c9c7ca54126f1a0693b26de.asciidoc b/docs/examples/1233be1d4c9c7ca54126f1a0693b26de.asciidoc index 0aac0cbc78..081d2f47e8 100644 --- a/docs/examples/1233be1d4c9c7ca54126f1a0693b26de.asciidoc +++ b/docs/examples/1233be1d4c9c7ca54126f1a0693b26de.asciidoc @@ -6,7 +6,7 @@ resp = client.index( index="my-index-000001", id="3", routing="1", - refresh=True, + refresh="true", body={ "my_id": "3", "text": "This is an answer", @@ -19,7 +19,7 @@ resp = client.index( index="my-index-000001", id="4", routing="1", - refresh=True, + refresh="true", body={ "my_id": "4", "text": "This is another answer", diff --git a/docs/examples/13ecdf99114098c76b050397d9c3d4e6.asciidoc b/docs/examples/13ecdf99114098c76b050397d9c3d4e6.asciidoc index f3d348b3ee..c323d4b7db 100644 --- a/docs/examples/13ecdf99114098c76b050397d9c3d4e6.asciidoc +++ b/docs/examples/13ecdf99114098c76b050397d9c3d4e6.asciidoc @@ -1,4 +1,4 @@ -// inference/post-inference.asciidoc:197 +// inference/post-inference.asciidoc:201 [source, python] ---- diff --git a/docs/examples/156bc64c94f9f3334fbce25165d2286a.asciidoc b/docs/examples/156bc64c94f9f3334fbce25165d2286a.asciidoc index 52a9590577..a1d92ede74 100644 --- a/docs/examples/156bc64c94f9f3334fbce25165d2286a.asciidoc +++ b/docs/examples/156bc64c94f9f3334fbce25165d2286a.asciidoc @@ -1,4 +1,4 @@ -// index-modules/index-sorting.asciidoc:16 +// index-modules/index-sorting.asciidoc:15 [source, python] ---- diff --git a/docs/examples/197dc41c8df9629e145b3064c63b2ccc.asciidoc b/docs/examples/197dc41c8df9629e145b3064c63b2ccc.asciidoc deleted file mode 100644 index 69db46c37d..0000000000 --- a/docs/examples/197dc41c8df9629e145b3064c63b2ccc.asciidoc +++ /dev/null @@ -1,19 +0,0 @@ -// setup/run-elasticsearch-locally.asciidoc:135 - -[source, python] ----- -resp = client.bulk( - index="customer", - body=[ - {"create": {}}, - {"firstname": "Monica", "lastname": "Rambeau"}, - {"create": {}}, - {"firstname": "Carol", "lastname": "Danvers"}, - {"create": {}}, - {"firstname": "Wanda", "lastname": "Maximoff"}, - {"create": {}}, - {"firstname": "Jennifer", "lastname": "Takeda"}, - ], -) -print(resp) ----- \ No newline at end of file diff --git a/docs/examples/19f1f9f25933f8e7aba59a10881c648b.asciidoc b/docs/examples/19f1f9f25933f8e7aba59a10881c648b.asciidoc new file mode 100644 index 0000000000..64edf11563 --- /dev/null +++ b/docs/examples/19f1f9f25933f8e7aba59a10881c648b.asciidoc @@ -0,0 +1,19 @@ +// mapping/types/semantic-text.asciidoc:22 + +[source, python] +---- +resp = client.indices.create( + index="my-index-000001", + body={ + "mappings": { + "properties": { + "inference_field": { + "type": "semantic_text", + "inference_id": "my-elser-endpoint", + } + } + } + }, +) +print(resp) +---- \ No newline at end of file diff --git a/docs/examples/1e0f203aced9344382081ab095c44dde.asciidoc b/docs/examples/1e0f203aced9344382081ab095c44dde.asciidoc index 324ddb67f2..2e158c5bb6 100644 --- a/docs/examples/1e0f203aced9344382081ab095c44dde.asciidoc +++ b/docs/examples/1e0f203aced9344382081ab095c44dde.asciidoc @@ -1,4 +1,4 @@ -// mapping/types/text.asciidoc:230 +// mapping/types/text.asciidoc:233 [source, python] ---- diff --git a/docs/examples/1fcc4a3280be399753dcfd5c489ff682.asciidoc b/docs/examples/1fcc4a3280be399753dcfd5c489ff682.asciidoc new file mode 100644 index 0000000000..395e53f287 --- /dev/null +++ b/docs/examples/1fcc4a3280be399753dcfd5c489ff682.asciidoc @@ -0,0 +1,27 @@ +// mapping/types/range.asciidoc:316 + +[source, python] +---- +resp = client.indices.create( + index="idx", + body={ + "mappings": { + "_source": {"mode": "synthetic"}, + "properties": {"my_range": {"type": "ip_range"}}, + } + }, +) +print(resp) + +resp = client.index( + index="idx", + id="1", + body={ + "my_range": [ + "10.0.0.0/24", + {"gte": "10.0.0.0", "lte": "10.0.0.255"}, + ] + }, +) +print(resp) +---- \ No newline at end of file diff --git a/docs/examples/2646710ece0c4c843aebeacd370d0396.asciidoc b/docs/examples/2646710ece0c4c843aebeacd370d0396.asciidoc index 9c85877128..b6abe3c8de 100644 --- a/docs/examples/2646710ece0c4c843aebeacd370d0396.asciidoc +++ b/docs/examples/2646710ece0c4c843aebeacd370d0396.asciidoc @@ -1,4 +1,4 @@ -// mapping/types/dense-vector.asciidoc:126 +// mapping/types/dense-vector.asciidoc:137 [source, python] ---- diff --git a/docs/examples/2826510e4aeb1c0d8dc43d317ed7624a.asciidoc b/docs/examples/2826510e4aeb1c0d8dc43d317ed7624a.asciidoc index 35301e8eb9..4ae1f8e46f 100644 --- a/docs/examples/2826510e4aeb1c0d8dc43d317ed7624a.asciidoc +++ b/docs/examples/2826510e4aeb1c0d8dc43d317ed7624a.asciidoc @@ -1,4 +1,4 @@ -// mapping/types/boolean.asciidoc:242 +// mapping/types/boolean.asciidoc:249 [source, python] ---- diff --git a/docs/examples/2932e6f71e247cf52e11d2f38f114ddf.asciidoc b/docs/examples/2932e6f71e247cf52e11d2f38f114ddf.asciidoc index d8a8040edc..edd4ab6f77 100644 --- a/docs/examples/2932e6f71e247cf52e11d2f38f114ddf.asciidoc +++ b/docs/examples/2932e6f71e247cf52e11d2f38f114ddf.asciidoc @@ -4,7 +4,7 @@ ---- resp = client.reindex( slices="5", - refresh=True, + refresh="true", body={ "source": {"index": "my-index-000001"}, "dest": {"index": "my-new-index-000001"}, diff --git a/docs/examples/2c090fe7ec7b66b3f5c178d71c46323b.asciidoc b/docs/examples/2c090fe7ec7b66b3f5c178d71c46323b.asciidoc index 0be08a366c..8b0a41cfed 100644 --- a/docs/examples/2c090fe7ec7b66b3f5c178d71c46323b.asciidoc +++ b/docs/examples/2c090fe7ec7b66b3f5c178d71c46323b.asciidoc @@ -4,7 +4,7 @@ ---- resp = client.indices.stats( metric="fielddata", - human=True, + human="true", fields="my_join_field", ) print(resp) @@ -12,7 +12,7 @@ print(resp) resp = client.nodes.stats( metric="indices", index_metric="fielddata", - human=True, + human="true", fields="my_join_field", ) print(resp) diff --git a/docs/examples/2fe28d9a91b3081a9ec4601af8fb7b1c.asciidoc b/docs/examples/2fe28d9a91b3081a9ec4601af8fb7b1c.asciidoc index 90b8c898ee..07637df5aa 100644 --- a/docs/examples/2fe28d9a91b3081a9ec4601af8fb7b1c.asciidoc +++ b/docs/examples/2fe28d9a91b3081a9ec4601af8fb7b1c.asciidoc @@ -15,14 +15,14 @@ print(resp) resp = client.index( index="test", - refresh=True, + refresh="true", body={"text": "words words", "flag": "bar"}, ) print(resp) resp = client.index( index="test", - refresh=True, + refresh="true", body={"text": "words words", "flag": "foo"}, ) print(resp) diff --git a/docs/examples/3541d4a85e27b2c3896a7a7ee98b4b37.asciidoc b/docs/examples/3541d4a85e27b2c3896a7a7ee98b4b37.asciidoc index 2c5244e74d..5155169459 100644 --- a/docs/examples/3541d4a85e27b2c3896a7a7ee98b4b37.asciidoc +++ b/docs/examples/3541d4a85e27b2c3896a7a7ee98b4b37.asciidoc @@ -1,4 +1,4 @@ -// health/health.asciidoc:478 +// health/health.asciidoc:481 [source, python] ---- diff --git a/docs/examples/36063ff9a318dba7bb0be3a230655dc8.asciidoc b/docs/examples/36063ff9a318dba7bb0be3a230655dc8.asciidoc index a6e093c17e..1c88919521 100644 --- a/docs/examples/36063ff9a318dba7bb0be3a230655dc8.asciidoc +++ b/docs/examples/36063ff9a318dba7bb0be3a230655dc8.asciidoc @@ -1,4 +1,4 @@ -// mapping/types/numeric.asciidoc:247 +// mapping/types/numeric.asciidoc:259 [source, python] ---- diff --git a/docs/examples/36b86b97feedcf5632824eefc251d6ed.asciidoc b/docs/examples/36b86b97feedcf5632824eefc251d6ed.asciidoc deleted file mode 100644 index 10baf038a8..0000000000 --- a/docs/examples/36b86b97feedcf5632824eefc251d6ed.asciidoc +++ /dev/null @@ -1,10 +0,0 @@ -// getting-started.asciidoc:245 - -[source, python] ----- -resp = client.search( - index="books", - body={"query": {"match": {"name": "brave"}}}, -) -print(resp) ----- \ No newline at end of file diff --git a/docs/examples/36d229f734adcdab00be266a7ce038b1.asciidoc b/docs/examples/36d229f734adcdab00be266a7ce038b1.asciidoc new file mode 100644 index 0000000000..2f6634de09 --- /dev/null +++ b/docs/examples/36d229f734adcdab00be266a7ce038b1.asciidoc @@ -0,0 +1,20 @@ +// mapping/types/dense-vector.asciidoc:375 + +[source, python] +---- +resp = client.indices.create( + index="my-bit-vectors", + body={ + "mappings": { + "properties": { + "my_vector": { + "type": "dense_vector", + "dims": 40, + "element_type": "bit", + } + } + } + }, +) +print(resp) +---- \ No newline at end of file diff --git a/docs/examples/36da9668fef56910370f16bfb772cc40.asciidoc b/docs/examples/36da9668fef56910370f16bfb772cc40.asciidoc index 5a50aa144e..9ab22b1ad2 100644 --- a/docs/examples/36da9668fef56910370f16bfb772cc40.asciidoc +++ b/docs/examples/36da9668fef56910370f16bfb772cc40.asciidoc @@ -4,7 +4,7 @@ ---- resp = client.indices.stats( metric="request_cache", - human=True, + human="true", ) print(resp) ---- \ No newline at end of file diff --git a/docs/examples/38ba93890494bfa7beece58dffa44f98.asciidoc b/docs/examples/38ba93890494bfa7beece58dffa44f98.asciidoc new file mode 100644 index 0000000000..730df1577a --- /dev/null +++ b/docs/examples/38ba93890494bfa7beece58dffa44f98.asciidoc @@ -0,0 +1,18 @@ +// mapping/types/semantic-text.asciidoc:177 + +[source, python] +---- +resp = client.bulk( + index="test-index", + body=[ + {"update": {"_id": "1"}}, + { + "doc": { + "infer_field": "updated inference field", + "source_field": "updated source field", + } + }, + ], +) +print(resp) +---- \ No newline at end of file diff --git a/docs/examples/39ce44333d28ed2b833722d3e3cb06f3.asciidoc b/docs/examples/39ce44333d28ed2b833722d3e3cb06f3.asciidoc index bbf38f83f9..4237f68ad4 100644 --- a/docs/examples/39ce44333d28ed2b833722d3e3cb06f3.asciidoc +++ b/docs/examples/39ce44333d28ed2b833722d3e3cb06f3.asciidoc @@ -3,7 +3,7 @@ [source, python] ---- resp = client.search( - include_named_queries_score=True, + include_named_queries_score="true", body={ "query": { "bool": { diff --git a/docs/examples/3eb4cdd4a799a117ac1ff5f02b18a512.asciidoc b/docs/examples/3eb4cdd4a799a117ac1ff5f02b18a512.asciidoc index 8bc895c9bf..40e57524ba 100644 --- a/docs/examples/3eb4cdd4a799a117ac1ff5f02b18a512.asciidoc +++ b/docs/examples/3eb4cdd4a799a117ac1ff5f02b18a512.asciidoc @@ -23,7 +23,7 @@ print(resp) resp = client.index( index="queries", id="1", - refresh=True, + refresh="true", body={"query": {"match": {"body": "quick brown fox"}}}, ) print(resp) diff --git a/docs/examples/3f3b3e207f79303ce6f86e03e928e062.asciidoc b/docs/examples/3f3b3e207f79303ce6f86e03e928e062.asciidoc deleted file mode 100644 index 69492fcee5..0000000000 --- a/docs/examples/3f3b3e207f79303ce6f86e03e928e062.asciidoc +++ /dev/null @@ -1,10 +0,0 @@ -// setup/run-elasticsearch-locally.asciidoc:125 - -[source, python] ----- -resp = client.get( - index="customer", - id="1", -) -print(resp) ----- \ No newline at end of file diff --git a/docs/examples/4955bae30f265b9e436f82b015de6d7e.asciidoc b/docs/examples/4955bae30f265b9e436f82b015de6d7e.asciidoc index 0cac37e1bf..47b3d1541c 100644 --- a/docs/examples/4955bae30f265b9e436f82b015de6d7e.asciidoc +++ b/docs/examples/4955bae30f265b9e436f82b015de6d7e.asciidoc @@ -4,7 +4,7 @@ ---- resp = client.search( index="my-index-000001", - pretty=True, + pretty="true", body={ "query": { "terms": { diff --git a/docs/examples/4982c547be1ad9455ae836990aea92c5.asciidoc b/docs/examples/4982c547be1ad9455ae836990aea92c5.asciidoc new file mode 100644 index 0000000000..752928e3e1 --- /dev/null +++ b/docs/examples/4982c547be1ad9455ae836990aea92c5.asciidoc @@ -0,0 +1,17 @@ +// ml/trained-models/apis/start-trained-model-deployment.asciidoc:222 + +[source, python] +---- +resp = client.ml.start_trained_model_deployment( + model_id="my_model", + deployment_id="my_model_for_search", + body={ + "adaptive_allocations": { + "enabled": True, + "min_number_of_allocations": 3, + "max_number_of_allocations": 10, + } + }, +) +print(resp) +---- \ No newline at end of file diff --git a/docs/examples/4bef98a2dac575a50ee0783c2269f1db.asciidoc b/docs/examples/4bef98a2dac575a50ee0783c2269f1db.asciidoc new file mode 100644 index 0000000000..b29d99465a --- /dev/null +++ b/docs/examples/4bef98a2dac575a50ee0783c2269f1db.asciidoc @@ -0,0 +1,20 @@ +// mapping/types/dense-vector.asciidoc:469 + +[source, python] +---- +resp = client.indices.create( + index="my-index-000001", + body={ + "mappings": { + "properties": { + "text_embedding": { + "type": "dense_vector", + "dims": 384, + "index_options": {"type": "flat"}, + } + } + } + }, +) +print(resp) +---- \ No newline at end of file diff --git a/docs/examples/4c95d54b32df4dc49e9762b6c1ae2c05.asciidoc b/docs/examples/4c95d54b32df4dc49e9762b6c1ae2c05.asciidoc index 120629a54b..92f7e5d520 100644 --- a/docs/examples/4c95d54b32df4dc49e9762b6c1ae2c05.asciidoc +++ b/docs/examples/4c95d54b32df4dc49e9762b6c1ae2c05.asciidoc @@ -1,4 +1,4 @@ -// mapping/types/text.asciidoc:353 +// mapping/types/text.asciidoc:356 [source, python] ---- diff --git a/docs/examples/4ca15672fc5ab1d80a127d086b6d2837.asciidoc b/docs/examples/4ca15672fc5ab1d80a127d086b6d2837.asciidoc index 4f9dcb5a91..f2197e7901 100644 --- a/docs/examples/4ca15672fc5ab1d80a127d086b6d2837.asciidoc +++ b/docs/examples/4ca15672fc5ab1d80a127d086b6d2837.asciidoc @@ -1,4 +1,4 @@ -// cluster/allocation-explain.asciidoc:342 +// cluster/allocation-explain.asciidoc:344 [source, python] ---- diff --git a/docs/examples/4e3414fc712b16311f9e433dd366f49d.asciidoc b/docs/examples/4e3414fc712b16311f9e433dd366f49d.asciidoc index eebe7e7091..3954dfeb50 100644 --- a/docs/examples/4e3414fc712b16311f9e433dd366f49d.asciidoc +++ b/docs/examples/4e3414fc712b16311f9e433dd366f49d.asciidoc @@ -1,8 +1,8 @@ -// inference/delete-inference.asciidoc:55 +// inference/delete-inference.asciidoc:70 [source, python] ---- -resp = client.inference.delete_model( +resp = client.inference.delete( task_type="sparse_embedding", inference_id="my-elser-model", ) diff --git a/docs/examples/51390ca10aa22d7104e8970f09ea4512.asciidoc b/docs/examples/51390ca10aa22d7104e8970f09ea4512.asciidoc new file mode 100644 index 0000000000..eee2970dd6 --- /dev/null +++ b/docs/examples/51390ca10aa22d7104e8970f09ea4512.asciidoc @@ -0,0 +1,24 @@ +// mapping/types/binary.asciidoc:68 + +[source, python] +---- +resp = client.indices.create( + index="idx", + body={ + "mappings": { + "_source": {"mode": "synthetic"}, + "properties": { + "binary": {"type": "binary", "doc_values": True} + }, + } + }, +) +print(resp) + +resp = client.index( + index="idx", + id="1", + body={"binary": ["IAA=", "EAA="]}, +) +print(resp) +---- \ No newline at end of file diff --git a/docs/examples/51b40610ae05730b4c6afd25647d7ae0.asciidoc b/docs/examples/51b40610ae05730b4c6afd25647d7ae0.asciidoc index f5af5e5266..795f65b00a 100644 --- a/docs/examples/51b40610ae05730b4c6afd25647d7ae0.asciidoc +++ b/docs/examples/51b40610ae05730b4c6afd25647d7ae0.asciidoc @@ -5,7 +5,7 @@ resp = client.index( index="my-index-000001", id="1", - refresh=True, + refresh="true", body={"date": "2015-10-01T05:30:00Z"}, ) print(resp) @@ -13,7 +13,7 @@ print(resp) resp = client.index( index="my-index-000001", id="2", - refresh=True, + refresh="true", body={"date": "2015-10-01T06:30:00Z"}, ) print(resp) diff --git a/docs/examples/5553cf7a02c22f616cd994747f2dd5a5.asciidoc b/docs/examples/5553cf7a02c22f616cd994747f2dd5a5.asciidoc index 274b798040..d03933cb38 100644 --- a/docs/examples/5553cf7a02c22f616cd994747f2dd5a5.asciidoc +++ b/docs/examples/5553cf7a02c22f616cd994747f2dd5a5.asciidoc @@ -1,4 +1,4 @@ -// mapping/types/nested.asciidoc:58 +// mapping/types/nested.asciidoc:60 [source, python] ---- diff --git a/docs/examples/5837d5f50665ac0a26181d3aaeb3f204.asciidoc b/docs/examples/5837d5f50665ac0a26181d3aaeb3f204.asciidoc index 55b2e0e72d..51fe0d3bf8 100644 --- a/docs/examples/5837d5f50665ac0a26181d3aaeb3f204.asciidoc +++ b/docs/examples/5837d5f50665ac0a26181d3aaeb3f204.asciidoc @@ -1,4 +1,4 @@ -// ml/trained-models/apis/start-trained-model-deployment.asciidoc:181 +// ml/trained-models/apis/start-trained-model-deployment.asciidoc:208 [source, python] ---- diff --git a/docs/examples/59d736a4d064ed2013c7ead8e32e0998.asciidoc b/docs/examples/59d736a4d064ed2013c7ead8e32e0998.asciidoc deleted file mode 100644 index 25a961d965..0000000000 --- a/docs/examples/59d736a4d064ed2013c7ead8e32e0998.asciidoc +++ /dev/null @@ -1,17 +0,0 @@ -// inference/put-inference.asciidoc:529 - -[source, python] ----- -resp = client.inference.put_model( - task_type="completion", - inference_id="openai-completion", - body={ - "service": "openai", - "service_settings": { - "api_key": "", - "model_id": "gpt-3.5-turbo", - }, - }, -) -print(resp) ----- \ No newline at end of file diff --git a/docs/examples/5b8119b4d9a09f4643be5a5b40875c8f.asciidoc b/docs/examples/5b8119b4d9a09f4643be5a5b40875c8f.asciidoc index b5987aba51..ad2d49e9f2 100644 --- a/docs/examples/5b8119b4d9a09f4643be5a5b40875c8f.asciidoc +++ b/docs/examples/5b8119b4d9a09f4643be5a5b40875c8f.asciidoc @@ -5,7 +5,7 @@ resp = client.index( index="my-index-000001", id="1", - refresh=True, + refresh="true", body={"is_published": True}, ) print(resp) @@ -13,7 +13,7 @@ print(resp) resp = client.index( index="my-index-000001", id="2", - refresh=True, + refresh="true", body={"is_published": False}, ) print(resp) diff --git a/docs/examples/5db5349162a4fbe74bffb646926a2495.asciidoc b/docs/examples/5db5349162a4fbe74bffb646926a2495.asciidoc new file mode 100644 index 0000000000..b1dc760300 --- /dev/null +++ b/docs/examples/5db5349162a4fbe74bffb646926a2495.asciidoc @@ -0,0 +1,22 @@ +// mapping/types/range.asciidoc:357 + +[source, python] +---- +resp = client.indices.create( + index="idx", + body={ + "mappings": { + "_source": {"mode": "synthetic"}, + "properties": {"my_range": {"type": "long_range"}}, + } + }, +) +print(resp) + +resp = client.index( + index="idx", + id="1", + body={"my_range": {"gt": 200, "lt": 300}}, +) +print(resp) +---- \ No newline at end of file diff --git a/docs/examples/c725c72ead2dae0205a5a34a50d7ad83.asciidoc b/docs/examples/62c311e7ab4de8b79e532929a5069975.asciidoc similarity index 90% rename from docs/examples/c725c72ead2dae0205a5a34a50d7ad83.asciidoc rename to docs/examples/62c311e7ab4de8b79e532929a5069975.asciidoc index 12dbc9f99c..f8e5c21b87 100644 --- a/docs/examples/c725c72ead2dae0205a5a34a50d7ad83.asciidoc +++ b/docs/examples/62c311e7ab4de8b79e532929a5069975.asciidoc @@ -49,4 +49,10 @@ resp = client.search( body={"query": {"rank_feature": {"field": "negative_reviews.1star"}}}, ) print(resp) + +resp = client.search( + index="my-index-000001", + body={"query": {"term": {"topics": "economics"}}}, +) +print(resp) ---- \ No newline at end of file diff --git a/docs/examples/633c8a9fc57268979d8735c557705809.asciidoc b/docs/examples/633c8a9fc57268979d8735c557705809.asciidoc index b81eb1701d..dad9608173 100644 --- a/docs/examples/633c8a9fc57268979d8735c557705809.asciidoc +++ b/docs/examples/633c8a9fc57268979d8735c557705809.asciidoc @@ -1,4 +1,4 @@ -// mapping/types/keyword.asciidoc:220 +// mapping/types/keyword.asciidoc:219 [source, python] ---- diff --git a/docs/examples/63d1c07d22a3ca3b0ec6d950547c011c.asciidoc b/docs/examples/63d1c07d22a3ca3b0ec6d950547c011c.asciidoc index 3112eff31c..22e894a4c5 100644 --- a/docs/examples/63d1c07d22a3ca3b0ec6d950547c011c.asciidoc +++ b/docs/examples/63d1c07d22a3ca3b0ec6d950547c011c.asciidoc @@ -1,4 +1,4 @@ -// mapping/types/keyword.asciidoc:190 +// mapping/types/keyword.asciidoc:189 [source, python] ---- diff --git a/docs/examples/63ecdab34940af053acc409164914c32.asciidoc b/docs/examples/63ecdab34940af053acc409164914c32.asciidoc new file mode 100644 index 0000000000..a6755148ec --- /dev/null +++ b/docs/examples/63ecdab34940af053acc409164914c32.asciidoc @@ -0,0 +1,67 @@ +// mapping/types/sparse-vector.asciidoc:46 + +[source, python] +---- +resp = client.indices.create( + index="my-index-000001", + body={ + "mappings": { + "properties": { + "text": {"type": "text", "analyzer": "standard"}, + "impact": {"type": "sparse_vector"}, + "positive": {"type": "sparse_vector"}, + "negative": {"type": "sparse_vector"}, + } + } + }, +) +print(resp) + +resp = client.index( + index="my-index-000001", + body={ + "text": "I had some terribly delicious carrots.", + "impact": [ + { + "I": 0.55, + "had": 0.4, + "some": 0.28, + "terribly": 0.01, + "delicious": 1.2, + "carrots": 0.8, + }, + { + "I": 0.54, + "had": 0.4, + "some": 0.28, + "terribly": 2.01, + "delicious": 0.02, + "carrots": 0.4, + }, + ], + "positive": { + "I": 0.55, + "had": 0.4, + "some": 0.28, + "terribly": 0.01, + "delicious": 1.2, + "carrots": 0.8, + }, + "negative": { + "I": 0.54, + "had": 0.4, + "some": 0.28, + "terribly": 2.01, + "delicious": 0.02, + "carrots": 0.4, + }, + }, +) +print(resp) + +resp = client.search( + index="my-index-000001", + body={"query": {"term": {"impact": {"value": "delicious"}}}}, +) +print(resp) +---- \ No newline at end of file diff --git a/docs/examples/6cd083045bf06e80b83889a939a18451.asciidoc b/docs/examples/6cd083045bf06e80b83889a939a18451.asciidoc index a685eae370..ef268ceea5 100644 --- a/docs/examples/6cd083045bf06e80b83889a939a18451.asciidoc +++ b/docs/examples/6cd083045bf06e80b83889a939a18451.asciidoc @@ -1,4 +1,4 @@ -// mapping/types/nested.asciidoc:85 +// mapping/types/nested.asciidoc:87 [source, python] ---- diff --git a/docs/examples/7011fcdd231804f9c3894154ae2c3fbc.asciidoc b/docs/examples/7011fcdd231804f9c3894154ae2c3fbc.asciidoc index b80035dba9..b7a4f17ab3 100644 --- a/docs/examples/7011fcdd231804f9c3894154ae2c3fbc.asciidoc +++ b/docs/examples/7011fcdd231804f9c3894154ae2c3fbc.asciidoc @@ -1,4 +1,4 @@ -// mapping/types/sparse-vector.asciidoc:13 +// mapping/types/sparse-vector.asciidoc:14 [source, python] ---- diff --git a/docs/examples/70cc66bf4054ebf0ad4955cb99d9ab80.asciidoc b/docs/examples/70cc66bf4054ebf0ad4955cb99d9ab80.asciidoc index 59c20f5d16..558393ac84 100644 --- a/docs/examples/70cc66bf4054ebf0ad4955cb99d9ab80.asciidoc +++ b/docs/examples/70cc66bf4054ebf0ad4955cb99d9ab80.asciidoc @@ -1,4 +1,4 @@ -// ml/trained-models/apis/update-trained-model-deployment.asciidoc:55 +// ml/trained-models/apis/update-trained-model-deployment.asciidoc:74 [source, python] ---- diff --git a/docs/examples/73be1f93d789264e5b972ddb5991bc66.asciidoc b/docs/examples/73be1f93d789264e5b972ddb5991bc66.asciidoc index 23c119b2a7..a40392283d 100644 --- a/docs/examples/73be1f93d789264e5b972ddb5991bc66.asciidoc +++ b/docs/examples/73be1f93d789264e5b972ddb5991bc66.asciidoc @@ -1,4 +1,4 @@ -// setup/logging-config.asciidoc:158 +// setup/logging-config.asciidoc:180 [source, python] ---- diff --git a/docs/examples/7429b16221fe741fd31b0584786dd0b0.asciidoc b/docs/examples/7429b16221fe741fd31b0584786dd0b0.asciidoc new file mode 100644 index 0000000000..c16f2f1e5c --- /dev/null +++ b/docs/examples/7429b16221fe741fd31b0584786dd0b0.asciidoc @@ -0,0 +1,14 @@ +// inference/post-inference.asciidoc:248 + +[source, python] +---- +resp = client.inference.inference( + task_type="text_embedding", + inference_id="my-cohere-endpoint", + body={ + "input": "The sky above the port was the color of television tuned to a dead channel.", + "task_settings": {"input_type": "ingest"}, + }, +) +print(resp) +---- \ No newline at end of file diff --git a/docs/examples/746e0a1cb5984f2672963b363505c7b3.asciidoc b/docs/examples/746e0a1cb5984f2672963b363505c7b3.asciidoc index 16440a95bd..c848996db2 100644 --- a/docs/examples/746e0a1cb5984f2672963b363505c7b3.asciidoc +++ b/docs/examples/746e0a1cb5984f2672963b363505c7b3.asciidoc @@ -20,7 +20,7 @@ print(resp) resp = client.index( index="my-index-000001", id="example", - refresh=True, + refresh="true", body={"date": 1618321898}, ) print(resp) diff --git a/docs/examples/75e229852d1404040bb2e83723c0f1db.asciidoc b/docs/examples/75e229852d1404040bb2e83723c0f1db.asciidoc deleted file mode 100644 index 1aa05f2416..0000000000 --- a/docs/examples/75e229852d1404040bb2e83723c0f1db.asciidoc +++ /dev/null @@ -1,10 +0,0 @@ -// setup/run-elasticsearch-locally.asciidoc:156 - -[source, python] ----- -resp = client.search( - index="customer", - body={"query": {"match": {"firstname": "Jennifer"}}}, -) -print(resp) ----- \ No newline at end of file diff --git a/docs/examples/7709a48020a6cefbbe547fb944541cdb.asciidoc b/docs/examples/7709a48020a6cefbbe547fb944541cdb.asciidoc new file mode 100644 index 0000000000..3e69ce0863 --- /dev/null +++ b/docs/examples/7709a48020a6cefbbe547fb944541cdb.asciidoc @@ -0,0 +1,16 @@ +// mapping/types/dense-vector.asciidoc:392 + +[source, python] +---- +resp = client.bulk( + index="my-bit-vectors", + refresh="true", + body=[ + {"index": {"_id": "1"}}, + {"my_vector": [127, -127, 0, 1, 42]}, + {"index": {"_id": "2"}}, + {"my_vector": "8100012a7f"}, + ], +) +print(resp) +---- \ No newline at end of file diff --git a/docs/examples/77113c65e1755313183a8969233a5a07.asciidoc b/docs/examples/77113c65e1755313183a8969233a5a07.asciidoc index e7be6a1239..846821791f 100644 --- a/docs/examples/77113c65e1755313183a8969233a5a07.asciidoc +++ b/docs/examples/77113c65e1755313183a8969233a5a07.asciidoc @@ -1,4 +1,4 @@ -// mapping/types/keyword.asciidoc:250 +// mapping/types/keyword.asciidoc:249 [source, python] ---- diff --git a/docs/examples/77b90f6787195767b6da60d8532714b4.asciidoc b/docs/examples/77b90f6787195767b6da60d8532714b4.asciidoc deleted file mode 100644 index 4393f94585..0000000000 --- a/docs/examples/77b90f6787195767b6da60d8532714b4.asciidoc +++ /dev/null @@ -1,19 +0,0 @@ -// inference/put-inference.asciidoc:552 - -[source, python] ----- -resp = client.inference.put_model( - task_type="text_embedding", - inference_id="azure_openai_embeddings", - body={ - "service": "azureopenai", - "service_settings": { - "api_key": "", - "resource_name": "", - "deployment_id": "", - "api_version": "2024-02-01", - }, - }, -) -print(resp) ----- \ No newline at end of file diff --git a/docs/examples/77d0780c5faea4c9ec51a322a6811b3b.asciidoc b/docs/examples/77d0780c5faea4c9ec51a322a6811b3b.asciidoc index 3bbb89e7e1..02b0668809 100644 --- a/docs/examples/77d0780c5faea4c9ec51a322a6811b3b.asciidoc +++ b/docs/examples/77d0780c5faea4c9ec51a322a6811b3b.asciidoc @@ -4,7 +4,7 @@ ---- resp = client.bulk( index="my-index-000001", - refresh=True, + refresh="true", body=[ {"index": {}}, { diff --git a/docs/examples/794d9a321b944347d2a8834a07b5eb22.asciidoc b/docs/examples/794d9a321b944347d2a8834a07b5eb22.asciidoc new file mode 100644 index 0000000000..34f7b8233e --- /dev/null +++ b/docs/examples/794d9a321b944347d2a8834a07b5eb22.asciidoc @@ -0,0 +1,22 @@ +// mapping/types/range.asciidoc:394 + +[source, python] +---- +resp = client.indices.create( + index="idx", + body={ + "mappings": { + "_source": {"mode": "synthetic"}, + "properties": {"my_range": {"type": "integer_range"}}, + } + }, +) +print(resp) + +resp = client.index( + index="idx", + id="1", + body={"my_range": {"lte": 2147483647}}, +) +print(resp) +---- \ No newline at end of file diff --git a/docs/examples/7a0eb2222fe282d3aab66e12feff2a3b.asciidoc b/docs/examples/7a0eb2222fe282d3aab66e12feff2a3b.asciidoc index ee3d7efb27..0200c695a0 100644 --- a/docs/examples/7a0eb2222fe282d3aab66e12feff2a3b.asciidoc +++ b/docs/examples/7a0eb2222fe282d3aab66e12feff2a3b.asciidoc @@ -4,7 +4,7 @@ ---- resp = client.index( index="ip_location", - refresh=True, + refresh="true", body={"ip": "192.168.1.1", "country": "Canada", "city": "Montreal"}, ) print(resp) @@ -12,7 +12,7 @@ print(resp) resp = client.index( index="logs", id="1", - refresh=True, + refresh="true", body={"host": "192.168.1.1", "message": "the first message"}, ) print(resp) @@ -20,7 +20,7 @@ print(resp) resp = client.index( index="logs", id="2", - refresh=True, + refresh="true", body={"host": "192.168.1.2", "message": "the second message"}, ) print(resp) diff --git a/docs/examples/7a2b9a7b2b6553a48bd4db60a939c0fc.asciidoc b/docs/examples/7a2b9a7b2b6553a48bd4db60a939c0fc.asciidoc index ad131f0e29..641a6547dc 100644 --- a/docs/examples/7a2b9a7b2b6553a48bd4db60a939c0fc.asciidoc +++ b/docs/examples/7a2b9a7b2b6553a48bd4db60a939c0fc.asciidoc @@ -5,7 +5,7 @@ resp = client.index( index="test_index", id="1", - refresh=True, + refresh="true", body={ "query": { "match": { diff --git a/docs/examples/7c24d4bef3f2045407fbf1b95c5416f9.asciidoc b/docs/examples/7c24d4bef3f2045407fbf1b95c5416f9.asciidoc index c81cdbf3f1..4d988bd511 100644 --- a/docs/examples/7c24d4bef3f2045407fbf1b95c5416f9.asciidoc +++ b/docs/examples/7c24d4bef3f2045407fbf1b95c5416f9.asciidoc @@ -22,7 +22,7 @@ print(resp) resp = client.index( index="range_index", id="1", - refresh=True, + refresh="true", body={ "expected_attendees": {"gte": 10, "lt": 20}, "time_frame": {"gte": "2015-10-31 12:00:00", "lte": "2015-11-01"}, diff --git a/docs/examples/7fef68840761c6982c14ad7af96caf37.asciidoc b/docs/examples/7fef68840761c6982c14ad7af96caf37.asciidoc index d0ebccfa83..e060c62345 100644 --- a/docs/examples/7fef68840761c6982c14ad7af96caf37.asciidoc +++ b/docs/examples/7fef68840761c6982c14ad7af96caf37.asciidoc @@ -1,4 +1,4 @@ -// mapping/types/nested.asciidoc:22 +// mapping/types/nested.asciidoc:24 [source, python] ---- diff --git a/docs/examples/8575c966b004fb124c7afd6bb5827b50.asciidoc b/docs/examples/8575c966b004fb124c7afd6bb5827b50.asciidoc deleted file mode 100644 index cd3172de0f..0000000000 --- a/docs/examples/8575c966b004fb124c7afd6bb5827b50.asciidoc +++ /dev/null @@ -1,15 +0,0 @@ -// getting-started.asciidoc:65 - -[source, python] ----- -resp = client.index( - index="books", - body={ - "name": "Snow Crash", - "author": "Neal Stephenson", - "release_date": "1992-06-01", - "page_count": 470, - }, -) -print(resp) ----- \ No newline at end of file diff --git a/docs/examples/858fde15fb0a0340873b123043f8c3b4.asciidoc b/docs/examples/858fde15fb0a0340873b123043f8c3b4.asciidoc index d8c3420af9..54f69a2bb5 100644 --- a/docs/examples/858fde15fb0a0340873b123043f8c3b4.asciidoc +++ b/docs/examples/858fde15fb0a0340873b123043f8c3b4.asciidoc @@ -1,4 +1,4 @@ -// mapping/types/histogram.asciidoc:119 +// mapping/types/histogram.asciidoc:118 [source, python] ---- diff --git a/docs/examples/8593715fcc70315a0816b435551258e0.asciidoc b/docs/examples/8593715fcc70315a0816b435551258e0.asciidoc new file mode 100644 index 0000000000..a2be0fc4e4 --- /dev/null +++ b/docs/examples/8593715fcc70315a0816b435551258e0.asciidoc @@ -0,0 +1,20 @@ +// mapping/types/semantic-text.asciidoc:155 + +[source, python] +---- +resp = client.indices.create( + index="test-index", + body={ + "mappings": { + "properties": { + "infer_field": { + "type": "semantic_text", + "inference_id": "my-elser-endpoint", + }, + "source_field": {"type": "text", "copy_to": "infer_field"}, + } + } + }, +) +print(resp) +---- \ No newline at end of file diff --git a/docs/examples/8619bd17bbfe33490b1f277007f654db.asciidoc b/docs/examples/8619bd17bbfe33490b1f277007f654db.asciidoc deleted file mode 100644 index 32ff8da77d..0000000000 --- a/docs/examples/8619bd17bbfe33490b1f277007f654db.asciidoc +++ /dev/null @@ -1,18 +0,0 @@ -// inference/put-inference.asciidoc:353 - -[source, python] ----- -resp = client.inference.put_model( - task_type="rerank", - inference_id="cohere-rerank", - body={ - "service": "cohere", - "service_settings": { - "api_key": "", - "model_id": "rerank-english-v3.0", - }, - "task_settings": {"top_n": 10, "return_documents": True}, - }, -) -print(resp) ----- \ No newline at end of file diff --git a/docs/examples/873fbbc6ab81409058591385fd602736.asciidoc b/docs/examples/873fbbc6ab81409058591385fd602736.asciidoc index e947a75d2e..564654719a 100644 --- a/docs/examples/873fbbc6ab81409058591385fd602736.asciidoc +++ b/docs/examples/873fbbc6ab81409058591385fd602736.asciidoc @@ -20,7 +20,7 @@ print(resp) resp = client.index( index="drivers", id="2", - refresh=True, + refresh="true", body={ "driver": { "last_name": "Hudson", diff --git a/docs/examples/87416e6a1ca2da324dbed6deb05303eb.asciidoc b/docs/examples/87416e6a1ca2da324dbed6deb05303eb.asciidoc index e1ea15b945..bd409dc1d2 100644 --- a/docs/examples/87416e6a1ca2da324dbed6deb05303eb.asciidoc +++ b/docs/examples/87416e6a1ca2da324dbed6deb05303eb.asciidoc @@ -5,7 +5,7 @@ resp = client.index( index="my-index-000001", id="1", - refresh=True, + refresh="true", body={"user.id": "kimchy"}, ) print(resp) diff --git a/docs/examples/87733deeea4b441b595d19a0f97346f0.asciidoc b/docs/examples/87733deeea4b441b595d19a0f97346f0.asciidoc index 63e252c69e..e323188a26 100644 --- a/docs/examples/87733deeea4b441b595d19a0f97346f0.asciidoc +++ b/docs/examples/87733deeea4b441b595d19a0f97346f0.asciidoc @@ -1,4 +1,4 @@ -// health/health.asciidoc:471 +// health/health.asciidoc:474 [source, python] ---- diff --git a/docs/examples/8d7193902a353872740a3324c60c5001.asciidoc b/docs/examples/8d7193902a353872740a3324c60c5001.asciidoc index 2fc9ec900c..ff3d2176d7 100644 --- a/docs/examples/8d7193902a353872740a3324c60c5001.asciidoc +++ b/docs/examples/8d7193902a353872740a3324c60c5001.asciidoc @@ -1,4 +1,4 @@ -// index-modules/index-sorting.asciidoc:114 +// index-modules/index-sorting.asciidoc:113 [source, python] ---- diff --git a/docs/examples/8e286a205a1f84f888a6d99f2620c80e.asciidoc b/docs/examples/8e286a205a1f84f888a6d99f2620c80e.asciidoc index ccd2e430b7..2f5fd43ec2 100644 --- a/docs/examples/8e286a205a1f84f888a6d99f2620c80e.asciidoc +++ b/docs/examples/8e286a205a1f84f888a6d99f2620c80e.asciidoc @@ -1,4 +1,4 @@ -// setup/logging-config.asciidoc:242 +// setup/logging-config.asciidoc:272 [source, python] ---- diff --git a/docs/examples/8e68cdfad45e7e6dff254d931eea29d4.asciidoc b/docs/examples/8e68cdfad45e7e6dff254d931eea29d4.asciidoc index bdc078a682..90b4934420 100644 --- a/docs/examples/8e68cdfad45e7e6dff254d931eea29d4.asciidoc +++ b/docs/examples/8e68cdfad45e7e6dff254d931eea29d4.asciidoc @@ -4,7 +4,7 @@ ---- resp = client.bulk( index="my-index-000001", - refresh=True, + refresh="true", body=[ {"index": {}}, { diff --git a/docs/examples/90112d594b934c0111b7303b9f91cb7f.asciidoc b/docs/examples/90112d594b934c0111b7303b9f91cb7f.asciidoc deleted file mode 100644 index 516679e8d3..0000000000 --- a/docs/examples/90112d594b934c0111b7303b9f91cb7f.asciidoc +++ /dev/null @@ -1,11 +0,0 @@ -// setup/run-elasticsearch-locally.asciidoc:109 - -[source, python] ----- -resp = client.index( - index="customer", - id="1", - body={"firstname": "Jennifer", "lastname": "Walters"}, -) -print(resp) ----- \ No newline at end of file diff --git a/docs/examples/90631797c7fbda43902abf2cc0ea8304.asciidoc b/docs/examples/90631797c7fbda43902abf2cc0ea8304.asciidoc index b4515bee13..376614889e 100644 --- a/docs/examples/90631797c7fbda43902abf2cc0ea8304.asciidoc +++ b/docs/examples/90631797c7fbda43902abf2cc0ea8304.asciidoc @@ -5,7 +5,7 @@ resp = client.nodes.stats( metric="indices", index_metric="request_cache", - human=True, + human="true", ) print(resp) ---- \ No newline at end of file diff --git a/docs/examples/926c0134aeaad53bd0f3bdad9c430217.asciidoc b/docs/examples/926c0134aeaad53bd0f3bdad9c430217.asciidoc index 6fefeb85d2..8305fc94b3 100644 --- a/docs/examples/926c0134aeaad53bd0f3bdad9c430217.asciidoc +++ b/docs/examples/926c0134aeaad53bd0f3bdad9c430217.asciidoc @@ -5,7 +5,7 @@ resp = client.index( index="my-index-000001", id="1", - refresh=True, + refresh="true", body={"text": "words words", "flag": "foo"}, ) print(resp) diff --git a/docs/examples/937ffc65cbb20505a8aba25b37a796a5.asciidoc b/docs/examples/937ffc65cbb20505a8aba25b37a796a5.asciidoc index f249969c84..1f87d15a7c 100644 --- a/docs/examples/937ffc65cbb20505a8aba25b37a796a5.asciidoc +++ b/docs/examples/937ffc65cbb20505a8aba25b37a796a5.asciidoc @@ -13,7 +13,7 @@ print(resp) resp = client.index( index="my-index-000001", id="1", - refresh=True, + refresh="true", body={"is_published": "true"}, ) print(resp) diff --git a/docs/examples/93bd651aff81daa2b86f9f2089e6d088.asciidoc b/docs/examples/93bd651aff81daa2b86f9f2089e6d088.asciidoc index 6b9c8259bb..972e6c1f9e 100644 --- a/docs/examples/93bd651aff81daa2b86f9f2089e6d088.asciidoc +++ b/docs/examples/93bd651aff81daa2b86f9f2089e6d088.asciidoc @@ -5,7 +5,7 @@ resp = client.index( index="my-index-000001", id="1", - refresh=True, + refresh="true", body={ "my_id": "1", "text": "This is a question", @@ -17,7 +17,7 @@ print(resp) resp = client.index( index="my-index-000001", id="2", - refresh=True, + refresh="true", body={ "my_id": "2", "text": "This is another question", diff --git a/docs/examples/97babc8d19ef0866774576716eb6d19e.asciidoc b/docs/examples/97babc8d19ef0866774576716eb6d19e.asciidoc index 835116fdd1..ca02b620d8 100644 --- a/docs/examples/97babc8d19ef0866774576716eb6d19e.asciidoc +++ b/docs/examples/97babc8d19ef0866774576716eb6d19e.asciidoc @@ -4,7 +4,7 @@ ---- resp = client.update_by_query( index="test", - refresh=True, + refresh="true", conflicts="proceed", ) print(resp) diff --git a/docs/examples/9a02bd47c000a3d9a8911233c37c890f.asciidoc b/docs/examples/9a02bd47c000a3d9a8911233c37c890f.asciidoc index d6793b3663..964f057580 100644 --- a/docs/examples/9a02bd47c000a3d9a8911233c37c890f.asciidoc +++ b/docs/examples/9a02bd47c000a3d9a8911233c37c890f.asciidoc @@ -5,7 +5,7 @@ resp = client.index( index="my-index-000001", id="1", - refresh=True, + refresh="true", body={"date": "2015-10-01T00:30:00Z"}, ) print(resp) @@ -13,7 +13,7 @@ print(resp) resp = client.index( index="my-index-000001", id="2", - refresh=True, + refresh="true", body={"date": "2015-10-01T01:30:00Z"}, ) print(resp) diff --git a/docs/examples/9a203aae3e1412d919546276fb52a5ca.asciidoc b/docs/examples/9a203aae3e1412d919546276fb52a5ca.asciidoc deleted file mode 100644 index 8f030467d9..0000000000 --- a/docs/examples/9a203aae3e1412d919546276fb52a5ca.asciidoc +++ /dev/null @@ -1,18 +0,0 @@ -// inference/put-inference.asciidoc:335 - -[source, python] ----- -resp = client.inference.put_model( - task_type="text_embedding", - inference_id="cohere-embeddings", - body={ - "service": "cohere", - "service_settings": { - "api_key": "", - "model_id": "embed-english-light-v3.0", - "embedding_type": "byte", - }, - }, -) -print(resp) ----- \ No newline at end of file diff --git a/docs/examples/9a4d5e41c52c20635d1fd9c6e13f6c7a.asciidoc b/docs/examples/9a4d5e41c52c20635d1fd9c6e13f6c7a.asciidoc index 5dcf1808fd..7eb400dd2b 100644 --- a/docs/examples/9a4d5e41c52c20635d1fd9c6e13f6c7a.asciidoc +++ b/docs/examples/9a4d5e41c52c20635d1fd9c6e13f6c7a.asciidoc @@ -5,7 +5,7 @@ resp = client.index( index="metricbeat-2016.05.30", id="1", - refresh=True, + refresh="true", body={"system.cpu.idle.pct": 0.908}, ) print(resp) @@ -13,7 +13,7 @@ print(resp) resp = client.index( index="metricbeat-2016.05.31", id="1", - refresh=True, + refresh="true", body={"system.cpu.idle.pct": 0.105}, ) print(resp) diff --git a/docs/examples/9cfbc41bb7b6fbdb26550dd2789c274e.asciidoc b/docs/examples/9cfbc41bb7b6fbdb26550dd2789c274e.asciidoc index 901989488b..5e42eef660 100644 --- a/docs/examples/9cfbc41bb7b6fbdb26550dd2789c274e.asciidoc +++ b/docs/examples/9cfbc41bb7b6fbdb26550dd2789c274e.asciidoc @@ -4,7 +4,7 @@ ---- resp = client.delete_by_query( index="my-index-000001", - refresh=True, + refresh="true", slices="5", body={"query": {"range": {"http.response.bytes": {"lt": 2000000}}}}, ) diff --git a/docs/examples/9d79645ab3a9da3f63c54a1516214a5a.asciidoc b/docs/examples/9d79645ab3a9da3f63c54a1516214a5a.asciidoc index 68c134d0a5..c144209d10 100644 --- a/docs/examples/9d79645ab3a9da3f63c54a1516214a5a.asciidoc +++ b/docs/examples/9d79645ab3a9da3f63c54a1516214a5a.asciidoc @@ -1,4 +1,4 @@ -// health/health.asciidoc:463 +// health/health.asciidoc:466 [source, python] ---- diff --git a/docs/examples/9de4ea9d5f3d427a71ee07d998cb5611.asciidoc b/docs/examples/9de4ea9d5f3d427a71ee07d998cb5611.asciidoc index 629c10268b..71e071724a 100644 --- a/docs/examples/9de4ea9d5f3d427a71ee07d998cb5611.asciidoc +++ b/docs/examples/9de4ea9d5f3d427a71ee07d998cb5611.asciidoc @@ -1,4 +1,4 @@ -// index-modules/blocks.asciidoc:137 +// index-modules/blocks.asciidoc:138 [source, python] ---- diff --git a/docs/examples/9e0e3ce27967f164f4585c5231ba9c75.asciidoc b/docs/examples/9e0e3ce27967f164f4585c5231ba9c75.asciidoc index 9f44357b0d..f0fa86520b 100644 --- a/docs/examples/9e0e3ce27967f164f4585c5231ba9c75.asciidoc +++ b/docs/examples/9e0e3ce27967f164f4585c5231ba9c75.asciidoc @@ -5,7 +5,7 @@ resp = client.index( index="my-index-000001", id="1", - refresh=True, + refresh="true", body={"my_field": "quick brown fox jump lazy dog"}, ) print(resp) diff --git a/docs/examples/9f16fca9813304e398ee052aa857dbcd.asciidoc b/docs/examples/9f16fca9813304e398ee052aa857dbcd.asciidoc deleted file mode 100644 index 1d854a9c93..0000000000 --- a/docs/examples/9f16fca9813304e398ee052aa857dbcd.asciidoc +++ /dev/null @@ -1,17 +0,0 @@ -// inference/put-inference.asciidoc:513 - -[source, python] ----- -resp = client.inference.put_model( - task_type="text_embedding", - inference_id="openai-embeddings", - body={ - "service": "openai", - "service_settings": { - "api_key": "", - "model_id": "text-embedding-ada-002", - }, - }, -) -print(resp) ----- \ No newline at end of file diff --git a/docs/examples/a4a3c3cd09efa75168dab90105afb2e9.asciidoc b/docs/examples/a4a3c3cd09efa75168dab90105afb2e9.asciidoc index 5f21ffc5e4..e0ecce9bb3 100644 --- a/docs/examples/a4a3c3cd09efa75168dab90105afb2e9.asciidoc +++ b/docs/examples/a4a3c3cd09efa75168dab90105afb2e9.asciidoc @@ -2,7 +2,7 @@ [source, python] ---- -resp = client.inference.get_model( +resp = client.inference.get( task_type="sparse_embedding", inference_id="my-elser-model", ) diff --git a/docs/examples/aa6282d4bc92c753c4bd7a5b166abece.asciidoc b/docs/examples/aa6282d4bc92c753c4bd7a5b166abece.asciidoc index cf00e978a5..701958e288 100644 --- a/docs/examples/aa6282d4bc92c753c4bd7a5b166abece.asciidoc +++ b/docs/examples/aa6282d4bc92c753c4bd7a5b166abece.asciidoc @@ -1,4 +1,4 @@ -// ml/trained-models/apis/start-trained-model-deployment.asciidoc:133 +// ml/trained-models/apis/start-trained-model-deployment.asciidoc:160 [source, python] ---- diff --git a/docs/examples/ad57ccba0a060da4f5313692fa26a235.asciidoc b/docs/examples/ad57ccba0a060da4f5313692fa26a235.asciidoc index ce87ee16dd..ee0b8ae24d 100644 --- a/docs/examples/ad57ccba0a060da4f5313692fa26a235.asciidoc +++ b/docs/examples/ad57ccba0a060da4f5313692fa26a235.asciidoc @@ -10,7 +10,7 @@ print(resp) resp = client.bulk( index="my-index-000001", - refresh=True, + refresh="true", body=[ {"index": {"_id": "1"}}, {"date": "2015-01-01"}, diff --git a/docs/examples/afef5cac988592b97ae289ab39c2f437.asciidoc b/docs/examples/afef5cac988592b97ae289ab39c2f437.asciidoc index 206d014aa8..b834fcedba 100644 --- a/docs/examples/afef5cac988592b97ae289ab39c2f437.asciidoc +++ b/docs/examples/afef5cac988592b97ae289ab39c2f437.asciidoc @@ -1,4 +1,4 @@ -// mapping/types/text.asciidoc:292 +// mapping/types/text.asciidoc:295 [source, python] ---- diff --git a/docs/examples/b14122481ae1f158f1a9a1bfbc4a41b1.asciidoc b/docs/examples/b14122481ae1f158f1a9a1bfbc4a41b1.asciidoc index 6ea9cee891..0ca0ece510 100644 --- a/docs/examples/b14122481ae1f158f1a9a1bfbc4a41b1.asciidoc +++ b/docs/examples/b14122481ae1f158f1a9a1bfbc4a41b1.asciidoc @@ -1,4 +1,4 @@ -// setup/secure-settings.asciidoc:35 +// setup/secure-settings.asciidoc:39 [source, python] ---- diff --git a/docs/examples/b45a8c6fc746e9c90fd181e69a605fad.asciidoc b/docs/examples/b45a8c6fc746e9c90fd181e69a605fad.asciidoc index 8a1fc3fc3a..4a346277cc 100644 --- a/docs/examples/b45a8c6fc746e9c90fd181e69a605fad.asciidoc +++ b/docs/examples/b45a8c6fc746e9c90fd181e69a605fad.asciidoc @@ -1,4 +1,4 @@ -// inference/post-inference.asciidoc:102 +// inference/post-inference.asciidoc:106 [source, python] ---- diff --git a/docs/examples/b6f690896001f8f9ad5bf24e1304a552.asciidoc b/docs/examples/b6f690896001f8f9ad5bf24e1304a552.asciidoc new file mode 100644 index 0000000000..2e256e2111 --- /dev/null +++ b/docs/examples/b6f690896001f8f9ad5bf24e1304a552.asciidoc @@ -0,0 +1,21 @@ +// mapping/types/dense-vector.asciidoc:158 + +[source, python] +---- +resp = client.indices.create( + index="my-byte-quantized-index", + body={ + "mappings": { + "properties": { + "my_vector": { + "type": "dense_vector", + "dims": 4, + "index": True, + "index_options": {"type": "int4_hnsw"}, + } + } + } + }, +) +print(resp) +---- \ No newline at end of file diff --git a/docs/examples/b7a9f60b3646efe3834ca8381f8aa560.asciidoc b/docs/examples/b7a9f60b3646efe3834ca8381f8aa560.asciidoc index 7077a812fe..7ef6bb0dfa 100644 --- a/docs/examples/b7a9f60b3646efe3834ca8381f8aa560.asciidoc +++ b/docs/examples/b7a9f60b3646efe3834ca8381f8aa560.asciidoc @@ -1,4 +1,4 @@ -// setup/logging-config.asciidoc:171 +// setup/logging-config.asciidoc:193 [source, python] ---- diff --git a/docs/examples/bb975b342de7e838ebf6a36aaa1a8749.asciidoc b/docs/examples/bb975b342de7e838ebf6a36aaa1a8749.asciidoc index 3426d6fb8c..b35ddfed09 100644 --- a/docs/examples/bb975b342de7e838ebf6a36aaa1a8749.asciidoc +++ b/docs/examples/bb975b342de7e838ebf6a36aaa1a8749.asciidoc @@ -6,7 +6,7 @@ resp = client.index( index="my-index-000001", id="3", routing="1", - refresh=True, + refresh="true", body={ "text": "This is a vote", "my_join_field": {"name": "vote", "parent": "2"}, diff --git a/docs/examples/bcc75fc01b45e482638c65b8fbdf09fa.asciidoc b/docs/examples/bcc75fc01b45e482638c65b8fbdf09fa.asciidoc deleted file mode 100644 index bfbc6a0e80..0000000000 --- a/docs/examples/bcc75fc01b45e482638c65b8fbdf09fa.asciidoc +++ /dev/null @@ -1,9 +0,0 @@ -// getting-started.asciidoc:228 - -[source, python] ----- -resp = client.search( - index="books", -) -print(resp) ----- \ No newline at end of file diff --git a/docs/examples/bd7330af2609bdd8aa10958f5e640b93.asciidoc b/docs/examples/bd7330af2609bdd8aa10958f5e640b93.asciidoc index 6940706422..28d9b24a36 100644 --- a/docs/examples/bd7330af2609bdd8aa10958f5e640b93.asciidoc +++ b/docs/examples/bd7330af2609bdd8aa10958f5e640b93.asciidoc @@ -5,7 +5,7 @@ resp = client.index( index="my_queries2", id="2", - refresh=True, + refresh="true", body={"query": {"match": {"my_field.suffix": "xyz"}}}, ) print(resp) diff --git a/docs/examples/be5b415d7f33d6f0397ac2f8b5c10521.asciidoc b/docs/examples/be5b415d7f33d6f0397ac2f8b5c10521.asciidoc index 42b7b6fac8..758f9e4841 100644 --- a/docs/examples/be5b415d7f33d6f0397ac2f8b5c10521.asciidoc +++ b/docs/examples/be5b415d7f33d6f0397ac2f8b5c10521.asciidoc @@ -4,7 +4,7 @@ ---- resp = client.update_by_query( index="my-index-000001", - refresh=True, + refresh="true", slices="5", body={"script": {"source": "ctx._source['extra'] = 'test'"}}, ) diff --git a/docs/examples/be5c5a9c25901737585e4fff9195da3c.asciidoc b/docs/examples/be5c5a9c25901737585e4fff9195da3c.asciidoc new file mode 100644 index 0000000000..4d3c42177e --- /dev/null +++ b/docs/examples/be5c5a9c25901737585e4fff9195da3c.asciidoc @@ -0,0 +1,18 @@ +// mapping/types/dense-vector.asciidoc:406 + +[source, python] +---- +resp = client.search( + index="my-bit-vectors", + filter_path="hits.hits", + body={ + "query": { + "knn": { + "query_vector": [127, -127, 0, 1, 42], + "field": "my_vector", + } + } + }, +) +print(resp) +---- \ No newline at end of file diff --git a/docs/examples/bed14cc152522ca0726ac3746ebc31db.asciidoc b/docs/examples/bed14cc152522ca0726ac3746ebc31db.asciidoc index 4fc8297e03..d4de6b4edc 100644 --- a/docs/examples/bed14cc152522ca0726ac3746ebc31db.asciidoc +++ b/docs/examples/bed14cc152522ca0726ac3746ebc31db.asciidoc @@ -4,7 +4,7 @@ ---- resp = client.bulk( index="my_index", - refresh=True, + refresh="true", body=[ {"index": {"_id": 1}}, {"my_counter": 0}, diff --git a/docs/examples/c1a895497066a3dac674d4b1a119048d.asciidoc b/docs/examples/c1a895497066a3dac674d4b1a119048d.asciidoc index 8c1ea284fe..eb3843b340 100644 --- a/docs/examples/c1a895497066a3dac674d4b1a119048d.asciidoc +++ b/docs/examples/c1a895497066a3dac674d4b1a119048d.asciidoc @@ -4,7 +4,7 @@ ---- resp = client.search( index="my-index-000001", - pretty=True, + pretty="true", body={"query": {"term": {"full_text": "Quick Brown Foxes!"}}}, ) print(resp) diff --git a/docs/examples/c1bb395546102279296534522061829f.asciidoc b/docs/examples/c1bb395546102279296534522061829f.asciidoc index 8eb2678b85..18dc89f1bc 100644 --- a/docs/examples/c1bb395546102279296534522061829f.asciidoc +++ b/docs/examples/c1bb395546102279296534522061829f.asciidoc @@ -1,4 +1,4 @@ -// mapping/types/geo-point.asciidoc:230 +// mapping/types/geo-point.asciidoc:229 [source, python] ---- diff --git a/docs/examples/c6151a0788a10a7f40da684d72c3255c.asciidoc b/docs/examples/c6151a0788a10a7f40da684d72c3255c.asciidoc index a6c8846faf..d7f02cb5e8 100644 --- a/docs/examples/c6151a0788a10a7f40da684d72c3255c.asciidoc +++ b/docs/examples/c6151a0788a10a7f40da684d72c3255c.asciidoc @@ -4,7 +4,7 @@ ---- resp = client.bulk( index="my-index-000001", - refresh=True, + refresh="true", body=[ {"index": {}}, { diff --git a/docs/examples/cda045dfd79acd160ed8668f2ee17ea7.asciidoc b/docs/examples/cda045dfd79acd160ed8668f2ee17ea7.asciidoc index 2a043cc814..be77e90721 100644 --- a/docs/examples/cda045dfd79acd160ed8668f2ee17ea7.asciidoc +++ b/docs/examples/cda045dfd79acd160ed8668f2ee17ea7.asciidoc @@ -4,7 +4,7 @@ ---- resp = client.search( index="my-index-000001", - pretty=True, + pretty="true", body={"query": {"match": {"full_text": "Quick Brown Foxes!"}}}, ) print(resp) diff --git a/docs/examples/ce2c2e8f5a2e4daf051b6e10122e5aae.asciidoc b/docs/examples/ce2c2e8f5a2e4daf051b6e10122e5aae.asciidoc new file mode 100644 index 0000000000..c6efa3aa3e --- /dev/null +++ b/docs/examples/ce2c2e8f5a2e4daf051b6e10122e5aae.asciidoc @@ -0,0 +1,18 @@ +// mapping/types/dense-vector.asciidoc:490 + +[source, python] +---- +resp = client.indices.put_mapping( + index="my-index-000001", + body={ + "properties": { + "text_embedding": { + "type": "dense_vector", + "dims": 384, + "index_options": {"type": "int4_hnsw"}, + } + } + }, +) +print(resp) +---- \ No newline at end of file diff --git a/docs/examples/cedb56a71cc743d80263ce352bb21720.asciidoc b/docs/examples/cedb56a71cc743d80263ce352bb21720.asciidoc deleted file mode 100644 index 2be37beca4..0000000000 --- a/docs/examples/cedb56a71cc743d80263ce352bb21720.asciidoc +++ /dev/null @@ -1,14 +0,0 @@ -// inference/put-inference.asciidoc:406 - -[source, python] ----- -resp = client.inference.put_model( - task_type="sparse_embedding", - inference_id="my-elser-model", - body={ - "service": "elser", - "service_settings": {"num_allocations": 1, "num_threads": 1}, - }, -) -print(resp) ----- \ No newline at end of file diff --git a/docs/examples/d04f0c8c44e8b4fb55f2e7d9d05977e7.asciidoc b/docs/examples/d04f0c8c44e8b4fb55f2e7d9d05977e7.asciidoc deleted file mode 100644 index 6fe42c6b9e..0000000000 --- a/docs/examples/d04f0c8c44e8b4fb55f2e7d9d05977e7.asciidoc +++ /dev/null @@ -1,45 +0,0 @@ -// getting-started.asciidoc:104 - -[source, python] ----- -resp = client.bulk( - body=[ - {"index": {"_index": "books"}}, - { - "name": "Revelation Space", - "author": "Alastair Reynolds", - "release_date": "2000-03-15", - "page_count": 585, - }, - {"index": {"_index": "books"}}, - { - "name": "1984", - "author": "George Orwell", - "release_date": "1985-06-01", - "page_count": 328, - }, - {"index": {"_index": "books"}}, - { - "name": "Fahrenheit 451", - "author": "Ray Bradbury", - "release_date": "1953-10-15", - "page_count": 227, - }, - {"index": {"_index": "books"}}, - { - "name": "Brave New World", - "author": "Aldous Huxley", - "release_date": "1932-06-01", - "page_count": 268, - }, - {"index": {"_index": "books"}}, - { - "name": "The Handmaids Tale", - "author": "Margaret Atwood", - "release_date": "1985-06-01", - "page_count": 311, - }, - ], -) -print(resp) ----- \ No newline at end of file diff --git a/docs/examples/d4fb482a51d67a1af48e429af6019a46.asciidoc b/docs/examples/d4fb482a51d67a1af48e429af6019a46.asciidoc index 7f15db1db8..b200ad42c8 100644 --- a/docs/examples/d4fb482a51d67a1af48e429af6019a46.asciidoc +++ b/docs/examples/d4fb482a51d67a1af48e429af6019a46.asciidoc @@ -1,4 +1,4 @@ -// index-modules/index-sorting.asciidoc:41 +// index-modules/index-sorting.asciidoc:40 [source, python] ---- diff --git a/docs/examples/d7919fb6f4d02dde1390775eb8365b79.asciidoc b/docs/examples/d7919fb6f4d02dde1390775eb8365b79.asciidoc index 78b48566da..a32951b313 100644 --- a/docs/examples/d7919fb6f4d02dde1390775eb8365b79.asciidoc +++ b/docs/examples/d7919fb6f4d02dde1390775eb8365b79.asciidoc @@ -1,4 +1,4 @@ -// mapping/types/text.asciidoc:320 +// mapping/types/text.asciidoc:323 [source, python] ---- diff --git a/docs/examples/df34c8ebaaa59a3ee0e3f28e2443bc30.asciidoc b/docs/examples/df34c8ebaaa59a3ee0e3f28e2443bc30.asciidoc index 45626d4d37..272cfa284d 100644 --- a/docs/examples/df34c8ebaaa59a3ee0e3f28e2443bc30.asciidoc +++ b/docs/examples/df34c8ebaaa59a3ee0e3f28e2443bc30.asciidoc @@ -11,7 +11,7 @@ print(resp) resp = client.index( index="my-index", id="1", - refresh=True, + refresh="true", body={"comments": [{"author": "kimchy"}]}, ) print(resp) @@ -19,7 +19,7 @@ print(resp) resp = client.index( index="my-index", id="2", - refresh=True, + refresh="true", body={"comments": [{"author": "kimchy"}, {"author": "nik9000"}]}, ) print(resp) @@ -27,7 +27,7 @@ print(resp) resp = client.index( index="my-index", id="3", - refresh=True, + refresh="true", body={"comments": [{"author": "nik9000"}]}, ) print(resp) diff --git a/docs/examples/dfce1be1d035aff0b8fdf4a8839f7795.asciidoc b/docs/examples/dfce1be1d035aff0b8fdf4a8839f7795.asciidoc new file mode 100644 index 0000000000..a9d0b21b9b --- /dev/null +++ b/docs/examples/dfce1be1d035aff0b8fdf4a8839f7795.asciidoc @@ -0,0 +1,16 @@ +// ml/trained-models/apis/update-trained-model-deployment.asciidoc:115 + +[source, python] +---- +resp = client.ml.update_trained_model_deployment( + model_id="elastic__distilbert-base-uncased-finetuned-conll03-english", + body={ + "adaptive_allocations": { + "enabled": True, + "min_number_of_allocations": 3, + "max_number_of_allocations": 10, + } + }, +) +print(resp) +---- \ No newline at end of file diff --git a/docs/examples/e1f6ea7c0937cf7e6ea7e8209e52e8bb.asciidoc b/docs/examples/e1f6ea7c0937cf7e6ea7e8209e52e8bb.asciidoc index d393923318..d9dfc87029 100644 --- a/docs/examples/e1f6ea7c0937cf7e6ea7e8209e52e8bb.asciidoc +++ b/docs/examples/e1f6ea7c0937cf7e6ea7e8209e52e8bb.asciidoc @@ -1,4 +1,4 @@ -// index-modules/index-sorting.asciidoc:159 +// index-modules/index-sorting.asciidoc:158 [source, python] ---- diff --git a/docs/examples/ed688d86eeaa4d7969acb0f574eb917f.asciidoc b/docs/examples/ed688d86eeaa4d7969acb0f574eb917f.asciidoc index 16fa1567e6..b9da3bc324 100644 --- a/docs/examples/ed688d86eeaa4d7969acb0f574eb917f.asciidoc +++ b/docs/examples/ed688d86eeaa4d7969acb0f574eb917f.asciidoc @@ -5,7 +5,7 @@ resp = client.index( index="my_queries1", id="1", - refresh=True, + refresh="true", body={"query": {"term": {"my_field.prefix": "abc"}}}, ) print(resp) diff --git a/docs/examples/eee6110831c08b9c1b3f56b24656e95b.asciidoc b/docs/examples/eee6110831c08b9c1b3f56b24656e95b.asciidoc deleted file mode 100644 index 286378a6b8..0000000000 --- a/docs/examples/eee6110831c08b9c1b3f56b24656e95b.asciidoc +++ /dev/null @@ -1,17 +0,0 @@ -// inference/put-inference.asciidoc:445 - -[source, python] ----- -resp = client.inference.put_model( - task_type="text_embedding", - inference_id="hugging-face-embeddings", - body={ - "service": "hugging_face", - "service_settings": { - "api_key": "", - "url": "", - }, - }, -) -print(resp) ----- \ No newline at end of file diff --git a/docs/examples/f09817fd13ff3dce52eb79d0722409c3.asciidoc b/docs/examples/f09817fd13ff3dce52eb79d0722409c3.asciidoc index a872c1ce47..352f0078bd 100644 --- a/docs/examples/f09817fd13ff3dce52eb79d0722409c3.asciidoc +++ b/docs/examples/f09817fd13ff3dce52eb79d0722409c3.asciidoc @@ -16,7 +16,7 @@ resp = client.indices.create( print(resp) resp = client.reindex( - refresh=True, + refresh="true", body={"source": {"index": "index"}, "dest": {"index": "new_index"}}, ) print(resp) diff --git a/docs/examples/f1b24217b1d9ba6ea5e4fa6e6f412022.asciidoc b/docs/examples/f1b24217b1d9ba6ea5e4fa6e6f412022.asciidoc index 89cd690dcc..476ec000dc 100644 --- a/docs/examples/f1b24217b1d9ba6ea5e4fa6e6f412022.asciidoc +++ b/docs/examples/f1b24217b1d9ba6ea5e4fa6e6f412022.asciidoc @@ -1,4 +1,4 @@ -// inference/post-inference.asciidoc:133 +// inference/post-inference.asciidoc:137 [source, python] ---- diff --git a/docs/examples/f38262ef72f73816ec35fa4c9c85760d.asciidoc b/docs/examples/f38262ef72f73816ec35fa4c9c85760d.asciidoc new file mode 100644 index 0000000000..e6b0775eb0 --- /dev/null +++ b/docs/examples/f38262ef72f73816ec35fa4c9c85760d.asciidoc @@ -0,0 +1,29 @@ +// mapping/types/range.asciidoc:254 + +[source, python] +---- +resp = client.indices.create( + index="idx", + body={ + "mappings": { + "_source": {"mode": "synthetic"}, + "properties": {"my_range": {"type": "long_range"}}, + } + }, +) +print(resp) + +resp = client.index( + index="idx", + id="1", + body={ + "my_range": [ + {"gte": 200, "lte": 300}, + {"gte": 1, "lte": 100}, + {"gte": 200, "lte": 300}, + {"gte": 200, "lte": 500}, + ] + }, +) +print(resp) +---- \ No newline at end of file diff --git a/docs/examples/f9cb2547ab04461a12bfd25a35be5f96.asciidoc b/docs/examples/f9cb2547ab04461a12bfd25a35be5f96.asciidoc new file mode 100644 index 0000000000..2acd20322d --- /dev/null +++ b/docs/examples/f9cb2547ab04461a12bfd25a35be5f96.asciidoc @@ -0,0 +1,27 @@ +// mapping/types/range.asciidoc:429 + +[source, python] +---- +resp = client.indices.create( + index="idx", + body={ + "mappings": { + "_source": {"mode": "synthetic"}, + "properties": {"my_range": {"type": "date_range"}}, + } + }, +) +print(resp) + +resp = client.index( + index="idx", + id="1", + body={ + "my_range": [ + {"gte": 1504224000000, "lte": 1504569600000}, + {"gte": "2017-09-01", "lte": "2017-09-10"}, + ] + }, +) +print(resp) +---- \ No newline at end of file diff --git a/docs/examples/fc8a426f8a5112e61e2acb913982a8d9.asciidoc b/docs/examples/fc8a426f8a5112e61e2acb913982a8d9.asciidoc index 2200809460..54e964fc53 100644 --- a/docs/examples/fc8a426f8a5112e61e2acb913982a8d9.asciidoc +++ b/docs/examples/fc8a426f8a5112e61e2acb913982a8d9.asciidoc @@ -1,4 +1,4 @@ -// index-modules/index-sorting.asciidoc:138 +// index-modules/index-sorting.asciidoc:137 [source, python] ---- diff --git a/docs/examples/fe6a21b4a6b33cd6abc522947d6f3ea2.asciidoc b/docs/examples/fe6a21b4a6b33cd6abc522947d6f3ea2.asciidoc index 7abdde28ea..ec76edbd43 100644 --- a/docs/examples/fe6a21b4a6b33cd6abc522947d6f3ea2.asciidoc +++ b/docs/examples/fe6a21b4a6b33cd6abc522947d6f3ea2.asciidoc @@ -1,4 +1,4 @@ -// mapping/types/date.asciidoc:250 +// mapping/types/date.asciidoc:249 [source, python] ---- diff --git a/docs/examples/fe7169bab8e626f582c9ea87585d0f35.asciidoc b/docs/examples/fe7169bab8e626f582c9ea87585d0f35.asciidoc index dc1e04c17b..1c69a70f7a 100644 --- a/docs/examples/fe7169bab8e626f582c9ea87585d0f35.asciidoc +++ b/docs/examples/fe7169bab8e626f582c9ea87585d0f35.asciidoc @@ -1,4 +1,4 @@ -// mapping/types/histogram.asciidoc:99 +// mapping/types/histogram.asciidoc:98 [source, python] ---- diff --git a/docs/guide/release-notes.asciidoc b/docs/guide/release-notes.asciidoc index bb246a064a..18429e749f 100644 --- a/docs/guide/release-notes.asciidoc +++ b/docs/guide/release-notes.asciidoc @@ -1,6 +1,7 @@ [[release-notes]] == Release notes +* <> * <> * <> * <> @@ -39,6 +40,19 @@ * <> * <> +[discrete] +[[rn-8-15-0]] +=== 8.15.0 (2024-08-09) + +- Added the Connector API (https://github.com/elastic/elasticsearch-py/pull/2623[#2623]) +- Added support for sequences of job id, model id and tags where applicable in ML APIs +- Added `dry_run` and `force` parameters to the Perform inference API +- Added optional Arrow deserialization support (https://github.com/elastic/elasticsearch-py/pull/2632[#2632]) +- Merged Query Ruleset API into new Query Rules API (https://github.com/elastic/elasticsearch-py/pull/2607[#2607]) +- Added mapping code examples (https://github.com/elastic/elasticsearch-py/pull/2596[#2596]) +- Fixed reference docs (https://github.com/elastic/elasticsearch-py/pull/2629[#2629]) +- Dropped Python 3.7 support (https://github.com/elastic/elasticsearch-py/pull/2618[#2618]) + [discrete] [[rn-8-14-0]] === 8.14.0 (2024-06-06) diff --git a/elasticsearch/_version.py b/elasticsearch/_version.py index 9860a89685..903b0f6944 100644 --- a/elasticsearch/_version.py +++ b/elasticsearch/_version.py @@ -15,4 +15,4 @@ # specific language governing permissions and limitations # under the License. -__versionstr__ = "8.14.0" +__versionstr__ = "8.15.0" From c77104d621761c8c3dd5cbfe67529e65d0bed32b Mon Sep 17 00:00:00 2001 From: Miguel Grinberg Date: Mon, 12 Aug 2024 11:21:00 +0100 Subject: [PATCH 2/2] added one more spec update --- docs/guide/release-notes.asciidoc | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/guide/release-notes.asciidoc b/docs/guide/release-notes.asciidoc index 18429e749f..920aa8bd7c 100644 --- a/docs/guide/release-notes.asciidoc +++ b/docs/guide/release-notes.asciidoc @@ -45,6 +45,7 @@ === 8.15.0 (2024-08-09) - Added the Connector API (https://github.com/elastic/elasticsearch-py/pull/2623[#2623]) +- Added support for https://www.elastic.co/guide/en/elasticsearch/reference/master/semantic-text.html[semantic_text] and https://www.elastic.co/guide/en/elasticsearch/reference/master/query-dsl-semantic-query.html[semantic query]. - Added support for sequences of job id, model id and tags where applicable in ML APIs - Added `dry_run` and `force` parameters to the Perform inference API - Added optional Arrow deserialization support (https://github.com/elastic/elasticsearch-py/pull/2632[#2632])