Repository navigation
Conversation
❌ PR checklist incompleteThis PR cannot be merged until the following are addressed on its linked issue:
The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically. Maintainers can bypass this check by adding the |
…dexes that cannot hold them
…ndex and keep migrate off DJL
…in a staged generation
…t hold the vectors
Code Review ✅ Approved 🔴 High risk 2 closed / 2 findingsChanges vector-index rebuilds and alias promotion across both search engines; faulty coordination could leave semantic-search indexes incomplete or unavailable. Reconciles live vector fields with the configured embedding model on both Elasticsearch and OpenSearch, so vector indexes are created with the pinned field and the post-upgrade ✅ 2 closed✅ Quality: Optional field with null as 'not resolved yet' sentinel
✅ Bug: Smart reindex never rebuilds a mismatched ontology chunk index
VerificationRules No rules evaluated Functional validation Not enabledAuto-approval Not enabledFor more verification details, comment OptionsDisplay: compact → Showing compact verification results. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
Describe your changes:
Follow-up to PR #38517.
The gap. On main,
migrateand server start create indexes before any embedding client exists, so vector indexes get noembeddingfield (on OpenSearch noindex.knn, which cannot be added later). After a model switch, vector writes fail one by one and vector search returns 500.What changes.
SearchRepository.getEmbeddingModel()reads it from the configuration, somigrateand startup create vector indexes with the pinned field, the model in_metaand, on OpenSearch,index.knn, without provider credentials. For DJL,migratesets onlyindex.knnand server start declares the field. A model is its exact configured id.EmbeddingFieldUpdate), both engines: declare a missing field, keep one that holds the model, leave anything else. Another model of the same dimension is fully fixed only with PR #38882.migratelog one error naming each index and the way out, and never fail on it.VectorFieldHealth): writes skip such indexes; vector search reads only the indexes that can hold the vectors and answers 503 when none can. The status page's Semantic Search step says so.reindexrepairs them. The smartreindex(no--force) counts such an index as out of date (CANNOT_HOLD_VECTORS), so any upgrade rebuilds exactly those; the status page and command log name each index. The OpenSearch ontology chunk index is rebuilt with both term types and swapped in once both are promoted. No migration, no server-started rebuild.Decision record: ADR:2026-11-26-the-server-reconciles-live-vector-fields-with-the-embedding-model; ADR:2026-11-23-elasticsearch-vector-fields-pin-their-index-options updated.
Release note. OpenSearch indexes created by a 2.1
migratelack vector support; the standard post-upgradereindexrebuilds them, and the status page names them meanwhile. Changing the configured embedding model id, even cosmetically (a Bedrockus.prefix), makes the next post-upgradereindexre-embed the whole catalog, which costs provider calls.Type of change:
Tests:
ElasticsearchVectorMappingUpdateIT(ES 9.3.0) 14/14,OpenSearchVectorMappingUpdateIT(OS 3.4.0) 16/16,VectorChunkIndexIT(both engines) 12/12.Manual testing performed
E2E on OS 3.4.0, upgrade from
main, 40 vector indexes withoutindex.knn(tablerebuilt):mainreindexreindexagainModel switch (384 to 768) after an ontology release, then smart
reindex:ontology_embeddings_chunksreindexagainChecklist: