NHibernate Search 是否会意识到底层数据的变化?
我在网上看到过一些说法,大意是 NHibernate(或 Hibernate)搜索“负责数据库/索引同步”。
当我读到这些陈述时,我不禁想知道是否有一个隐含的“...只要您使用 [N]Hibernate 进行任何和所有数据访问。”
我正在使用 NHibernate 作为针对完全由不同应用程序拥有的数据库的只读数据访问层 - 因此我的应用程序将永远直接了解外部写入。
Hibernate/NHibernate Search 实际上是否会执行任何操作来监视原始数据的更改,例如设置查询通知和/或在整个或部分索引上使用生存时间或“过期”?
或者,随着越来越多的行被外部应用程序更改,Lucene 索引是否会随着时间的推移而逐渐变得陈旧?
如果这个工具不执行这种同步,那么除了手动重新索引(这将非常难以正确计时)之外,我还能做些什么吗保持 Lucene 索引与数据库同步,或者我最好只使用 SQL Server 中的全文功能,就像我到目前为止一直在做的那样?
I've seen several statements online to the effect that NHibernate (or Hibernate) Search "takes care of the database/index synchronization".
When I read these statements, I cannot help but wonder if there is an implied "...as long as you use [N]Hibernate for any and all data access."
I am using NHibernate as a read-only data access layer against a database that is owned entirely by a different application - so my application will never be directly aware of external writes.
Does Hibernate/NHibernate Search actually do anything to monitor changes to the raw data, as in setting up a query notification and/or employing a time-to-live or "expiration" on whole or partial indexes?
Or is the Lucene index just going to get progressively staler over time as more and more rows are changed by external applications?
If this tool doesn't do that kind of synchronization, then aside from manual reindexing (which would be very difficult to time properly), is there anything else I can do to keep the Lucene index in sync with the database, or am I better off just using the Fulltext capabilities in SQL Server, as I have been doing up until this point?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我想我已经能够从 Hibernate 搜索文档:
如果您必须创建一个初始索引,那么如果在应用程序外部进行任何更改,您也必须更新该索引,这是理所当然的。
显然,HS/NHS 并不是像 SQL Server FTS、Oracle Text 等那样的即发即忘解决方案,除非几乎所有数据写入都是通过会话完成的。
I think I've been able to infer the answer from the Hibernate Search Documentation:
If you have to create an initial index then it stands to reason that you'll also have to update that index if any changes are made outside the application.
Evidently, HS/NHS is not a fire-and-forget solution like SQL Server FTS, Oracle Text, etc., unless pretty much all data writes are done through the session.