// 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.knnSearch({
  index: "my-index",
  knn: {
    field: "image_vector",
    query_vector: [0.3, 0.1, 1.2],
    k: 10,
    num_candidates: 100,
  },
  _source: ["name", "file_type"],
});
console.log(response);
----
