Handling k-NN engine changes when upgrading OpenSearch

OpenSearch changed its default k-NN engine from NMSLIB to Faiss in 2.18 and removed several k-NN settings in 3.0. This page explains what breaks, how to test vector search before and after an upgrade, and what drives the effort.

On this page

Why k-NN engine changes matter when you upgrade OpenSearch

If your self-managed cluster serves similarity search from knn_vector fields, a general upgrade checklist will not cover the risk. Vector behavior changes at two points: in 2.18, when the default k-NN engine moved from NMSLIB to Faiss and cosinesimil vectors without an explicit engine began being normalized to unit length during indexing, and in 3.0, when NMSLIB was deprecated and several k-NN settings were removed. Because each change can alter scores, index behavior or whether a mapping loads at all, k-NN needs its own test plan that runs alongside the platform upgrade.

Start by confirming which path your cluster can take. The OpenSearch migration documentation lists rolling upgrades, snapshot and restore, remote reindexing and Migration Assistant as the supported methods, and the Security and Dashboards side of the cluster will follow the same version timeline. Check the current release list before you pick a target, because each version stays under maintenance only until the next major version enters maintenance or one year passes, whichever is longer. Maintenance releases receive bug and security fixes but no new features, so a cluster that sits on an older line may face a forced move at a bad time. Plan the upgrade around a version you can stay on for a while, not the newest minor release.

Your first action is an inventory. List every index with a knn_vector field, record the method block (engine, space_type and any algo_param values) and note whether the field relies on defaults. Fields that set neither engine nor space type are the ones most likely to change behavior after 2.18, and any use of the removed 3.0 settings will fail or need rewriting. Ask your team, or the vendor if you use a hosted variant, to confirm how each index was created, because the mapping on disk tells you what was requested, not what the cluster will apply after the upgrade.

Which k-NN changes affect your upgrade

This table maps each k-NN change in the OpenSearch breaking changes documentation to its effect on vector indexes and queries, and to the check you should run before upgrading. Read it against your current version: the 2.18 rows matter if you upgrade from 2.17 or earlier, and the 3.0 rows matter for any move into the 3.x line. Confirm each row against the breaking changes docs for your exact target version before you plan the change.

ChangeImpactAction needed
Default engine switch from NMSLIB to Faiss in 2.18knn_vector fields without an explicit engine may be built with Faiss after the upgrade, so index behavior and search results can differ from earlier indexes.List every knn_vector mapping and note which ones set an engine. Confirm the engine change in the OpenSearch breaking changes docs.
Cosinesimil vectors without an explicit engine are normalized to unit length during indexingStored vectors for cosine fields may be normalized, which can change scores and ranking for applications that expected raw values.Test ranking on a sample of known queries before and after the upgrade. Confirm the normalization behavior for your target version in the breaking changes docs.
NMSLIB deprecated in 3.0Indexes that depend on NMSLIB are on a deprecated engine, so new work on them has a limited future and the engine needs a planned exit.Identify all indexes that use NMSLIB. Decide whether to rebuild them on Faiss or another supported engine, and confirm the deprecation scope in the breaking changes docs.
Removal of knn.plugin.enabled in 3.0Cluster settings or automation that still set this key may fail or be ignored after the upgrade.Search configuration files, cluster settings scripts and infrastructure code for this key and remove or replace it. Confirm the replacement in the breaking changes docs.
Removal of index.knn.algo_param.ef_construction and index.knn.algo_param.m in 3.0Index templates and create-index requests that set these parameters may be rejected, blocking index creation or reindexing.Check index templates and create-index calls for these keys. Move tuning into the method parameters that the knn_vector mapping supports, and confirm them in the methods and engines docs.
Removal of index.knn.space_type in 3.0Index-level space type settings no longer apply, so distance metrics may change if they were set only at index level.Confirm where each index defines its space type and move the setting into the knn_vector mapping. Verify distance results with test queries after the upgrade.

How the default engine switch to Faiss affects existing indexes

The impact of the 2.18 default engine change depends on whether each knn_vector field names its engine explicitly. In OpenSearch 2.18 the default k-NN engine changed from NMSLIB to Faiss. A field that already declares its method.name, method.engine and space_type keeps its behavior after the upgrade. A field that relies on the default does not, because the engine it resolves to is now Faiss. Before you start a rolling upgrade or restore from a snapshot, export every index mapping and sort the knn_vector fields into two groups: those with an explicit engine and those without. The second group is where the upgrade needs close review.

The most important side effect involves cosinesimil vectors without an explicit engine. For those fields, OpenSearch normalizes each vector to unit length during indexing, so the stored vector is no longer the raw embedding your pipeline sent. Cosine similarity ranks by angle, so normalization changes the stored values but generally leaves the ordering intact. Scores and any thresholds you set on them can still shift, and code that reads stored vectors or compares them with values computed elsewhere will see different numbers. Confirm this behavior on a copy of a representative index, compare top results and scores for a sample of queries against the old cluster, and check every downstream consumer of the raw vectors.

Faiss assumes items are compared with L2 (Euclidean) distance or dot product, and OpenSearch uses Faiss as one of its vector engines, so the space type you choose must match what the engine supports and what your embedding model was trained for. Confirm the engine, method and space_type for each field from the mapping export rather than from memory of earlier releases, and record the result in your upgrade plan. Also confirm with your embedding model documentation whether its vectors are expected to be normalized. The OpenSearch methods and engines documentation lists which engines support which methods and spaces, and it should be the reference for each decision.

What to inventory and back up before changing k-NN settings

Changing the k-NN engine or its settings can alter index behavior and search results, so the team needs a complete record of what exists and a way to return to it. The cards below cover the inventory, the backups, the test environment and the baseline measurements that let you compare the upgraded cluster with the one you run today.

Inventory knn_vector mappings

List every index with a knn_vector field and record the engine, method and space type for each one. Mappings that omit the engine rely on the default, which changed in 2.18, so those fields need to be written out explicitly before the upgrade. Include the dimension, the vector count and the owning application, because those details decide which indexes need reindexing or retesting.

Methods and engines docs

Snapshot indexes before upgrading

Take a snapshot of every index that holds vectors and store it in a repository the upgrade cannot touch. Confirm the snapshot completed and that it restores in a test environment, because a snapshot you have not restored is not yet a recovery plan. Keep the snapshot until the upgraded cluster has passed your acceptance checks.

Build a test cluster

Stand up a cluster on the target version and load a representative sample of your vectors into indexes with the same mappings as production. Use real query vectors where you can, since synthetic data can hide differences in recall. Run your planned upgrade and rollback steps against it first so the production change has no untested steps.

Record baseline recall and latency

Before any change, run a fixed set of queries against the current cluster and record the results they return, along with recall against known nearest neighbors and query latency. Store the query set and the results with the cluster version. Without this baseline, a drop in relevance after the upgrade is hard to attribute to the engine change.

List plugins and templates setting k-NN

Find every index template, component template, ingest pipeline, automation script and client library that sets k-NN options. Remove or update settings that OpenSearch 3.0 removed, such as knn.plugin.enabled, index.knn.algo_param.ef_construction, index.knn.algo_param.m and index.knn.space_type. Templates often apply to new indexes silently, so they must be checked against the new version as well as existing mappings.

Breaking changes docs

How to sequence the upgrade and k-NN validation

The sequence confirms the target path, records which engine each vector field uses, and proves on a copy that vector search returns the same results before any production node changes. It produces a documented baseline and a rollback point for each stage.

  1. Confirm the target version and supported path

    Identify the current OpenSearch version and the target version, then check the breaking changes documentation for every major and minor boundary in between. Confirm which upgrade method the cluster supports, since rolling upgrades only accept adjacent major versions. The owner is the platform team with the application owner. Done means a written upgrade path with the target version pinned and the removed k-NN settings listed for that path.

  2. Inventory and pin engines on every knn_vector field

    Export every index mapping that contains a knn_vector field and record the method, engine, space type and parameters for each one. Flag any cosinesimil field that does not name an engine, because the default engine change in 2.18 normalizes those vectors during indexing. Pin the engine explicitly in mappings where the current behavior must hold. Done means a signed inventory file that lists each index, field, engine and space type, reviewed by the team that owns the search workload.

  3. Take and verify a snapshot

    Register a snapshot repository outside the cluster if one is not already in use, then take a snapshot of all indexes that hold vector data. Confirm the snapshot state is successful and restore a sample index to a scratch cluster to prove the data is usable. Done means a verified snapshot ID recorded with the inventory, which becomes the restore point if the upgrade fails before any rolling step is committed.

  4. Rehearse the upgrade on a copy

    Restore the snapshot into a non-production cluster running the current version, then upgrade that copy using the same method planned for production. Remove or replace any settings that the target version no longer accepts, such as the removed knn plugin enable flag and the removed index-level k-NN parameters, and record each change. Done means the copy runs on the target version with every index green and an exact list of configuration edits.

  5. Remove or replace removed k-NN settings

    Update templates, index settings, client libraries and infrastructure code so they no longer send settings removed in the target release. Where a vector index was built with a setting that no longer applies, plan the replacement through its mapping rather than by editing a live index. Done means a diff of configuration repositories with no references to removed settings and a clean run of the index creation scripts against the rehearsal cluster.

  6. Upgrade production with the chosen method

    Carry out the upgrade on production using rolling upgrade, snapshot and restore, or Migration Assistant, as the path confirmed in step one allows. For a rolling upgrade, check cluster health between each node restart and do not continue while shards are unassigned. Done means every node runs the target version, cluster health is green, and the change record lists the time of each node restart.

  7. Reindex or rebuild vector indexes where required

    Where the mapping for a vector field must change, such as an explicit engine that the new default would otherwise replace, create a new index with the corrected mapping and reindex the data into it. Keep the original index until validation passes. Done means each affected vector index has a rebuilt counterpart with the same document count, and the aliases point to the version that passed the checks.

  8. Compare query results against the baseline and set rollback points

    Run a fixed set of representative k-NN queries against the old and new indexes, and compare the top results, scores and recall against the baseline captured before the upgrade. Investigate any difference that changes the ranking users see. Record a rollback point after each stage. Note that a rolling upgrade cannot be reversed by downgrading nodes, so the rollback for that path is a restore from the verified snapshot onto a cluster that runs the earlier version. Done means a signed comparison report and a documented rollback decision for each stage.

Decision path for each knn_vector field during upgrade

The review starts with each knn_vector field and asks whether its mapping sets an explicit engine. If it does not and the space type is cosinesimil, the team checks how unit-length normalization changes stored vectors and retests recall. If the mapping uses NMSLIB or a setting removed in 3.0, the mapping must change and the index must be rebuilt by reindexing. Fields that match neither case keep their mapping, and the team verifies query results after the upgrade.

Per-field decision path for k-NN mappings before and after an OpenSearch upgrade.

What makes k-NN upgrades take longer

This table lists the factors that change how much work a k-NN engine change adds to an OpenSearch upgrade, and how each one moves effort. Read it before estimating, then ask your partner or internal team to confirm which drivers apply to your cluster, since the number of fields, vectors and templates varies widely between environments. The main takeaway is that the vector data volume and the amount of NMSLIB-specific configuration you already have matter more than the version jump itself.

DriverEffect on effortHow to keep it down
Number of knn_vector fields and indexesEach field needs its mapping, engine and method reviewed, and each index may need a reindex or rebuildInventory every knn_vector mapping first and group indexes that share settings
Vector count and dimensionsMore vectors and higher dimensions increase reindex time, memory needed during rebuild and validation scopeMeasure vector counts and dimensions per index before the upgrade window is set
NMSLIB-specific settings in templates and codeIndex templates, client code and infrastructure-as-code that set removed keys must be found and changed before cutoverSearch templates, clients and Helm or Terraform files for the removed setting names
Recall and relevance testingEngine or normalization changes can shift nearest-neighbor results, so comparison tests against a baseline add workKeep a fixed set of benchmark queries and expected neighbors from the current cluster
Plugin and Dashboards version alignmentPlugins and Dashboards must match the target core version, which can add upgrade steps and retestingList every plugin in use and confirm its target version before the first node is changed
Rolling or snapshot-based upgradeA rolling upgrade reindexes in place on live nodes, while a snapshot restore to a new cluster needs a second environment and a data cutover planChoose the method after confirming target version, data size and tolerance for write downtime

Questions teams ask about k-NN changes during upgrades

How much effort does a k-NN upgrade need and what drives it?

The effort depends mostly on how many indexes use knn_vector fields, how those fields were mapped, and how much the application relies on exact result ordering. A cluster with one vector index that uses default settings is a small check. A cluster with many indexes, custom method parameters, or several applications querying the same vectors is a larger project. The main drivers are:

  • The number of vector indexes and whether their mappings set an engine explicitly
  • Whether the team has representative test data and query samples ready
  • Whether the upgrade path is a rolling upgrade, snapshot restore, or Migration Assistant, since each changes how much testing is needed
  • How many downstream consumers depend on scores or ranking. Confirm the scope against the breaking changes documentation for your target version before estimating.
Can our own team handle the k-NN upgrade internally?

A team that already runs OpenSearch and has someone comfortable with index mappings and query tuning can usually handle a small, well-documented cluster internally. The work is mostly inventory, mapping review, a test cluster, and comparison of results before and after. Teams without a vector search owner, or with many indexes and tight recall expectations, often bring in outside help for the testing and evidence work. Whichever route you choose, the engineers who own the application queries should be part of the testing, because they know which results matter.

What do we need to provide for a k-NN upgrade assessment?

The work needs three inputs from your side. First, an inventory of every index with a knn_vector field, including its mapping, space_type, engine, and method parameters, pulled from the live cluster. Second, representative test data, either a copy of production vectors or a sample that reflects their dimensions, volume, and distribution. Third, a set of real query samples with the expected top results, so the team can compare ranking before and after the change. Ask whoever owns the application to confirm which queries and filters must keep working, because that decides what counts as a regression.

Do existing vectors have to be reindexed after the engine change?

It depends on whether the index relies on the default engine and on the settings you plan to keep. In OpenSearch 2.18 the default k-NN engine changed from NMSLIB to Faiss, so an index created without an explicit engine may behave differently after the change. Check each mapping rather than assuming. Where the engine or method must stay the same, the mapping should set it explicitly before the upgrade. Where behavior would change in a way the application cannot accept, plan a reindex into a new index with a defined mapping, then test it. The decision should be recorded per index, not made once for the whole cluster.

Do cosine similarity results change after upgrading to 2.18?

They can. According to the breaking changes documentation, in OpenSearch 2.18 cosinesimil vectors without an explicit engine are normalized to unit length during indexing. Once vectors are normalized, cosine ranking can shift compared with the previous behavior, and scores you stored or compared against old thresholds may no longer match. The safest check is a before-and-after comparison on your own query samples, looking at top results and any score cutoffs your application applies. Do not assume that a small score difference is harmless until the application team has reviewed it.

What changes for k-NN settings when moving to OpenSearch 3.0?

OpenSearch 3.0 deprecated NMSLIB and removed several settings, including knn.plugin.enabled, index.knn.algo_param.ef_construction, index.knn.algo_param.m, and index.knn.space_type, according to the breaking changes documentation. Any index template, cluster setting, or automation script that still sets these will need to be found and updated before the upgrade. Search your configuration management, templates, and application code for those names. Then confirm the replacement mapping and method settings for your target version in the official docs, and test index creation on a non-production cluster.

What should we confirm in the OpenSearch docs and in our own environment?

Confirm three things before you plan the work. In the OpenSearch documentation, confirm the breaking changes for every version between your current release and your target, and the methods and engines your mappings use, starting with the methods and engines documentation. In your own environment, confirm the exact version, which indexes use vectors, and whether any clients or pipelines set engine or space type. Also confirm which upgrade path your cluster supports, because the k-NN steps differ between rolling upgrades and snapshot restores. Write these answers down, since they decide the test plan.

How to test vector search and plan rollback

Test the upgraded k-NN behavior against the current cluster before cutover, and decide in advance what counts as a pass. Replay a fixed set of production-like queries against both the baseline and a candidate cluster, then compare three things: recall against the nearest neighbors you know are correct, latency at the percentiles your application depends on, and the result sets themselves, including ordering and any filtered queries. Cosine indexes deserve particular attention because the normalization change in 2.18 can shift scores even when recall looks stable. Record which queries are replayed, how they were sampled, and the exact index settings on both sides, so a difference can be traced to the engine rather than to a changed dataset.

Confirm the index choices during this testing, not after. FAISS index types trade off search time, search quality, memory per vector, training time, adding time and the need for training data, and the same trade-offs apply whether you run CPU or GPU indexes. A configuration that meets recall on a small sample may miss targets on full volume, and a GPU build path may behave differently from the CPU path you tested. Ask your search team to set explicit acceptance thresholds for recall, p95 or p99 latency and memory use before the run starts, and to state which engine and method each index uses. Stop the rollout if any threshold is missed, and re-index with a corrected method rather than tuning on the live cluster.

Plan rollback before the first node restarts, because a rolling upgrade cannot be downgraded. Your fallback is a verified snapshot taken before the upgrade, plus either a parallel cluster on the prior version that remains in service until the new one is accepted, or a tested restore path into a new cluster. Confirm that the snapshot repository is reachable from the restore target, that the snapshot includes the vector indexes, and that you have rehearsed a restore and a cutover of application traffic. Keep the old cluster's index settings and the upgrade notes with the runbook, and define who decides to roll back and the time window in which that decision remains practical. Confirm the exact snapshot and restore behavior for your version in the migrate or upgrade documentation.

How DeployOpen scopes and delivers a k-NN upgrade

DeployOpen approaches k-NN engine changes as a planned upgrade, starting with an inventory of every knn_vector field, its engine and its distance settings. The work is delivered inside infrastructure you control, with testing, documentation and handover designed for the teams who will run the cluster afterward.

How we scope

  • Inventory every knn_vector field, its engine, space type and index settings across all indexes in the cluster
  • Identify cosinesimil fields that relied on the pre-2.18 NMSLIB default and need a normalization review
  • Agree in writing which removed NMSLIB settings from 3.0 appear in templates, scripts or client code

How we build

  • Reproduce current vector search results on a staging cluster before changing any engine or version
  • Rebuild affected indexes with explicit engine choices and compare recall, latency and memory against the baseline
  • Update index templates, client libraries and ingestion pipelines so new indexes match the agreed configuration

How we hand over

  • Deliver a written record of engine decisions, index mappings, rollback points and the test results behind them
  • Walk operators through how to check engine and normalization behavior after each future minor upgrade
  • Document which FAISS version and build options your deployment uses, so future changes can be assessed

How we support

  • Engagements are fixed-scope, with scope, deliverables and timelines agreed in writing before work starts
  • Ongoing upgrades, retesting of vector queries and cluster support are available as a retainer
  • Ask any quote to separate the one-time migration work from recurring support and retesting effort

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.