Skip to main content

Algorithm Overview

The change detection process follows a three-phase matching algorithm:
  1. Exact Matches: Objects that are completely identical (with whitespace normalization)
  2. Partial Matches: Objects that are similar enough to be considered the same but with changes
  3. Leftovers: Remaining objects classified as either new or removed

Matching Methods

Key Field Matching (Optional)

When key fields are configured in your schema, objects are matched based on these fields. ALL key fields must match for objects to be considered the same:
// Previous run
{
  "id": "12345",
  "title": "Product A",
  "price": "$100"
}

// Current run
{
  "id": "12345",           // Key field matches
  "title": "Product A Pro", // Changed
  "price": "$150"          // Changed
}
Result: changed - ID matches, so same object with updates Key Field Behavior:
  • Key fields defined with isKey: true in your schema
  • Common key fields: id, url, link, sku
  • If ANY key field changes, objects treated as removed + added (not changed)

Traditional Field Matching (Default)

When no key fields are configured, objects are matched if they share >50% of their fields:
// Previous run
{
  "name": "John Doe",
  "age": "25",
  "city": "New York"
}

// Current run
{
  "name": "John Doe",     // Same
  "age": "26",           // Changed
  "city": "New York"     // Same
}
Field Match Calculation: 2 out of 3 fields match = 66.7% > 50% Result: changed - Field match ratio exceeds threshold Notes:
  • Only string fields considered in ratio calculation
  • Empty fields and non-string values excluded

Change Types

Changed: Object matched but some fields differ Added: Object exists in current run but no match in previous run Removed: Object existed in previous run but no match in current run

Method Comparison

Key Field Matching
  • When used: Optional, set isKeyField: true in schema
  • Logic: ALL key fields must match exactly
  • Best for: Reliable matching even with major content changes
Traditional Matching (Default)
  • When used: No key fields configured
  • Logic: >50% of fields must match
  • Best for: Simple setup, works without configuration
I