2015-05-13 35 views

回答

4

使用exists filter,如:

POST /test_index/_search 
{ 
    "filter": { 
     "exists": { 
      "field": "b" 
     } 
    } 
} 

编辑:如果你需要一个Lucene的查询字符串查询,这应该这样做:

POST /test_index/_search 
{ 
    "query": { 
     "query_string": { 
     "query": "b:*" 
     } 
    } 
} 

下面是一些代码,我用测试它:

http://sense.qbox.io/gist/ad336a0888a279bfdace03e217bf1915adbf0fe2

+0

我想我t使用Lucene查询字符串与Kibana一起工作,而不是查询DSL。 –

+0

看到我上面的修改。 –

+0

现在它可以工作,谢谢! –