序言

While writing this book, my objective was to provide you the information I needed when I started using Elasticsearch: what its main features are and how they work under the hood. To give you a better overview of this objective, let me tell you a more detailed story of how this book came to life.

当我写这本书时,我的目标是给你提供我学习使用Elasticsearch时所需的信息:它的主要特点和背后是如何工作的。为了使你更好了解这个目标,让我来告诉你更多这么书面世的详细故事。

I first met Elasticsearch in 2011 while working on a project for centralizing logs. My colleague Mihai Sandu showed me Graylog, which used Elasticsearch for log search, and setting everything up was extremely easy. Two servers could handle all our logging needs at the time, but we expected the data volume to grow hundreds of times in about one year. And it did. On top of that, we had more and more complex analysis requirements, so we quickly found out that tuning and scaling the setup required a deep understanding of Elasticsearch and its features.

我最初跟 Elasticsearch 打交道是 2011年,那时我在做一个集中日志的项目。我的同事 Mihai Sandu 跟我说 Graylog,Graylog 用 Elasticsearch 来搜索日志且非常容易设置。在那时,两台服务器就能处理我们所有的日志了,但是我们预计数据容量一年内会增长一百倍。事实的确如此。到了最后,我们有越来越多复杂分析的需求,所以我们很快就发现调整和扩展设定需要对Elasticsearch和它的特性有很深的了解。

There was no book to teach us that, so we had to learn the hard way: lots of experiments, lots of questions and answers to the mailing list. The upside was that I got to know a lot of nice people that posted there regularly. This is how I came to work at Sematext, where I could concentrate on Elasticsearch full-time, and this is why Manning asked me if I would be interested in writing about Elasticsearch,

没有书教我们,所以我们经历了很多艰难,在邮件列表中有很多实验很多问题和答案。好处是,我认识很多经常在那里的好人。这是我到 Sematext 工作的原因,在这里我能投入所有时间在 Elasticsearch 上,这也是 Manning 问我有没有兴趣写一本 Elasticsearch 的书的原因。

Of course I was. They warned me it was hard work, but told me that Lee Hinman was also interested, so we joined forces. With two authors, we thought it was going to be easy, especially as Lee and I really clicked and provided useful feedback to one another. Little did we know that it’s much easier to present features in the early chapters than to combine those features into best practices for various use cases in later chapters. Then, with feedback from our reviewers, we found that it’s even more work to fit everything together, so our pace became slower and slower. That’s when Roy Russo joined us and helped with that final push.

当然,他们告诫我这很艰难,还告诉我 Lee Hinman 对这个也有兴趣,所以我们就联手了。我们想那会很简单了,特别是 Lee 和我合作得很好,我们相互提供反馈。我们知道,前面的章节中的特性会比较简单,后面章节的用例以最佳实践方式组合使用前面章节的特性。从 reviewers 的反馈中,我们发现让所有东西集成在一起工作还需要更多的工作,我们的节奏变得越来越慢了。这也是 Roy Russo 参与进来帮助我们 final push 的原因。

After two and a half years of early mornings, late nights, and weekends, I can finally say we’re done. It was a tough experience, but a rich one as well. I would surely have loved to have this book in my hands four years ago, and I hope you’ll enjoy it, too.

在经历了两年半的早上夜晚和周末后,我终于可以说,我们完成了。那是一个很艰难的过程,但很丰富。如果四年前我拥有这本书的话我会爱上它了,我希望你也喜欢。

RADU GHEORGHE