// 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: "example-index",
  mappings: {
    properties: {
      text: {
        type: "text",
      },
      vector: {
        type: "dense_vector",
        dims: 1,
        index: true,
        similarity: "l2_norm",
        index_options: {
          type: "hnsw",
        },
      },
      integer: {
        type: "integer",
      },
    },
  },
});
console.log(response);

const response1 = await client.index({
  index: "example-index",
  id: 1,
  document: {
    text: "rrf",
    vector: [5],
    integer: 1,
  },
});
console.log(response1);

const response2 = await client.index({
  index: "example-index",
  id: 2,
  document: {
    text: "rrf rrf",
    vector: [4],
    integer: 2,
  },
});
console.log(response2);

const response3 = await client.index({
  index: "example-index",
  id: 3,
  document: {
    text: "rrf rrf rrf",
    vector: [3],
    integer: 1,
  },
});
console.log(response3);

const response4 = await client.index({
  index: "example-index",
  id: 4,
  document: {
    text: "rrf rrf rrf rrf",
    integer: 2,
  },
});
console.log(response4);

const response5 = await client.index({
  index: "example-index",
  id: 5,
  document: {
    vector: [0],
    integer: 1,
  },
});
console.log(response5);

const response6 = await client.indices.refresh({
  index: "example-index",
});
console.log(response6);
----
