Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions docs/quickstart/typesense.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ By the end, you'll have hands-on experience setting up Postgres change data capt
-p 8108:8108 \
-v ./typesense-data:/data \
--restart on-failure \
typesense/typesense:28.0 \
typesense/typesense:29.0 \
--data-dir /data \
--api-key=my-api-key \
--enable-cors
Expand Down Expand Up @@ -107,8 +107,17 @@ By the end, you'll have hands-on experience setting up Postgres change data capt

```elixir
def transform(action, record, changes, metadata) do
Map.take(record, ["id", "name", "price"])
record
|> Map.take(["id", "name", "price"])
|> Map.update("id", nil, fn id ->
cond do
is_binary(id) -> id
is_integer(id) -> Integer.to_string(id)
true -> to_string(id)
end
end)
end

```

This transform will take the `id`, `name`, and `price` fields from the `products` table and use them to create a new document in Typesense.
Expand All @@ -129,7 +138,7 @@ By the end, you'll have hands-on experience setting up Postgres change data capt
<Step title='Configure Typesense'>
In the Typesense card, enter your Typesense configuration:

- Host: `http://host.docker.internal:8108`
- Host: `http://host.docker.internal:8108` (or `http://typesense-server:8108`)
- Collection: `products`
- API Key: `my-api-key`

Expand Down Expand Up @@ -264,4 +273,4 @@ Now you're ready to connect your own database to Sequin and start streaming chan
<Card title="Guide: Setting up a Typesense sink" icon="search" href="/how-to/stream-postgres-to-typesense">
Setup a Typesense sink to keep your search index in sync.
</Card>
</CardGroup>
</CardGroup>
Loading