问题描述
在一些博客和lucene网站上,我知道lucene使用倒排索引中的数据结构跳过列表".但是我对此有些疑惑.
In some blogs and lucene website,I know lucene use data structure "skip list" in inverted index. But I have some puzzle about it.
如果我错了,请纠正我.
Please correct me if I am wrong.
推荐答案
Lucene使用几种不同的方式使用内存,即使在创建IndexReader进行搜索和进行诸如排序(字段缓存)之类的操作时,索引仍保留在磁盘上):
Lucene uses memory in a couple different ways, even though the index is persisted on a disk when the IndexReader is created for searching and for operations like sorting (field cache):
http://blog.mikemccandless.com/2010/07/lucenes-ram-usage-for-searching.html
基本上,这些二进制文件被复制到RAM中,以加快扫描速度并减少I/O.您会在上面的链接中得到一个提示,即如何使用某些参数进行搜索可以迫使Lucene跳过搜索中的术语",从而可以在其中使用该数据结构.
Basically those binary files get copied into RAM for much faster scanning and reducing I/O. You get a hint in the above link how searching with some parameters can force Lucene to "skip terms in searching" Hence, where that data structure can be used.
Lucene是开源的,因此您可以亲自查看Java或Lucene.NET中用于C#实现的代码.
Lucene is open source, so you can see the code for yourself what is being used in Java or Lucene.NET for the C# implementation.
这篇关于lucene如何在倒排索引中使用跳过列表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!