2015-12-01 148 views

回答

0

實現動態腳本後,以下爲我做的伎倆(只要其中沒有空值):

POST /myIndex/_search?Document' -d ' 
{ 
    "query" : { 
     "filtered" : { 
      "filter" : { 
       "exists" : { "field" : "someField" } 
      } 
     } 
    },  
    "aggs" : { 
     "max_length" : { "max" : { "script" :doc['someField'].value.length()" } } 
    } 
} 
相關問題