从 MySQL CLOB 或 VARCHAR 列实现关键字搜索的最佳方法
我必须在 MySQL/JPA 项目中从 CLOB 列实现关键字搜索。
我知道我可以使用 JPA 查询,例如 SELECT some FROM Something WHERE...
,但是还有其他“企业”方式可以执行此操作吗?
(我问这个问题时要牢记 Hibernate 搜索,但 JPA 中似乎没有 Hibernate 搜索的等效项)
I have to implement a keyword search from a CLOB column in my MySQL / JPA project.
I know that I can use a JPA query something like SELECT something FROM something WHERE...
, but are there any other 'Enterprise' way of doing this?
(I am asking this question keeping Hibernate search in mind, but there seems to be no equivalent for Hibernate search in JPA)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
“企业”方式是什么意思? Hibernate 非常有进取心,因为大多数财富 500 强公司实际上都以一种或另一种方式使用它。尽管最新的 Hibernate Search 版本仍处于测试阶段,但这可能不是大多数企业所接受的。但是您可能可以使用一个稳定的版本。
您仍然可以使用 Apache Lucene 来索引 CLOB 并在索引中搜索数据库的。这基本上就是 Hibernate Search 在幕后所做的事情。这就是许多公司使用的方法。
更新:我从未将 Hibernate Search 作为单独的产品使用,以及他们在 他们的文档是 Hibernate Core 是一个要求。但您仍然可以尝试普通 Lucene。
What do you mean under "enterprise"-way? Hibernate is pretty enterprisish as most of Fortune-500 companies actually use that in one or another way. Though latest Hibernate Search version is still in beta, that's probably not what most of the enterprises will accept. But there is a stable release you can probably use.
And you can still use Apache Lucene to index your CLOBs and search in the index instead of DB. That's what basically Hibernate Search is also doing under the hood. And that's the aproach used by many companies.
UPDATE: I never used Hibernate Search as a separate product and what they say in their documentation is that Hibernate Core is a requirement. But you can still try plain Lucene instead.