toluaina / pgsync

Postgres to Elasticsearch/OpenSearch sync
https://pgsync.com
MIT License
1.1k stars 172 forks source link

[Question]: Extract all fields from Postgres JSONB column to ES document root #451

Closed 4d11 closed 9 months ago

4d11 commented 1 year ago

PGSync version: Version: 2.5.0

Postgres version: 15

Elasticsearch version: 7.8.0

Redis version: 7.0.4

Python version: 3.9.13

Problem Description: I have a JSONB column with dynamic fields eg

{
    "KEY_12": "value",
    "KEY_33": {"x": "y"},
    ...
}

I would like to extract all fields in this column and add them to the root of the ES document. Is this possible currently?

Error Message (if any):

vivekburman commented 1 year ago

You can do it in transform phase. See here [https://pgsync.com/tutorial/plugins/]