feat: pass IndexConfig to repositories with scalability options - #981
Merged
Conversation
5 tasks
ochanism
force-pushed
the
enhancement/1205-3-2
branch
from
April 16, 2026 06:39
35e3f33 to
9ad0b6b
Compare
5 tasks
ochanism
force-pushed
the
enhancement/1205-3-2
branch
from
April 17, 2026 01:02
9ad0b6b to
f9daca2
Compare
ochanism
marked this pull request as ready for review
April 17, 2026 01:04
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
Pass VectorStore's IndexConfig to all repository constructors so that custom index/collection names and shard/replica settings take effect. Previously
engine_factoryignoredstore.IndexConfig, causing all DB stores to use the same env-var defaults — breaking the core value of VectorStore separation.Part of #921
Changes
IndexConfig struct (5 new scalability fields):
ShardNumber,ReplicationFactor(Qdrant)ShardsNum,ReplicaNumber(Milvus — shards at CreateCollection, replicas at LoadCollection)DesiredShardCount(Weaviate)Repository constructors (all accept optional
*IndexConfig, nil = env fallback):createIndexIfNotExistscreateIndexIfNotExists(was missing)ensureCollectionWithShardNum+WithReplicaShardingConfig+ReplicationConfigValidation & security:
ValidateIndexConfig: name regex + numeric bounds (shards ≤ 64, replicas ≤ 10)CreateStore(prevents ES v7/v8 SDK mismatch)Other:
ResolveIndexName/ResolveCollectionNamewith env fallbackOptionalUint32with negative overflow guard/typesAPI updated with all scalabilityindex_fieldsCore
Key files:
internal/types/vectorstore.go— IndexConfig fields, getters, validationinternal/container/engine_factory.go— passes&store.IndexConfigto each repositoryinternal/container/container.go— passesnilto env path (preserves existing behavior)elasticsearch/v7/,elasticsearch/v8/,qdrant/,milvus/,weaviate/Why
Test Plan
Related