ELK 非空字段过滤

 POST /lib4/items/_bulk
{"index":{"_id":1}}
{"price":40,"itemID":"ID100123"}
{"index":{"_id":2}}
{"price":50,"itemID":"ID100124"}
{"index":{"_id":3}}
{"price":25,"itemID":"ID100124"}
{"index":{"_id":4}}
{"price":30,"itemID":"ID100125"}
{"index":{"_id":5}}
{"price":null,"itemID":"ID100127"}

// 查询在 price 字段上存在值的文档。(is_not_null)

GET /lib4/items/_search { "query" : {"bool" : {"filter" : {"exists" : {"field" : "price"}}}}}

GET /lib4/items/_search { "query" : {"constant_score" : {"filter" : {"exists" : {"field" : "price"}}}}}

 

你可能感兴趣的:(ELK)