使用 PlayFramework Search / Hibernate Search 进行复杂的全文搜索

发布于 2024-11-04 06:40:11 字数 276 浏览 9 评论 0原文

假设只有两种类型的模型对象。

标签 文章

文章可以具有可变数量的标签,以及包含文章正文的大文本字段。

如何对与我定义的一组标签匹配的文章执行高效的全文搜索?例如,在 100 万篇文章中,有效查询(支持计数和分页)1) 匹配 body:business* 和 2) 标记为“美国”、“经济”且未标记为的文章的最佳方式是什么“亚洲”?

我能够有效地分别执行 1)(使用 HQL 或普通旧 SQL)和 2)(使用 lucene 查询),但不能同时执行这两个操作。有人有一些想法吗?

Suppose there are only two type of model objects.

Tag
Article

Article can have a variable number of tags, as well as a large text field containing the body of the article.

How do I perform an efficient full text search for articles matching a set of tags that I define? For example, out of 1 million articles, what's the best way to efficiently query (with count and pagination support) for articles that 1) match body:business* and 2) are tag with "America", "Economy" and NOT tagged with "Asia"?

I am able to efficiently do 1) (using HQL or plain old SQL) and 2) (Using lucene query) separately, but not both of them together. Anybody got some ideas?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

娇妻 2024-11-11 06:40:11

您是否看过 Elastic Search 模块?这是一个非常强大的模块,模块所有者做了很多工作来记录他的工作。

Have you looked at the Elastic Search module? It is a very powerful module, and the module owner has done a lot of work documenting his work.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文