Fixing ElasticSearch 'No handler for type [int] declared on field ...'
Problem:
You want to create an index with a custom mapping in ElasticSearch but you see an error message like this:
example.txt
elasticsearch.exceptions.RequestError: RequestError(400, 'mapper_parsing_exception', 'No handler for type [int] declared on field [id]')
Solution
You likely have a mapping like
example.json
"id": {
"type": "int"
}
in your mapping properties
.
The issue here is int
: ElasticSearch uses integer
as type of integers, not int
!
In order to fix the issue, change the property to
example.json
"id": {
"type": "integer"
}
and retry creating the index.
Check out similar posts by category:
Databases, ElasticSearch
If this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow