Files
elasticsearch-js/docs/doc_examples/2009f2d1ba0780a799a0fdce889c9739.asciidoc
2024-07-29 17:10:05 -05:00

56 lines
1.1 KiB
Plaintext

// 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.bulk({
index: "passage_vectors",
refresh: "true",
operations: [
{
index: {
_id: "1",
},
},
{
full_text: "first paragraph another paragraph",
creation_time: "2019-05-04",
paragraph: [
{
vector: [0.45, 45],
text: "first paragraph",
paragraph_id: "1",
},
{
vector: [0.8, 0.6],
text: "another paragraph",
paragraph_id: "2",
},
],
},
{
index: {
_id: "2",
},
},
{
full_text: "number one paragraph number two paragraph",
creation_time: "2020-05-04",
paragraph: [
{
vector: [1.2, 4.5],
text: "number one paragraph",
paragraph_id: "1",
},
{
vector: [-1, 42],
text: "number two paragraph",
paragraph_id: "2",
},
],
},
],
});
console.log(response);
----