I've used elasticsearch before on a small project. The project basically cataloged threads from a forum and presented them in a listview. I enabled search by connecting Elasticsearch through my MongoDB server via a Go daemon (Monstache). It worked but it felt fairly unintuitive and I couldn't help but think I was doing this the wrong way. Now I'm working on a new project and I actually use a SQL database instead to keep data, so I don't think the same trick can work again. So I have this question: what is the right way to setup Elasticsearch on a service? In other words, how should I connect Elasticsearch to my data? Should I simply dump the existing data in my SQL tables as documents into Elasticsearch? Should I only dump select information from each record (e.g. the necessary metadata) and store that in Elasticsearch? What happens when a new record is made? Do I index it immediately into Elasticsearch or do I collect a few new records and then batch insert it into Elasticsearch?
This is kind of a broad question, I understand. I just want to know what the normal way about it is. How does ELK typically fit into an existing application? I welcome guides, documentation, and best practice advice.