Sign inSign up

hqiasjehrlb/postgres-zombodb

By hqiasjehrlb

•Updated over 2 years ago

A docker image which integrate ZomboDB extension with Postgres.

Image
Databases & storage
0

1.5K

hqiasjehrlb/postgres-zombodb repository overview

⁠postgres-zombodb

This repo build a docker image which integrate ZomboDB extension with Postgres.

My github repository⁠.

⁠Docker image usage

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

⁠Usage

ZomboDB⁠.

  • 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';
    

Tag summary

Content type

Image

Digest

sha256:d15c232b3…

Size

1.5 GB

Last updated

over 2 years ago

docker pull hqiasjehrlb/postgres-zombodb