Build real-time search indexes with Postgres change data capture (CDC) and Typesense. Learn to keep your search collections in sync with your database.
In general, we recommend that you create one collection per type of document / record you have.Similarly, Sequin recommends that you sink one Postgres table to one Typesense collection using a routing function. When significantly scaling Typesense, you may want to shard collections. For instance, you may shard your
users
collection by region into users_us
, users_eu
, users_asia
, etc.
Select source table or schema
Specify filters
insert
, update
, and/or delete
actions. We recommend selecting all three, which will ensure that your Typesense collection is kept in sync with your Postgres table.You can for instance unselect deletes
if you want to exclude deleted rows from your Typesense collection. This means that records deleted from Postgres will not be removed from your Typesense collection and will still be searchable.You can also specify filter functions to narrow down the documents you want to index. For example, if you only want to index products
that are currently in_stock
, you can add a filter on in_stock = true
. This is also useful for sharding or multi-tenancy.Specify message grouping
Enrichment
products
collection with the category
field from your categories
table, you can add a function enrichment that returns the category
field for each document:Transforms
id
field, which must be a string.record
directly, perhaps only modifying the id
field to ensure it exists and is a string.Specify backfill
Typesense configuration
Routing
Advanced configuration
Create the sink