Integrating Node.js, Mongoose and Elastic Search
I tried to integrate Elastic Search into my app which is based on a node.js and MongoDB infrastructure.
I use Mongoose as a framework to manage my models with MongoDb.
As a framework to work with Elastic Search I chose Mongoosastic, which provides a plugin for working with Elastic Search "out-of-the-box" if you use Mongoose.
Or at least that's what I thought. Apparently, my application wasn't so simple to integrate....
What I was looking for
What I needed is a way to search based on both a parent document and a child document.
For example, let's assume that we have a collection of users, and each user has an array of comments.
I wanted to be able to search according to the name of the user, and the content of the comments.
Setting a custom analyzer
To be continued....











