ACOR Documentation

Schema V1 (Legacy)

V1 is the original ACOR storage schema. It uses multiple Redis keys per collection.

Overview

V1 creates approximately 5 keys per 100 keywords:

Key PatternPurpose
{name}:keywordSorted set of keywords
{name}:prefixTrie prefix edges
{name}:suffixTrie suffix links
{name}:output:{state}Output keywords per state
{name}:node:{keyword}Node metadata

Performance Characteristics

OperationComplexity
Find()O(N×3-5) RTT
Add()O(M×3-10) RTT

Where:

When to Use V1

Migration to V2

# Preview migration
acor -name mycollection migrate --dry-run

# Execute migration
acor -name mycollection migrate

# Rollback to V1
acor -name mycollection migrate-rollback

Key Structure Diagram

graph LR
    A[keyword set] --> B[prefix trie]
    B --> C[suffix links]
    C --> D[output sets]
    D --> E[node metadata]

Limitations

Recommendation

Migrate to V2 for new collections or when performance is critical.