You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Changing a model-declared index definition is silently ignored for an existing index #191
When the context opens, DocumentCollection.ApplyIndexBuilder resolves the index name and returns early if an index with that name already exists. The existing index is rebuilt from the stored metadata in the CollectionIndexManager constructor (RebuildDefinition(idxMeta.Name, idxMeta.PropertyPaths, idxMeta.IsUnique, idxMeta.Type, idxMeta.Dimensions, idxMeta.Metric)). So when a new app version changes any of these for an index with the same name, the old definition stays in use, without a warning:
the unique: flag
vector dimensions / metric
the key selector / property paths (with an explicit name:)
A changed key selector with a generated name is the opposite case. The new index is added, and the old one stays and is maintained on every write until it is dropped by hand.
Options: on open, compare the declared definition with the stored one, then either throw with a clear message or drop and rebuild the index (through the #175 backfill path, so a failure saves nothing). Model indexes that are no longer declared could be reported or dropped the same way.
Activity