## TL;DR

Add it to your index-creation template alongside the knn_vector mapping so the ANN structures actually get built.

## Steps

1. Always create OpenSearch vector indexes with "index.knn": true from the start. If you forget, everything looks fine: mappings are accepted, documents index, and no error appears until the first k-NN query fails. The setting is static, so you cannot flip it on an existing index; you have to rebuild. Add it to your index-creation template alongside the knn_vector mapping so the ANN structures actually get built.

## When to use

You are seeing this: Always create OpenSearch vector indexes with "index.knn": true from the start. Use this skill when you run into "OpenSearch needs index.knn true at creation, or k-NN search silently never works".

## When not to use

If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.

## Versions

No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.

## Why this happens

The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.
