Lucene JDBC目录 [英] Lucene JDBC Directory

查看:47
本文介绍了Lucene JDBC目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Lucene 3.5.0在我的网站上进行一些基本的搜索.我想将索引存储在Mysql数据库的JDBC目录中.我打算使用Compass Project来执行此操作,但是在进行了一些进一步的研究之后,并且实际上在尝试代码之后,我发现Compass是一个无效的项目,并且不再与当前版本的Lucene兼容.

I am using Lucene 3.5.0 to do some basic search stuff on my website. I want to store the index in a JDBC Directory in my Mysql Database. I was going to use the Compass Project to do this, but with some more research and actually trying the code I have found that Compass is a dead project and it no longer is compatible with the current version of Lucene.

是否还有另一个选项可以将索引存储在JDBC目录中?Lucene不提供这种本地语言的原因吗?出于某种原因,将硬盘存储在硬盘上是更好的选择吗?

Is there another option to store my index in a JDBC Directory? Is there a reason Lucene does not offer this native? Is storing on the HDD a better option for some reason?

推荐答案

来自常见问题解答:

Lucene不立即支持该功能,但是一些人已经实现了 JdbcDirectory的.到目前为止,我们已经看到的报告表明,使用此类实现的性能虽然不佳,但却是可行的.

Lucene does not support that functionality out of the box, but several people have implemented JdbcDirectory's. The reports we have seen so far indicate that performance with such implementations is not great, but it is doable.

另一种方法是将索引作为BLOB存储在数据库中,如果您有多个运行应用程序的节点,这可能会很有用.如果将时间戳记添加到BLOB,则每个节点都可以检查索引是否已更新,然后从数据库中重新创建索引文件.

Another approach would be to store the index in the database as a BLOB, this could be useful if you have multiple nodes running your application. If you add a timestamp to the BLOB each node could check whether the index has been updated and recreate the index file from the DB.

这篇关于Lucene JDBC目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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