发布于 2017-02-23 10:18:13 | 142 次阅读 | 评论: 0 | 来源: 网友投递
Hibernate Search 全文检索工具
Hibernate Search是在apache Lucene的基础上建立的主要用于Hibernate的持久化模型的全文检索工具。像Lucene这样的检索引擎能够给我们的项目在进行检索的时候带来 非常高的效率,但是它们在基本对象的检索时会有一些问题,比如不能实现检索内容跟实体的转换,Hibernate Search正是在这样的情况下发展起来的,基于对象的检索引擎,能够很方便的将检索出来的内容转换为具体的实体对象。此外Hibernate Search能够根据需要进行同步或异步的索引更新。
Hibernate Search 5.7.0 Final 发布了,
更新内容:
一般改进
HSEARCH-2574: when it makes sense, you can now repeat Hibernate Search annotations on a single attribute/method. For example, if you want to add two index fields on the same title
attribute, you can write:
@Field(analyzer = @Analyzer(definition = "myAnalyzer") @Field(name = "title_sort", analyzer = @Analyzer(definition = "myAnalyzerForSort") private String title;
Thus you don’t have to use the composite annotations (@Fields
) anymore. But of course, those are still available.
HSEARCH-2588: some methods in the Sort DSL allowed to specify the sort field type explicitly, which was useful when sorting on fields added through custom field bridges. We improved support for MetadataProvidingFieldBridge
, so that you now only need to implement this interface on your custom field bridges, and won’t need anything special when using the sort DSL anymore. As a result, the byField(String, SortField.Type)
and andByField(String, SortField.Type)
methods in the sort DSL have been deprecated.
HSEARCH-2587: an NPE could occur when using the Sort DSL to sort on embedded (@IndexedEmbedded
) fields; this is now fixed.
HSEARCH-2576: unnecessary memory allocations within queries have been removed, resulting in better query throughput.
And several improvements for other solutions integrating Hibernate Search, like HSEARCH-2597, HSEARCH-2561, HSEARCH-2418 or HSEARCH-2585.
Elasticsearch-specific 改进
HSEARCH-2453: Elasticsearch authentication is now fully implemented: there are dedicated username
and password
properties so that you don’t need to embed the credentials in the URL anymore.
HSEARCH-2593: when using automatic node discovery on Elasticsearch, a scheme (HTTP or HTTPS) cannot be detected automatically for newly discovered nodes; by default it is HTTP. You can now customize this to use HTTPS instead: just add hibernate.search.default.elasticsearch.discovery.default_scheme https
to your configuration.
HSEARCH-2590: queries using pagination could allocate too much memory in certain circumstances; this is now fixed.
更多请查看完整发行日志