53 lines
1.2 KiB
Plaintext
53 lines
1.2 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({
|
|
operations: [
|
|
{
|
|
index: {
|
|
_index: "amazon-reviews",
|
|
_id: "2",
|
|
},
|
|
},
|
|
{
|
|
review_text: "This product is amazing! I love it.",
|
|
review_vector: [0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8],
|
|
},
|
|
{
|
|
index: {
|
|
_index: "amazon-reviews",
|
|
_id: "3",
|
|
},
|
|
},
|
|
{
|
|
review_text: "This product is terrible. I hate it.",
|
|
review_vector: [0.8, 0.7, 0.6, 0.5, 0.4, 0.3, 0.2, 0.1],
|
|
},
|
|
{
|
|
index: {
|
|
_index: "amazon-reviews",
|
|
_id: "4",
|
|
},
|
|
},
|
|
{
|
|
review_text: "This product is great. I can do anything with it.",
|
|
review_vector: [0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8],
|
|
},
|
|
{
|
|
index: {
|
|
_index: "amazon-reviews",
|
|
_id: "5",
|
|
},
|
|
},
|
|
{
|
|
review_text:
|
|
"This product has ruined my life and the lives of my family and friends.",
|
|
review_vector: [0.8, 0.7, 0.6, 0.5, 0.4, 0.3, 0.2, 0.1],
|
|
},
|
|
],
|
|
});
|
|
console.log(response);
|
|
----
|