1. 程式人生 > >elasticsearch 增刪改查 ---長期更新

elasticsearch 增刪改查 ---長期更新

1、單欄位 多個搜尋值 的 模糊查詢

使用 bool 的 should 去查詢。

{
  "query": {
    "bool": {
      "must": [
        {
          "bool": {
            "should": [
              {
                "wildcard": {
                  "mobile": {
                    "value": "13*"
                  }
                }
              },
              {
                "wildcard": {
                  "mobile": {
                    "value": "17712345986"
                  }
                }
              }
            ]
          }
        }
      ]
    }
  }
}