Search Drift Detection
Compare design-time search schemas against deployed index schemas to identify field removals, additions, type changes, and analyser mismatches.
Search drift detection compares the search schema defined in NeoArc Studio's graph model against the actual schema deployed to your search engine. The SearchDriftDetectionService identifies fields that have been removed, added, or changed between design-time and deployment, producing a structured drift report.
How Drift Detection Works
Design-Time Schema Export
The exportDesignSchema method generates the expected index schema from the graph model and active search profile.
interface DesignTimeSchema {
indexName: string; // Resolved from entity name via profile's indexNamingConvention
entityName: string; // Source entity name
engine: string; // Search engine vendor
fields: DesignTimeField[];
}
Design-Time Field Structure
Each field in the design-time schema contains the following properties.
interface DesignTimeField {
fieldName: string; // Resolved field name (after casing transformation)
canonicalName: string; // Original canonical property name
canonicalType: string; // Canonical type from the model
resolvedType: string; // Engine-specific type (via profile type mapping)
searchFieldType?: string; // Search field type override (if set)
isKey: boolean; // Whether this is the document key
behaviours: string[]; // Search behaviours
analyzer?: string; // Analyser
}
Field Name Resolution
When resolving a field's name in the search index, the following priority applies.
| Priority | Source | Description |
|---|---|---|
| 1 (highest) | Explicit fieldName override | The fieldName value set directly on the search projection takes priority over all other resolution |
| 2 | Profile naming convention | The profile's namingConvention is applied to the canonical property name (e.g. camelCase, snake_case) |
Drift Item Types
The drift detection engine produces four types of drift items, each with a severity level that indicates the impact on your deployed index.
| Type | Severity | Description |
|---|---|---|
| field-removed | Error | Field exists in the design-time schema but is missing from the deployed index |
| field-added | Info | Field exists in the deployed index but is not present in the design-time schema |
| type-changed | Warning | Field type differs between the design-time schema and the deployed index |
| analyzer-changed | Warning | Field analyser differs between the design-time schema and the deployed index |
Drift Report Structure
interface DriftReport {
indexName: string; // Entity/index name
totalDrifts: number; // Total number of drift items
errors: DriftItem[]; // Breaking changes (field-removed)
warnings: DriftItem[]; // Potential issues (type-changed, analyzer-changed)
infos: DriftItem[]; // Informational items (field-added)
items: DriftItem[]; // All drift items combined
isClean: boolean; // True when no drift exists
}
Deployed Field Input
The deployed schema is provided as an array of DeployedField objects, normalised from the engine's native mapping format.
interface DeployedField {
fieldName: string; // Field name in the deployed index
type: string; // Engine-specific type
analyzer?: string; // Analyser name
}