How to find some key which is not in mapping?

Here is my sample data

{
          "geo_type" : "GPS_LOCATION",
          "happenon" : 1544439593,
          "country" : "IND",
          "idapp" : "81",
}

my template is

{
   "index_patterns": [
     "index*"
   ],
   "settings": {
     "index": {
       "number_of_shards": "2",
       "number_of_replicas": "1"
     }
   },
   "mappings": {
     "ping": {
       "dynamic": "false",
       "properties": {
          "happenon": {
           "type": "date",
           "format": "epoch_second"
         }        
       }
     }
   },
   "aliases": {}
}

I want to run a query for geo_type field. Right now i geeting this

{
  "took": 0,
  "timed_out": false,
  "_shards": {
    "total": 2,
    "successful": 2,
    "skipped": 0,
    "failed": 0
  },
  "hits": {
    "total": 0,
    "max_score": null,
    "hits": []
  }
}

Thanks @inandi

You need to index it. With your dynamic:false setting you effectively asked to ignore the geo_type and other fields when it comes to indexing.

1 Like

yes thanks now i noticed. One more thing can i do something without re-index everything like updating that particular field. I guess not..

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.