NHibernate。使用Lucene.NET搜索而不使用DB?

时间:2021-03-21 03:04:44

Could I use NHibernate.Search only with lucene’s index without database? Because I would like to store all data only in my lucene’s index, but I really like features in NHibernate.Search.

我可以使用NHibernate.Search仅使用lucene的索引而不使用数据库吗?因为我想将所有数据存储在我的lucene索引中,但我真的很喜欢NHibernate.Search中的功能。

1 个解决方案

#1


Not really, as they are tightly coupled. The point of the NHSearch/Lucene.NET/NHibernate integration is that you can do a full text search, but the results returned are domain entities, i.e. from the database.

不是真的,因为它们是紧密耦合的。 NHSearch / Lucene.NET / NHibernate集成的重点是您可以进行全文搜索,但返回的结果是域实体,即来自数据库。

So, without storing them in the database, there would be no way for NHSearch to inflate the domain objects it finds in the Lucence index.

因此,如果不将它们存储在数据库中,NHSearch就无法对它在Lucence索引中找到的域对象进行充气。

One other approach would be to look at one of the document databases such as Raven.

另一种方法是查看其中一个文档数据库,如Raven。

#1


Not really, as they are tightly coupled. The point of the NHSearch/Lucene.NET/NHibernate integration is that you can do a full text search, but the results returned are domain entities, i.e. from the database.

不是真的,因为它们是紧密耦合的。 NHSearch / Lucene.NET / NHibernate集成的重点是您可以进行全文搜索,但返回的结果是域实体,即来自数据库。

So, without storing them in the database, there would be no way for NHSearch to inflate the domain objects it finds in the Lucence index.

因此,如果不将它们存储在数据库中,NHSearch就无法对它在Lucence索引中找到的域对象进行充气。

One other approach would be to look at one of the document databases such as Raven.

另一种方法是查看其中一个文档数据库,如Raven。