elasticsearch - 如何将段落与ElasticSearch中的短语匹配?

标签 elasticsearch

我的目标是使用ElasticSearch查找可以在正在查询的段落内找到哪些索引短语。

我尝试使用渗滤搜索,但无法将其优化为100%匹配。可悲的是,ElasticSearch文档还不够清晰。

我的索引文件:

  • 必须快于50mph
  • 必须跳到高于树
  • 能够站立在两只脚上

  • 我的查询:

    "We are looking for an animal that must be able to stand on two feet, also must jump higher than a tree, and should be faster than 40mph, and has white and red stripes with wings"



    我期望什么结果(完全匹配,不区分大小写):
  • 能够站立在两只脚上
  • 必须跳到高于树

  • 我得到什么结果(部分比赛):
  • 能够站立在两只脚上
  • 必须跳到高于树
  • 必须 50mph更快
  • 最佳答案

    but I wasn't able to refine it to be a 100% match



    似乎您需要像full-text query一样使用Match Phrase Query。从docs:

    The high-level full text queries are usually used for running full text queries on full text fields like the body of an email.

    关于elasticsearch - 如何将段落与ElasticSearch中的短语匹配?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54295959/

    相关文章:

    elasticsearch - 在 elasticsearch 5.6.0 中基于别名和模板的翻转时遇到错误

    elasticsearch - Spring Data Elasticsearch的无痛脚本

    elasticsearch - SpringData 和 Elasticsearch - 使用 ignoreFields 时出现 java.lang.StackOverflowError

    elasticsearch - 了解 ElasticSearch 中的 Decay 函数及其参数

    Cloudfoundary 上的 Elasticsearch

    elasticsearch - Elasticsearch 集群在 ECK 上丢失旧的 master 后不会选举新的 master

    elasticsearch - 没有 ACID 数据库是否可以进行事务(就数据一致性而言)?

    python - 如何在 Python elasticsearch 中转义连字符

    php - 使用Elastic Search在CouchDB中的数组内部查询

    ElasticSearch 分页和排序