Understand Lucene to Understand ElasticSearch

栏目: IT技术 · 发布时间: 5年前

内容简介:The purpose of this article is to promote a better understanding of how things work within ElasticSearch. If you are reading this article, you probably already know how ElasticSearch works, if that is not true, you can learn a little more by reading the fo

The purpose of this article is to promote a better understanding of how things work within ElasticSearch. If you are reading this article, you probably already know how ElasticSearch works, if that is not true, you can learn a little more by reading the following article:

Lucene.

Lucene is the base of ElasticSearch, but you don’t interract directly with him, as you drive your car, but you don’t ask direct to your engine to start. But what if your car break, don’t you think is a good idea to know how your engine works?

Lucene Indexing

You have a big a mount of files, and you need to find a specificy file, wich contais a certain word, how to be quickly to do this? how to be scalable? Here’s where indexing comes in: to search large amounts of text quickly, you must first index that text and convert it into a format that will let you search it rapidly. This conversion process is called indexing, and its output is called an index.

Lucene Index.

The index is composed of one or more segments, and each segment is composed of several indexes, confusing, right? When it is created, it is separated into smaller segments, or you can see it as sub-indices, where each index is not completely independent.

Understand Lucene to Understand ElasticSearch

Lucene Segments.

Segments are immutable .Each segment contains one or more Lucene Documents

At some point, on your journey through ES, you have been in the situation of having to delete a document. And apparently that was no problem, but what is going on behind the scenes?

When you delete a document, it is only “marked” as deleted and a new version of the document is added to the segment. Its real execution is only carried out from time to time when a “joining” of larger segments occurs.

In the meantime, documents continue to take up disk space.

Lucene Merge.

Over time the index will accumulate many segments. Periodically, segments are merged into a single new segment and removing the old segments.

But wait, whats it the benefits Merge my segments?

Basically, because two important things, discard old documents and as result reduce our index space on disk, and the second one is the old segments are remove, and a new bigger segment are create, incresing your search speed.

Conclusion

Understand Lunce is essential to understand Elasticsearch, of course are difference beetwen them, but the concept and how things works, is the same. This kind of concepts is hard to find in ElasticSearch documents, because they abstract all this job for you. I hope i can explain some things about the core of Lucene, to show how ElasticSearch trully works.

References and Inspirations:

https://www.manning.com/books/lucene-in-action-second-edition


以上所述就是小编给大家介绍的《Understand Lucene to Understand ElasticSearch》,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对 码农网 的支持!

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

组合数学

组合数学

(美)Richard A. Brualdi / 冯速 等 / 机械工业出版社 / 2012-5 / 69.00元

本书是系统阐述组合数学基础、理论、方法和实例的优秀教材,出版三十多年来多次改版,被MIT、哥伦比亚大学、UIUC、威斯康星大学等众多国外高校采用,对国内外组合数学教学产生了较大影响,也是相关学科的主要参考文献之一。 本书侧重于组合数学的概念和思想,包括鸽巢原理、计数技术、排列与组合、P條ya计数法、二项式系数、容斥原理、生成函数和递推关系以及组合结构(匹配、试验设计、图)等,深入浅出地表达了......一起来看看 《组合数学》 这本书的介绍吧!

CSS 压缩/解压工具
CSS 压缩/解压工具

在线压缩/解压 CSS 代码

HTML 编码/解码
HTML 编码/解码

HTML 编码/解码

HEX CMYK 转换工具
HEX CMYK 转换工具

HEX CMYK 互转工具