Hi, I'm building an application that uses elasticsearch to store textual data from various csv inputs. i'm running the backend with nodejs and python so the indexing and uploading of data is done in elasticsearch-py. I'm having some errors with that. In the first part of that, I create my own mapping and analyzer. This is how they look like:
{
"mappings": {
"test": {
"properties": {
"age": {
"type": "long"
},
"topic_content": {
"type": "string",
"analyzer": "my_custom_analyzer",
"term_vector": "yes"
},
"name": {
"type": "string",
"analyzer": "my_custom_analyzer",
"term_vector": "yes"
}
}
}
},
"analysis": {
"analyzer": {
"my_custom_analyzer": {
"filter": [
"lowercase",
"kstem"
],
"char filter": [
"html_strip"
],
"type": "custom",
"tokenizer": "classic"
}
}
}
}
I then upload the data using the es.indices.create method in python. This is where I'm getting an error that my analyzer doesn't exist but I can see it being created so I'm confused on why I am getting this error.
es.indices.create(index = project.uid, ignore=400, body=settings)
Edit: settings above refers to the object containing my mappings and my analyzer.
{
"error": {
"root_cause": [
{
"type": "mapper_parsing_exception",
"reason": "analyzer [my_custom_analyzer] not found for field [topic_content]"
}
],
"type": "mapper_parsing_exception",
"reason": "Failed to parse mapping [test]: analyzer [my_custom_analyzer] not found for field [topic_content]",
"caused_by": {
"type": "mapper_parsing_exception",
"reason": "analyzer [my_custom_analyzer] not found for field [topic_content]"
}
},
"status": 400
}