server/src/tests/Controllers/GeoStatsControllerTest.php
changeset 387 7fba86fa8604
parent 320 0fce13da58af
child 407 2dba812c7ef2
equal deleted inserted replaced
386:c731ab9b934d 387:7fba86fa8604
   114     }
   114     }
   115 
   115 
   116 
   116 
   117     public function testGetIndexArea()
   117     public function testGetIndexArea()
   118     {
   118     {
       
   119 
   119         $query = [
   120         $query = [
   120             'index' => env('ELASTICSEARCH_INDEX'),
   121             "index" => env('ELASTICSEARCH_INDEX'),
   121             'body' => [
   122             "body" => [
   122                 "size" => 0,
   123                 "size" => 0,
   123                 "query" => [
   124                 "query" => [
   124                     'term' => [
   125                     "constant_score" => [
   125                         "geonames_hierarchy" => "code_area"
   126                         "filter" => [
       
   127                             "bool" => [
       
   128                                 "must" => [ [
       
   129                                     "term" => [ "geonames_hierarchy" => "code_area" ]
       
   130                                 ] ]
       
   131                             ]
       
   132                         ]
   126                     ]
   133                     ]
   127                 ],
   134                 ],
   128                 "aggs" => [
   135                 "aggs" => [
   129                     "geos" => [
   136                     "geos" => [
   130                         "terms" => [
   137                         "terms" => [