休眠搜索vs弹簧数据solr,弹簧数据弹性搜索 [英] Hibernate Search vs spring-data-solr , spring-data-elasticsearch

本文介绍了休眠搜索vs弹簧数据solr,弹簧数据弹性搜索的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Spring Boot,Spring Data JPA(休眠)Web应用程序,想引入文本搜索功能.

I have a spring boot, Spring Data JPA (hibernate) web application and want to introduce text search feature.

我了解以下内容

  • 休眠搜索或spring-data- *都可以集成到我的应用程序中

  • Both hibernate search or spring-data-* can be integrated into my app

休眠搜索可以与嵌入式Lucene或外部Elastic一起使用 搜索.

Hibernate search can work with embedded Lucene or external elastic search.

外部弹性搜索/Solr有其自身的优势,但我可以接受

External elastic search/ solr has its own benefits, but I am ok with

也开始嵌入.

我的问题

  • 哪个库更易于开发和维护.
  • 我看到solr vs elasticsearch有很多利弊,但需要利弊 Hibernate搜索与spring-data-*
  • 的缺点
  • 我找到了一个在现有系统中引入Hibernate Search的示例 应用.但是在spring-data- 上没有任何内容,如何重新索引或触发 在spring-data-
  • 中对现有数据库数据建立索引
  • Which library is better for easy development and maintenance.
  • I see many pros and cons of solr vs elasticsearch but need Pros and Cons of Hibernate search vs spring-data-*
  • I found an example on introducing Hibernate Search in an existing application. but nothing on spring-data-, how to reindex or trigger indexing of existing database data in spring-data-

推荐答案

自从我是Hibernate开发人员以来,我显然有偏见,但我至少可以提供一些专注于Hibernate Search的元素.至于哪个更好",则由您来判断.

I'm obviously biased since I am a Hibernate developer, but I can at least provide some elements focused on Hibernate Search. As to which is "better", that's for you to judge.

主要区别在于Hibernate Search在JPA和您选择的索引(Lucene或Elasticsearch)之间提供了集成:

The main difference is that Hibernate Search provides integration between JPA and your index of choice (Lucene or Elasticsearch):

  • Hibernate Search将根据您的JPA实体的更改(在您提交事务后)自动在全文索引中添加/更新/删除文档.
  • Hibernate Search将允许您构建全文查询(全文世界),并将结果作为托管实体(JPA世界)进行检索.

据我了解,Spring-Data-Elasticsearch专注于访问Elasticsearch,并且没有任何JPA集成.也就是说,您可以使用Spring-Data-JPA,也可以使用Spring-Data-Elasticsearch,但是它们不会相互通信.您将拥有两个单独的模型,分别对它们进行更新和查询.

As far as I understand, Spring-Data-Elasticsearch is focused on accessing Elasticsearch and has no JPA integration whatsoever. That is to say, you can use Spring-Data-JPA, and you can use Spring-Data-Elasticsearch, but they won't communicate with each other. You will have two separate models, which you will update and query separately.

其他一些元素:

  • 如果不需要分布式索引,则Hibernate Search可以在嵌入式Lucene模式下运行,而无需所有Elasticsearch堆栈.它将可能更轻巧.
  • 由于抽象层,在自定义Elasticsearch映射或使用高级Elasticsearch功能时,
  • Hibernate Search当前当前不是很灵活.不过,这种情况将来会改变(休眠搜索6 ) .
  • Spring-Data-HibernateSearch模块正在开发中,可以从两全其美中受益.它尚未发布,并且尚未得到充分记录,不过: https ://github.com/snowdrop/spring-boot-hibernate-search-booster
  • If you don't need a distributed index, Hibernate Search can run in embedded Lucene mode, without all the Elasticsearch stack. It will probably be more lightweight.
  • Hibernate Search is currently not very flexible when it comes to customizing your Elasticsearch mapping or using advanced Elasticsearch features, because of the abstraction layer. That will change in the future, though (Hibernate Search 6).
  • A Spring-Data-HibernateSearch module is in the works, allowing to benefit from the best of both worlds. It hasn't been released yet and is not really well documented yet, though: https://github.com/snowdrop/spring-boot-hibernate-search-booster

这篇关于休眠搜索vs弹簧数据solr,弹簧数据弹性搜索的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆