ACOR Documentation

Aho-Corasick on Redis, with one API across multiple topologies.

ACOR is a Go library and CLI for storing and querying Aho-Corasick patterns in Redis. It supports standalone Redis, Sentinel, Cluster, and Ring deployments through the same Create API.

Getting Started

ACOR requires Go 1.25 or newer and Redis 3.0 or newer, or Valkey 7.2 or newer.

go get github.com/skyoo2003/acor/pkg/acor@v0.10.0
package main

import (
  "fmt"

  "github.com/skyoo2003/acor/pkg/acor"
)

func main() {
  ac, err := acor.Create(&acor.AhoCorasickArgs{
    Addr: "localhost:6379",
    Name: "sample",
  })
  if err != nil {
    panic(err)
  }
  defer ac.Close()

  _, _ = ac.Add("redis")
  matched, _ := ac.Find("redis-backed matching")
  fmt.Println(matched)
}

Explore the Documentation