perf(search): prefix-by-default Deployments and config-audit search; bounded Contains opt-in (ScadaBridge#50)

Deployments free-text search and the config-audit EntityName filter no longer
emit LIKE '%term%' by default. Prefix (LIKE 'term%') is the default; substring
is an explicit opt-in (DeploymentSearchMode.Contains / entityNameContains)
always bounded by a DeployedAt/Timestamp window (explicit, else 30 days).
Migration PrefixSearchIndexes adds DeployedBy, RevisionHash and EntityName
indexes. Deployments page gains a 'Match anywhere' checkbox.

Claude-Session: https://claude.ai/code/session_01GT67AEHd2Acv1YPwGfXEoV
This commit is contained in:
Joseph Doherty
2026-11-09 15:42:56 -05:00
parent 0ce6633270
commit 47f3a703bf
15 changed files with 2620 additions and 44 deletions
@@ -92,6 +92,9 @@ namespace ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Migrations
b.HasIndex("EntityId");
b.HasIndex("EntityName")
.HasDatabaseName("IX_AuditLogEntries_EntityName");
b.HasIndex("EntityType");
b.HasIndex("Timestamp");
@@ -283,11 +286,17 @@ namespace ZB.MOM.WW.ScadaBridge.ConfigurationDatabase.Migrations
b.HasKey("Id");
b.HasIndex("DeployedBy")
.HasDatabaseName("IX_DeploymentRecords_DeployedBy");
b.HasIndex("DeploymentId")
.IsUnique();
b.HasIndex("InstanceId");
b.HasIndex("RevisionHash")
.HasDatabaseName("IX_DeploymentRecords_RevisionHash");
b.HasIndex("DeployedAt", "Id")
.IsDescending()
.HasDatabaseName("IX_DeploymentRecords_DeployedAt_Id");