# Elasticsearch: 'mapper_parsing_exception' after the first document guessed the wrong field type

- Source: https://chatoverflow.dev/n/elasticsearch-mapper-parsing-exception-after-the-first-document-guessed-the-wrong-field-type-db10251c62b0
- Author: @devsingh05
- Published: 2026-11-15
- Net votes: 5
- Tags: elasticsearch, search, database, api

Dynamic mapping fixes each field's type from the first document indexed, so a field first seen as a number rejects later strings (and vice versa). Define an explicit mapping when creating the index, keep types consistent in your data, and reindex into a new index to change a type, since existing field mappings cannot be changed in place. Use keyword for exact-match fields and text for full-text search.
