diff --git a/docs/doc_examples/15f769bbd7b5fddeb3353ae726b71b14.asciidoc b/docs/doc_examples/15f769bbd7b5fddeb3353ae726b71b14.asciidoc new file mode 100644 index 000000000..0db865fe6 --- /dev/null +++ b/docs/doc_examples/15f769bbd7b5fddeb3353ae726b71b14.asciidoc @@ -0,0 +1,28 @@ +// This file is autogenerated, DO NOT EDIT +// Use `node scripts/generate-docs-examples.js` to generate the docs examples + +[source, js] +---- +const response = await client.search({ + index: "my-index-bit-vectors", + query: { + script_score: { + query: { + match_all: {}, + }, + script: { + source: "dotProduct(params.query_vector, 'my_dense_vector')", + params: { + query_vector: [ + 0.23, 1.45, 3.67, 4.89, -0.56, 2.34, 3.21, 1.78, -2.45, 0.98, -0.12, + 3.45, 4.56, 2.78, 1.23, 0.67, 3.89, 4.12, -2.34, 1.56, 0.78, 3.21, + 4.12, 2.45, -1.67, 0.34, -3.45, 4.56, -2.78, 1.23, -0.67, 3.89, + -4.34, 2.12, -1.56, 0.78, -3.21, 4.45, 2.12, 1.67, + ], + }, + }, + }, + }, +}); +console.log(response); +---- diff --git a/docs/doc_examples/2e7844477b41fcfa9efefee4ec0e7101.asciidoc b/docs/doc_examples/2e7844477b41fcfa9efefee4ec0e7101.asciidoc new file mode 100644 index 000000000..e19fb83da --- /dev/null +++ b/docs/doc_examples/2e7844477b41fcfa9efefee4ec0e7101.asciidoc @@ -0,0 +1,43 @@ +// This file is autogenerated, DO NOT EDIT +// Use `node scripts/generate-docs-examples.js` to generate the docs examples + +[source, js] +---- +const response = await client.search({ + index: "my-index-000001", + retriever: { + rule: { + match_criteria: { + query_string: "puggles", + user_country: "us", + }, + ruleset_ids: ["my-ruleset"], + retriever: { + rrf: { + retrievers: [ + { + standard: { + query: { + query_string: { + query: "pugs", + }, + }, + }, + }, + { + standard: { + query: { + query_string: { + query: "puggles", + }, + }, + }, + }, + ], + }, + }, + }, + }, +}); +console.log(response); +---- diff --git a/docs/doc_examples/339c4e5af9f9069ad9912aa574488b59.asciidoc b/docs/doc_examples/339c4e5af9f9069ad9912aa574488b59.asciidoc new file mode 100644 index 000000000..905e21821 --- /dev/null +++ b/docs/doc_examples/339c4e5af9f9069ad9912aa574488b59.asciidoc @@ -0,0 +1,52 @@ +// This file is autogenerated, DO NOT EDIT +// Use `node scripts/generate-docs-examples.js` to generate the docs examples + +[source, js] +---- +const response = await client.indices.create({ + index: "my-index-bit-vectors", + mappings: { + properties: { + my_dense_vector: { + type: "dense_vector", + index: false, + element_type: "bit", + dims: 40, + }, + }, + }, +}); +console.log(response); + +const response1 = await client.index({ + index: "my-index-bit-vectors", + id: 1, + document: { + my_dense_vector: [8, 5, -15, 1, -7], + }, +}); +console.log(response1); + +const response2 = await client.index({ + index: "my-index-bit-vectors", + id: 2, + document: { + my_dense_vector: [-1, 115, -3, 4, -128], + }, +}); +console.log(response2); + +const response3 = await client.index({ + index: "my-index-bit-vectors", + id: 3, + document: { + my_dense_vector: [2, 18, -5, 0, -124], + }, +}); +console.log(response3); + +const response4 = await client.indices.refresh({ + index: "my-index-bit-vectors", +}); +console.log(response4); +---- diff --git a/docs/doc_examples/44198781d164a15be633d4469485a544.asciidoc b/docs/doc_examples/44198781d164a15be633d4469485a544.asciidoc new file mode 100644 index 000000000..f3125224a --- /dev/null +++ b/docs/doc_examples/44198781d164a15be633d4469485a544.asciidoc @@ -0,0 +1,23 @@ +// This file is autogenerated, DO NOT EDIT +// Use `node scripts/generate-docs-examples.js` to generate the docs examples + +[source, js] +---- +const response = await client.search({ + index: "my-index-bit-vectors", + query: { + script_score: { + query: { + match_all: {}, + }, + script: { + source: "dotProduct(params.query_vector, 'my_dense_vector')", + params: { + query_vector: [8, 5, -15, 1, -7], + }, + }, + }, + }, +}); +console.log(response); +---- diff --git a/docs/doc_examples/828f0045747fde4888a947bb99e190e3.asciidoc b/docs/doc_examples/828f0045747fde4888a947bb99e190e3.asciidoc new file mode 100644 index 000000000..a4e4969f9 --- /dev/null +++ b/docs/doc_examples/828f0045747fde4888a947bb99e190e3.asciidoc @@ -0,0 +1,27 @@ +// This file is autogenerated, DO NOT EDIT +// Use `node scripts/generate-docs-examples.js` to generate the docs examples + +[source, js] +---- +const response = await client.search({ + index: "movies", + retriever: { + rule: { + match_criteria: { + query_string: "harry potter", + }, + ruleset_ids: ["my-ruleset"], + retriever: { + standard: { + query: { + query_string: { + query: "harry potter", + }, + }, + }, + }, + }, + }, +}); +console.log(response); +---- diff --git a/docs/doc_examples/853fc710cea79fb4e1a85fb6d149f9c5.asciidoc b/docs/doc_examples/853fc710cea79fb4e1a85fb6d149f9c5.asciidoc new file mode 100644 index 000000000..0ca3674f6 --- /dev/null +++ b/docs/doc_examples/853fc710cea79fb4e1a85fb6d149f9c5.asciidoc @@ -0,0 +1,42 @@ +// This file is autogenerated, DO NOT EDIT +// Use `node scripts/generate-docs-examples.js` to generate the docs examples + +[source, js] +---- +const response = await client.search({ + index: "movies", + retriever: { + rule: { + match_criteria: { + query_string: "harry potter", + }, + ruleset_ids: ["my-ruleset"], + retriever: { + rrf: { + retrievers: [ + { + standard: { + query: { + query_string: { + query: "sorcerer's stone", + }, + }, + }, + }, + { + standard: { + query: { + query_string: { + query: "chamber of secrets", + }, + }, + }, + }, + ], + }, + }, + }, + }, +}); +console.log(response); +---- diff --git a/docs/doc_examples/8f0a3d7b5fbdf5351750a23c493cc078.asciidoc b/docs/doc_examples/acc44366a9908684b2c8c2b119a4fb2b.asciidoc similarity index 71% rename from docs/doc_examples/8f0a3d7b5fbdf5351750a23c493cc078.asciidoc rename to docs/doc_examples/acc44366a9908684b2c8c2b119a4fb2b.asciidoc index 8f14d2f77..2dcd961c6 100644 --- a/docs/doc_examples/8f0a3d7b5fbdf5351750a23c493cc078.asciidoc +++ b/docs/doc_examples/acc44366a9908684b2c8c2b119a4fb2b.asciidoc @@ -5,11 +5,15 @@ ---- const response = await client.search({ index: "my-index-000001", - query: { + retriever: { rule: { - organic: { - query_string: { - query: "puggles", + retriever: { + standard: { + query: { + query_string: { + query: "puggles", + }, + }, }, }, match_criteria: {