Saturday, 24 October 2015

Elasticsearch: number type

byte, short, integer, long, float, and double are comes under number category. Ranges for this data types are same as java data types.

Delete employee type if is there any…
DELETE organization/employee

PUT /organization/_mapping/employee
{
 "employee":{
  "properties" : {
   "firstName" : {"type" : "string", "store" : true},
   "lastName" : {"type" : "string", "store" : true},
   "salary" : {"type" : "double", "store" : true}
  }
 }
}
You can check the mapping like below.

GET /organization/_mapping/employee
Response like below.

{
   "organization": {
      "mappings": {
         "employee": {
            "properties": {
               "firstName": {
                  "type": "string",
                  "store": true
               },
               "lastName": {
                  "type": "string",
                  "store": true
               },
               "salary": {
                  "type": "double",
                  "store": true
               }
            }
         }
      }
   }
}   



Prevoius                                                 Next                                                 Home

No comments:

Post a Comment