I want to learn the source code of ElasticSearch and then contribute to it.
Do you know any book that focuses on ElasticSearch internals and describes its source code ?
I highly doubt that there is such a book. Even if there were it would rapidly go out of date; the Elasticsearch codebase is a very fast moving target. The differences between even the master branch today and the latest stable (2.2) and the latest development branch of the current stable release (2.x) are substantial. To know the code you have to be in the code.