Tag Archives: elastic search

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.

The garbled problem of hot deployment in nginx

Nginx-style IK hot deployment and its messy code problems
1. Create dic file

2 under the sibling directory of nginx. Adds a remote participle to the ik participle configuration file
After
is configured, restart nginx and elastic search.
Linux system configuration is the same as window configuration
if there is a problem with messy code, please see the following messy code solution
Messy code problem solved, pro – test available
1. Add nginx to Server
default_type 'text/html'; charset utf-8;
Add the following code to Elastic

-Xms1g
-Xmx1g
-Dfile.encoding=GBK