开发者

Twin Lucene index directories after Nhibernate.Search upgrade

i've been busy upgrading our n* stack to a more recent version. We'd been using FluentNhibernate for configuration and Nhibernate.search coupled with Lucene.Net for full-text search. Everything worked fine until i changed the various versions of the libraries to the following:

  • FluentNHibernate.dll: 1.0.0.593
  • NHibernate.dll: 2.1.0.4000
  • NHibernate.Search.dll: 2.0.0.1001
  • Lucene.Net.dll: 2.3.1.3

The stack has been wo开发者_运维技巧rking as previously, but i noticed something strange; whereas before the Lucene index directory would contain one subdirectory for each indexed class, it's now using two subdirectories, suffixed by a integer.

We went from

LuceneDirectory
.Class1
.Class2

to

LuceneDirectory
.Class1.0
.Class1.1
.Class2.0
.Class2.1

I poked a bit around the configuration building of FluentNhibernate and found out that for each mapping, i have two imports created, one with the fullname of the class mapped, one without (if i map the "User" class, i'll have one mapping, and two imports "POCOAssembly.User", and "User"). The directories are created at the Initialize call of the FullTextIndexEventListener.

Has anyone stumbled upon the same problem? i read through the nhibernate.search release notes, but didn't find any info regarding a change in mappings; is there something i'm missing? Has there been a breaking change in the libraries?


Edit:

I realized it may be important to point out that my mapped classes and my mappings derive from a common base object used for auditing purposes (creation date/update time).


I found out that the problem has been reported in the NHibernate JIRA: https://nhibernate.jira.com/browse/NHSR-22

What happened is that i set two default properties in the NHibernate configuration; "hibernate.search.default.directory_provider" and "hibernate.search.default.indexBase" These default configurations are considered as two shards, since the code hasn't been tested for the moment.

A workaround is to remove the "hibernate.search.default.directory_provider" entry as it defaults to the correct one.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜