在Lucene中进行更快的搜索-有没有办法将整个索引保留在RAM中? [英] Faster search in Lucene - Is there a way to keep the whole index in RAM?

查看:85
本文介绍了在Lucene中进行更快的搜索-有没有办法将整个索引保留在RAM中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有一种方法可以将索引保留在RAM中而不是将其保留在硬盘上?

Is there a way of keeping the index in RAM instead of keeping it on the hard disk?

我们想使搜索更快.

推荐答案

是否可以将索引保留在RAM中而不是将其保留在硬盘上?

Is there a way of keeping the index in RAM instead of keeping it on the hard disk?

使用 RAMDirectory

Using the RAMDirectory class

SampleUsage 此处

SampleUsage here

也来自Lucene常见问题解答

Also from the Lucene FAQs

ImproveSearchingSpeed

ImproveSearchingSpeed

通常,为了获得更快的索引性能,最好按RAM使用量而不是文档计数进行刷新,并尽可能使用较大的RAM缓冲区.

也请检查以下问题:

Also check this question:

RE:RamDirectory ,正如API所述,RamDirectory是驻留内存的目录实现.,它仅将那些索引保留在由目录

RE: RamDirectory, As the API says RamDirectory is A memory-resident Directory implementation., it keeps only those index in RAM as specified by directory RAMDirecory

RE:缓存据我所知,Lucene通过过滤器缓存搜索结果,请查找@

RE:Caching In my knowledge, Lucene caches search results by means of filters pls look @ CachingWrapperFilter and QueryWrapperFilter

这篇关于在Lucene中进行更快的搜索-有没有办法将整个索引保留在RAM中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆