Support concat for children node fields
It would be really nice if concat transform could support the ability to concat child columns in parent e.g.
{
"database": "postgres",
"index": "products",
"nodes": {
"table": "products",
"children": [
{
"table": "vendors",
"label": "vendor",
"columns": [
"name"
],
"relationship": {
"variant": "object",
"type": "one_to_one"
}
},
{
"table": "line_items",
"label": "items",
"columns": [
"description"
],
"relationship": {
"variant": "object",
"type": "one_to_many",
"foreign_key": {
"child": [
"product_id"
],
"parent": [
"id"
]
}
}
}
],
"columns": [
"number",
"purchase_order",
"sku",
"quantity",
"stock_date",
"amount"
],
"transform": {
"concat": {
"columns": [
"number",
"purchase_order",
"billing_address",
"email_addresses",
"estimate_date",
"amount",
"items.description", <------ support this
"vendor.name" <------ support this
],
"destination": "global_search_field",
"delimiter": " "
}
}
}
}
support concating items.description and vendor.name in the given sample
I get what you mean. That could get complicated in generalised cases though. e.g if the parent had multiple children then you need to specify in index to concat.
I'm not sure if I understand the question.
@toluaina It would be very interesting in cases of having a one_by_one relationship type to avoid and filter situations with multiple results. Is this issue still open, or is this other implementation for pgsync in some version snapshot? Is there a repository of plugins where I can find something similar? Thank you very much.
Hi, I wanna ask a similar question why I really need concat for children node fields for translations. I have a table postgres movie which contains :
- id : bigint
- original_title : text
And athis table has a one-to-many relation with movie_translation :
- movieId : bigint
- title : text
- overview : text
- poster_path : url
So I wanna be able to search between title for the corresponding user language and with original_title. Elasticsearch recommend to use one field per language like this title_en, title_fr, overview_en, etc...
I need to have this Elasticsearch result :
- id : bigint
- original_title : text
- title_en : text
- title_fr : text
- overview_en : text
- overview_fr : text
- poster_path_en : url
- poster_path_fr : url
-- and for each language available in movie_translation
How can we achieve this with pgsync ? Thx for ur help ! 😁