Skip to content

Instantly share code, notes, and snippets.

@ishritam
Created August 17, 2020 12:40
Show Gist options
  • Save ishritam/f7f4a9e335495ef112afa02f3fd97f75 to your computer and use it in GitHub Desktop.
Save ishritam/f7f4a9e335495ef112afa02f3fd97f75 to your computer and use it in GitHub Desktop.
setting ={
"mappings" : {
"properties" : {
"Clean_Uses" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
},
"Clean_expert_advice" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
},
"Clean_intro_0" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
},
"Clean_intro_1" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
},
"Clean_side_effects" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
},
"count" : {
"type" : "long"
},
"name" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
},
"pack_size" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
},
"price" : {
"type" : "float"
}
}
}
}
#create the index with the mapping decleared above
es.indices.create(index='my_med', ignore=404, body= setting)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment