【问题标题】:How to boost integer terms within Elasticsearch query如何在 Elasticsearch 查询中提升整数项
【发布时间】:2013-10-17 03:00:02
【问题描述】:

我正在尝试为我的数据查找一个查询,以提升所有包含的数字项。

例如:

A query on a field "description" contains these terms: 
"PatientA Disease II 12 A 7 Cell 348 go"

我正在尝试从 Elasticsearch 中获取其“描述”字段包含与上述类似术语的项目。相似意味着搜索查询中包含的整数值特别相似。此外,应忽略搜索数据中包含的所有标点符号。

期望的结果:

PatientA Cell Disease II 12 A 7 348 go
PatientB Disease II 12 A 7 Nucleus 348 go
PatientC, OK, II, 12 A, 7 Cell, 348 go
PatientD 7 Disease II 12-A Cell 348-go

我尝试过的查询总是对每个术语进行相同的权衡,并且会被标点符号分散注意力。我找到了这篇关于提升某些领域的帖子。 Elasticsearch "More Like This" API vs. more_like_this query

但是,如何提升特定领域中的某些字词? 谢谢!

【问题讨论】:

    标签: elasticsearch


    【解决方案1】:

    我认为您可以通过附加 some_keyword^10 之类的内容来提升特定关键字。

    虽然我在我的代码中找到了一些参考资料,但我不知道去哪里寻找文档...

    【讨论】:

    • 有趣的功能。需要尝试一下..可以解决问题
    • 如果您找到一些文档,请发表评论。我认为这是一些 lucene 语法。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-06-16
    • 1970-01-01
    • 1970-01-01
    • 2014-04-25
    • 1970-01-01
    相关资源
    最近更新 更多