Es error mapper of different type, current_ Type “text” solution

Error:

Caused by: java.lang.IllegalArgumentException: mapper [personName] of different type, current_type [text], merged_type [keyword]
Error creating bean with name ‘ownerOpenRecordRepository’:
If you don’t have experience with Elasticsearch, you may not know how to do it, so this article will start from scratch to solve the problem!

The first step, with our programmer’s instinct, is that the field type changes, that type changes how to do?
If in the development environment: you can access ES through the Web management terminal Kibana, you can directly delete the index that reported the error. The Internet said that it needs to be rebuilt, but in fact, it does not need to be deleted, because it is not in the production environment. It is created automatically when the project starts the instantiation. The specific operation steps are as follows;
1. First find the specific index that reported the error (the index in ES can be understood as the database), then how to find it?
The answer, of course, is to look at the log. ES will normally report an error when SpringBoot is started to connect. In the day
When we instantiate a Bean, we get an error in a Repository or something like a ×××Repository. That’s it.
2, through the address

http://118.31.60.110/###-kibana/app/kibana#/dev_tools/console?_g=()

Access the web side of ES to delete, 118.31.60.110 is the public network IP of the server where ES is located, if there is ngIx, then this IP is the IP address of ngIx, ###-kibana is also the configured item in Nginx. After successful connection, it is shown in the figure below:
 

 
Delete index
Send a RESTful style HTTP request to the Console for the delete operation, as shown below

DELETE  ds##record/_search

DS# # Record is the index name. If the method is not found, write DS# # Record directly. Then click on the right side of the path similar to the playback button can be deleted successfully
4. No error was reported when starting
If you are in production, you need to export the index, then delete and rebuild it, and finally import it again. The basic pattern is the same.

Read More: