Skip to content

Commit 0ecc91b

Browse files
github-actions[bot]anniegale9538pquentin
authored
[Backport 8.14] adding index module code examples (#2559)
* adding index module code examples (#2554) * adding index module code examples * adding trailing comma (cherry picked from commit 3a1cd62) * Run examples generation again --------- Co-authored-by: Annie Hansen <[email protected]> Co-authored-by: Quentin Pradet <[email protected]>
1 parent 728c616 commit 0ecc91b

File tree

80 files changed

+599
-173
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+599
-173
lines changed

docs/examples/00fea15cbca83be9d5f1a024ff2ec708.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// inference/put-inference.asciidoc:275
1+
// inference/put-inference.asciidoc:452
22

33
[source, python]
44
----

docs/examples/0e5db64154a722a5cbdb84b588ce2ce8.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// mapping/types/numeric.asciidoc:275
1+
// mapping/types/numeric.asciidoc:287
22

33
[source, python]
44
----

docs/examples/10c3fe2265bb34964bd1005f9da66773.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// inference/put-inference.asciidoc:369
1+
// inference/put-inference.asciidoc:559
22

33
[source, python]
44
----

docs/examples/13ecdf99114098c76b050397d9c3d4e6.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// inference/post-inference.asciidoc:73
1+
// inference/post-inference.asciidoc:197
22

33
[source, python]
44
----
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// index-modules/index-sorting.asciidoc:16
2+
3+
[source, python]
4+
----
5+
resp = client.indices.create(
6+
index="my-index-000001",
7+
body={
8+
"settings": {
9+
"index": {"sort.field": "date", "sort.order": "desc"}
10+
},
11+
"mappings": {"properties": {"date": {"type": "date"}}},
12+
},
13+
)
14+
print(resp)
15+
----
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// index-modules/allocation/delayed.asciidoc:40
2+
3+
[source, python]
4+
----
5+
resp = client.indices.put_settings(
6+
index="_all",
7+
body={
8+
"settings": {"index.unassigned.node_left.delayed_timeout": "5m"}
9+
},
10+
)
11+
print(resp)
12+
----

docs/examples/197dc41c8df9629e145b3064c63b2ccc.asciidoc

Lines changed: 0 additions & 19 deletions
This file was deleted.

docs/examples/1aa91d3d48140d6367b6cabca8737b8f.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// docs/bulk.asciidoc:634
1+
// docs/bulk.asciidoc:632
22

33
[source, python]
44
----
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// inference/put-inference.asciidoc:671
2+
3+
[source, python]
4+
----
5+
resp = client.inference.put_model(
6+
task_type="text_embedding",
7+
inference_id="azure_ai_studio_embeddings",
8+
body={
9+
"service": "azureaistudio",
10+
"service_settings": {
11+
"api_key": "<api_key>",
12+
"target": "<target_uri>",
13+
"provider": "<model_provider>",
14+
"endpoint_type": "<endpoint_type>",
15+
},
16+
},
17+
)
18+
print(resp)
19+
----
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
// index-modules/similarity.asciidoc:22
2+
3+
[source, python]
4+
----
5+
resp = client.indices.create(
6+
index="index",
7+
body={
8+
"settings": {
9+
"index": {
10+
"similarity": {
11+
"my_similarity": {
12+
"type": "DFR",
13+
"basic_model": "g",
14+
"after_effect": "l",
15+
"normalization": "h2",
16+
"normalization.h2.c": "3.0",
17+
}
18+
}
19+
}
20+
}
21+
},
22+
)
23+
print(resp)
24+
----

0 commit comments

Comments
 (0)