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
+26
View File
@@ -0,0 +1,26 @@
-- PrefixSearchIndexes (2026-11-09, ScadaBridge#50). Indexes backing the prefix search on the
-- Deployments page (DeployedBy, RevisionHash) and the config-audit EntityName filter.
BEGIN TRANSACTION;
ALTER TABLE [TemplateNativeAlarmSources] ADD [IsMesReportable] bit NOT NULL DEFAULT CAST(0 AS bit);
ALTER TABLE [InstanceNativeAlarmSourceOverrides] ADD [IsMesReportableOverride] bit NULL;
INSERT INTO [__EFMigrationsHistory] ([MigrationId], [ProductVersion])
VALUES (N'20261109200211_AddNativeAlarmSourceMesReportable', N'10.0.13');
COMMIT;
GO
BEGIN TRANSACTION;
CREATE INDEX [IX_DeploymentRecords_DeployedBy] ON [DeploymentRecords] ([DeployedBy]);
CREATE INDEX [IX_DeploymentRecords_RevisionHash] ON [DeploymentRecords] ([RevisionHash]);
CREATE INDEX [IX_AuditLogEntries_EntityName] ON [AuditLogEntries] ([EntityName]);
INSERT INTO [__EFMigrationsHistory] ([MigrationId], [ProductVersion])
VALUES (N'20261109203753_PrefixSearchIndexes', N'10.0.13');
COMMIT;
GO