I tried the following code to create an index with the following mapping. I am trying to create an index with type "nested". This code does not show any error but does not seem to work. Your help is much appreciated.
def setting():
return { "stringIndex_mapping" : {
"mappings" :
{
"stringindex" : {
"mappings" : {
"files" : {
"properties" : {
"BaseOfCode" : {
"type" : "long"
},
"BaseOfData" : {
"type" : "long"
},
"Characteristics" : {
"type" : "long"
},
"FileType" : {
"type" : "long"
},
"Id" : {
"type" : "string"
},
"Strings" : {
"type" : "nested",
"properties" : {
"FileOffset" : {
"type" : "long"
},
"RO_BaseOfCode" : {
"type" : "long"
},
"SectionName" : {
"type" : "string"
},
"SectionOffset" : {
"type" : "long"
},
"String" : {
"type" : "string"
}
}
},
"SubSystem" : {
"type" : "long"
}
}
}
}
}
}
}
}
def createIndex():
es = elasticsearch.Elasticsearch()
settings = setting()
es.indices.create(
index = "stringindex",
body = settings
)