您当前的位置: 首页 >  I.T10001

es7.16.2基础操作(二)

I.T10001 发布时间:2021-12-26 14:35:32 ,浏览量:4

-- 最小精度匹配
GET customer/_search
{
  "query": {
    "match": {
      "address": {
        "query": "长沙",
        "minimum_should_match": "70%"
      }
    }
  }
}

-- 最大精度匹配
GET customer/_search
{
  "query": {
    "dis_max": {
      "queries": [
        {
          "match": {
            "name": "张三"
          }
        },{
          "match": {
            "address": "二期"
          }
        }
      ]
    }
  }
}
-- tie-breaker最大精度匹配
GET customer/_search
{
  "query": {
    "dis_max": {
      "queries": [
        {
          "match": {
            "name": "张三"
          }
        },{
          "match": {
            "address": "二期"
          }
        }
      ],
      "tie_breaker": 0.8
    }
  }
}
-- multi_match中best_fields
GET customer/_search
{
  "query": {
    "multi_match": {
      "query": "长沙",
      "fields": ["address"],
      "type": "best_fields"
    }
  }
}
-- multi_match中most_fields
GET customer/_search
{
  "query": {
    "multi_match": {
      "query": "长沙",
      "fields": ["address"],
      "type": "most_fields"
    }
  }
}

-- cross_fields多字段合并查询
GET customer/_search
{
  "query": {
    "multi_match": {
      "query": "zhang san",
      "fields": ["first_name","last_name"],
      "type": "cross_fields"
    }
  }
}

-- match_phrase短语匹配/精确匹配
GET customer/_search
{
  "query": {
    "match_phrase": {
      "address": "10栋"
    }
  }
}

关注
打赏
1688896170
查看更多评论

I.T10001

暂无认证

  • 4浏览

    0关注

    154博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文
立即登录/注册

微信扫码登录

0.4018s