// This file is autogenerated, DO NOT EDIT
// Use `node scripts/generate-docs-examples.mjs` to generate the docs examples

[source, js]
----
const response = await client.indices.create({
  index: "my-index-000001",
  mappings: {
    properties: {
      my_dense_vector: {
        type: "dense_vector",
        index: false,
        dims: 3,
      },
      my_byte_dense_vector: {
        type: "dense_vector",
        index: false,
        dims: 3,
        element_type: "byte",
      },
      status: {
        type: "keyword",
      },
    },
  },
});
console.log(response);

const response1 = await client.index({
  index: "my-index-000001",
  id: 1,
  document: {
    my_dense_vector: [0.5, 10, 6],
    my_byte_dense_vector: [0, 10, 6],
    status: "published",
  },
});
console.log(response1);

const response2 = await client.index({
  index: "my-index-000001",
  id: 2,
  document: {
    my_dense_vector: [-0.5, 10, 10],
    my_byte_dense_vector: [0, 10, 10],
    status: "published",
  },
});
console.log(response2);

const response3 = await client.indices.refresh({
  index: "my-index-000001",
});
console.log(response3);
----
