Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

298
Vistas
Sync data from two mysql tables with single Elasticsearch Index using Logstash

I have two mysql tables that I want to save into a single Elastic index.

Table 1: Product has id, name ... etc.

Table 2: ProductWarehouse has productId, warehouseId, qtyAvailable ... etc

Product one-to-many ProductWarehouse

My question is, how can I save ProductWarehouse records for each product as an array?

If ProductWarehouse was modified, how to reflect that on the Elastic index?

What is the best practice?

the Product index in Elastic should look like:

{
 "id",
 "name": ...,
 "warehouses": [
   {"warehouseId": 1, "qtyAvailable": 3},
   {"warehouseId": 10, "qtyAvailable": 30}
 ]
}
over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

My suggestion is to create a MySQL view of the structure you need: Product joins with ProductWarehouse. This view just to use in Sync and then make the Sync from this view to ElasticSearch using Logstash.

Then you can use the ElasticSearsh Index as this structure:

{
 "id",
 "name": ...,
 "warehouses": 1
}
{
 "id",
 "name": ...,
 "warehouses": 3
}
over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda