How to do a wildcard or regex match on _id in elasticsearch?

前端 未结 5 522
孤城傲影
孤城傲影 2021-01-01 23:25

From below sample elasticsearch data I want to apply wildcard say *.000ANT.* on _id so as to fetch all docs whose _id contains 0

5条回答
  •  天命终不由人
    2021-01-02 00:22

    Try this

    {
       "filter": {
          "bool": {
             "must": [
                {
                   "regexp": {
                      "_uid": {
                         "value": ".*000ANT.*"
                      }
                   }
                }
             ]
          }
       }
    }
    

提交回复
热议问题