A docker image which integrate ZomboDB extension with Postgres.
1.5K
This repo build a docker image which integrate ZomboDB extension with Postgres.
My github repository.
Please refer to postgres.
Sample docker-compose.yaml
---
version: '3'
services:
postgres:
image: hqiasjehrlb/postgres-zombodb:15-bullseye
environment:
POSTGRES_PASSWORD: 'postgresql'
ports:
- 5432:5432
elasticsearch:
image: elasticsearch:7.17.18
ports:
- 9200:9200
## 9300 port is for multi-node communication
# - 9300:9300
environment:
- discovery.type=single-node
Create extension
You should first create zombodb extension into your database. Sample SQL:
CREATE EXTENSION zombodb;
Create table with index
Create table sample SQL:
CREATE TABLE sample_table (
id serial,
content zdb.fulltext NOT NULL, -- column with `zdb.fulltext` type
timstamp timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
);
Create index sample SQL:
CREATE INDEX idx_sample_table
ON sample_table
USING zombodb ((sample_table.*))
WITH (url='http://elasticsearch:9200/')
Notice that if your Elasticsearch server required user auth, you can pass username/password in URL format like http://username:password@elasticsearch:9200/
Query data with full-text search
Sample SQL:
SELECT * FROM sample_table WHERE sample_table ==> 'some keywords';
Content type
Image
Digest
sha256:d15c232b3…
Size
1.5 GB
Last updated
over 2 years ago
docker pull hqiasjehrlb/postgres-zombodb