- 
                Notifications
    You must be signed in to change notification settings 
- Fork 8
Elastic search index setup
        Nithin Krishna edited this page Aug 18, 2016 
        ·
        2 revisions
      
    ###Creating an index
curl -X POST "http://ES-INDEX-URL/INDEX-NAME"###Genrating Mapping
curl -X POST -d '{
      "docs": {
        "properties": {
          "dates": {
            "type": "nested",
            "properties": {
              "count": {
                "type": "long"
              },
              "name": {
                "type": "long"
              }
            }
          },
          "entities": {
            "type": "nested",
            "properties": {
              "count": {
                "type": "long"
              },
              "name": {
                "type": "string",
                "fields": {
                  "raw": {
                    "type": "string",
                    "index": "not_analyzed",
                    "null_value": "NULL"
                  }
                }
              }
            }
          },
          "locations": {
            "type": "nested",
            "properties": {
              "admin1Code": {
                "type": "string",
                "fields": {
                  "raw": {
                    "type": "string",
                    "index": "not_analyzed",
                    "null_value": "NULL"
                  }
                }
              },
              "admin2Code": {
                "type": "string",
                "fields": {
                  "raw": {
                    "type": "string",
                    "index": "not_analyzed",
                    "null_value": "NULL"
                  }
                }
              },
              "countryCode": {
                "type": "string",
                "fields": {
                  "raw": {
                    "type": "string",
                    "index": "not_analyzed",
                    "null_value": "NULL"
                  }
                }
              },
              "location": {
                "type": "geo_point",
                "lat_lon": true,
                "geohash": true
              },
              "name": {
                "type": "string",
                "fields": {
                  "raw": {
                    "type": "string",
                    "index": "not_analyzed",
                    "null_value": "NULL"
                  }
                }
              },
              "rawText": {
                "type": "string",
                "fields": {
                  "raw": {
                    "type": "string",
                    "index": "not_analyzed",
                    "null_value": "NULL"
                  }
                }
              },
              "count": {
                "type": "long"
              }
            }
          },
          "id": {
            "type": "string"
          },
          "geo": {
            "type": "geo_point",
            "lat_lon": true,
            "geohash": true
          },
          "mime-type": {
            "type": "string",
            "fields": {
              "raw": {
                "type": "string",
                "index": "not_analyzed",
                "null_value": "NULL"
              }
            }
          },
          "places": {
            "type": "nested",
            "properties": {
              "count": {
                "type": "long"
              },
              "name": {
                "type": "string",
                "fields": {
                  "raw": {
                    "type": "string",
                    "index": "not_analyzed",
                    "null_value": "NULL"
                  }
                }
              }
            }
          },
          "people": {
            "type": "nested",
            "properties": {
              "count": {
                "type": "long"
              },
              "name": {
                "type": "string",
                "fields": {
                  "raw": {
                    "type": "string",
                    "index": "not_analyzed",
                    "null_value": "NULL"
                  }
                }
              }
            }
          },
          "organizations": {
            "type": "nested",
            "properties": {
              "count": {
                "type": "long"
              },
              "name": {
                "type": "string",
                "fields": {
                  "raw": {
                    "type": "string",
                    "index": "not_analyzed",
                    "null_value": "NULL"
                  }
                }
              }
            }
          },
          "money": {
            "type": "nested",
            "properties": {
              "count": {
                "type": "long"
              },
              "name": {
                "type": "string",
                "fields": {
                  "raw": {
                    "type": "string",
                    "index": "not_analyzed",
                    "null_value": "NULL"
                  }
                }
              }
            }
          },
          "percentages": {
            "type": "nested",
            "properties": {
              "count": {
                "type": "long"
              },
              "name": {
                "type": "string",
                "fields": {
                  "raw": {
                    "type": "string",
                    "index": "not_analyzed",
                    "null_value": "NULL"
                  }
                }
              }
            }
          },
          "time": {
            "type": "nested",
            "properties": {
              "count": {
                "type": "long"
              },
              "name": {
                "type": "string",
                "fields": {
                  "raw": {
                    "type": "string",
                    "index": "not_analyzed",
                    "null_value": "NULL"
                  }
                }
              }
            }
          },
          "measurements": {
            "type": "nested",
            "properties": {
              "value": {
                "type": "long"
              },
              "unit": {
                "type": "string",
                "fields": {
                  "raw": {
                    "type": "string",
                    "index": "not_analyzed",
                    "null_value": "NULL"
                  }
                }
              }
            }
          }
        }
      }
}' "http://ES-INDEX-URL/INDEX-NAME/docs/_mapping"Information Retrieval and Data Science (IRDS) research group, University of Southern California.