1

I have to use elastic search in my project for searching. And I'm new player on that field. I have spend some time on it and I come to know that how it stores data and it's working etc. But I have some questions regarding Elasticsearch with MySql. Like,

  • How to index relational tables (Normalised Tables of MySql) into Elasticsearch? I think I have two options. i.e, (i) index MySql tables as it is in Elasticsearch and use two search queries for searching data from both tables (say, users and contacts) while searching. (ii) Get all the parent and child records from MySql tables and create nested JSON and index it in Elasticsearch. But I don't think that this is right way.
  • How to update document in Elasticsearch as MySql record changes?
  • How to convert JOIN query of MySql into search quesry of Elasticsearch? or I must have to make two separate search call for each table.

So there is lots of confusion in mind when topic comes with MySql. I have already searched on Internet. But I have found blogs related to only basics, not with MySql. If any one can explain this nicely, it will be appreciated.

Akshay Vaghasiya
  • 1,597
  • 9
  • 36
  • 60
  • These answers might help: http://stackoverflow.com/questions/34477816/how-to-use-elasticsearch-to-get-join-functionality-as-in-sql/34477920#34477920 + http://stackoverflow.com/questions/34477095/elasticsearch-replication-of-other-system-data/34477639#34477639 + http://stackoverflow.com/questions/36915428/how-to-setup-elasticsearch-index-structure-with-multiple-entity-bindings/36982705#36982705 – Val Dec 13 '16 at 12:22
  • @Val. Thanks, as it really helped me to understand what I can do to achieve my requirements. But can you help me little bit more on [this](https://github.com/elastic/elasticsearch-php/issues/212#issuecomment-266722804) ? – Akshay Vaghasiya Dec 14 '16 at 04:37
  • You can achieve that (i.e. denormalize users/projects) with the solutions shown in the first and third links I posted above – Val Dec 14 '16 at 04:39
  • @Val. Thanks to look at there.. I will try as you have suggested and will reply here. So other users may get help from here too. – Akshay Vaghasiya Dec 14 '16 at 05:45

0 Answers0