使用 PlayFramework Search / Hibernate Search 进行复杂的全文搜索
假设只有两种类型的模型对象。
标签 文章
文章可以具有可变数量的标签,以及包含文章正文的大文本字段。
如何对与我定义的一组标签匹配的文章执行高效的全文搜索?例如,在 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您是否看过 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.