elasticsearch - 如何在ElasticSearch中结合fuzzy_like_this和过滤器

标签 elasticsearch fuzzy-search

我想过滤fuzzy_like_this查询的结果。所以我基本上想结合以下代码片段-查询:

{
  "query": {
     "flt": {
     "like_text": "acme",
     "fields": ["company.name"]
   }
}

和过滤器:
{
  "filter": {
  "not": {
    "term": {"deleted": "true"}
  }
}

所有试图以明智的方式组合这些内容都会导致大量的ES错误文本。任何指针都很棒。

最佳答案

找到了:

{
  "query": {
    "filtered": {
      "query": {
        "flt": {
          "like_text": "acme",
          "fields": ["company.name"]
        }
      },
      "filter": {
        "not": {
          "term": {"deleted": "true"}
        }
      }
    }
  }
}

关于elasticsearch - 如何在ElasticSearch中结合fuzzy_like_this和过滤器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27330886/

相关文章:

ElasticSearch模糊查询和区分大小写

python - 模糊匹配 pyspark 数据帧字符串中的单词

python - 在 Python 中模糊查找扑克翻牌

ruby-on-rails - Elasticsearch Bool查询

c# - 调用SourceInclude而不手动指定所有属性

elasticsearch - Elasticsearch-术语为空?

postgresql - 全文搜索中的模糊搜索

sql - elasticsearch - 总金额的总和大于使用聚合的某个金额

elasticsearch - 如何将 score_mode=sum 与 Elasticsearch 多匹配查询一起使用

vim - 使用模糊搜索在 Vim 中打开文件