Create Elasticsearch curl query for not null and not empty(“”)

后端 未结 12 996
陌清茗
陌清茗 2020-12-13 01:21

How can i create Elasticsearch curl query to get the field value which are not null and not empty(\"\"),

Here is the mysql query:

select field1 from          


        
12条回答
  •  难免孤独
    2020-12-13 01:57

    You can use not filter on top of missing.

    "query": {
      "filtered": {
         "query": {
            "match_all": {}
         },
         "filter": {
            "not": {
               "filter": {
                  "missing": {
                     "field": "searchField"
                  }
               }
            }
         }
      }
    }
    

提交回复
热议问题