Lucene的几个问题
我一直在使用 Zend,需要搜索。 Zend 文档不是很好,所以我有几个问题很容易回答,但不是很明显。我正在使用 Lucene 搜索 SQL 数据库
如何将项目的索引与该项目的文本相关联。因此,如果他们搜索并找到该项目,我如何返回其索引?据我所知,您只能返回搜索的文本。
当我向包含所有数据的文档添加一个项目,但该文档已创建时,它只是一个 open('document'), $doc = new Doc(), $doc->addDocument( ), 犯罪()?
据我了解,每次向数据库添加内容时都会更新 Lucene 文档。在优化时,我是否应该在每次添加内容时重新优化?这样效率低吗?我应该每周执行一次吗?
很抱歉问一些看似显而易见的问题,并提前感谢您的帮助。
I've been using Zend and need a search. The Zend docs aren't great so I had a couple questions that are easy to answer but not directly obvious. I'm using Lucene to search an SQL database
How do I associate the index of my item with the text of that item. So if they search and find the item, how do I get its index returned? As far as I can tell you can only return the text of the search.
When I add an item to the document that holds all the data, but the document is created already, is it simply a open('document'), $doc = new Doc(), $doc->addDocument(), commit()?
I understand that I update the Lucene document every time that I add something to the database. In optimizing, should I reoptimize every time that I add something? Is that inefficient? Should I do it once a week?
Sorry to ask what seems like obvious questions, and thanks for your help in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我希望这是有道理的。如果没有,请在评论中提问。
I hope this make sense. If it does not, please ask in the comments.
第 3 点)在 Lucene 2.9 中作为 NRT(NearRealtimeSearch)解决,通过 SegmentReader + 内部 RamDirectory 使用
检查 OtisGospodnetic wiki 条目
point 3) is addressed in Lucene 2.9 as NRT(NearRealtimeSearch) implemented by means of SegmentReader + internal RamDirectory usage
check OtisGospodnetic wiki entry