i need to move from a mysql db to elasticsearch.
I have the follow situation:
We have these tables: companies, categories and listings.
Companies includes datas from the company like name, address etc.
Subcategories includes a name like "Festmacher","Zollagenturen".
Listings includes the mapping from companies to subcategories like "Company"=>1 and "Subcategory"=>8 and so on. This table ist very big because every relation from a company to a subcategory was saved here.
Ok, now i need to structure this to es. In the endresult i need the following options.
I have to search for subcategories with the result of how many times the founded subcategories are listed in listings. Like "Festmacher => 60" or "Zollagenturen => 101".
The next thing is a overview of all comapnies for a subcategory id. I have a get param like ?scat=1. Now i need all companies listet for this subcategogry.
How can i make this the best way with es? How was a good way to index the datas with an eye of performance?