Help Center/
MapReduce Service/
Component Operation Guide (LTS) (Ankara Region)/
Using Elasticsearch/
Elasticsearch Usage Suggestions/
Service Planning Suggestions/
Reasonable Mapping Setting Suggestions
Updated on 2024-11-29 GMT+08:00
Reasonable Mapping Setting Suggestions
Pay attention to the following points even when you properly index data in Elasticsearch:
- It is not recommended that Elasticsearch perform dynamic mapping on data. You can assign a fixed mapping configuration to an index when creating the index. When a large amount of data is written and new fields are added, a large number of put_mapping operations are performed. As a result, the EsMaster is blocked and the running of the Elasticsearch cluster is affected. Dynamic mapping is not recommended. If dynamic mapping is required, you are advised to use precise matching rules to prevent full matching by wildcard (*). If the total number of Elasticsearch instances is greater than 500, dynamic mapping cannot be used.
- If there are a large amount of data and over 1000 fields, you are advised to classify the fields into different indexes. For example, a common query field can be written into an index, and a field which has a relatively long field length and is not frequently used is written into another index.
- Set and optimize mapping based on the actual business data, and select the type based on the specific fields and requirements.
- The string type is classified into text and keyword by default. If word segmentation is required, set this parameter to text. Otherwise, set this parameter to keyword.
- Enumeration type: This type is based on performance keyword, even integer.
- Value type: The value close to required size is used.
- Date type: If analysis is performed based on the time axis, the date type must be used. If only second-level return is required, the keyword type is recommended.
- For other types, such as Boolean, date, and geographical location, use the corresponding type.
- If a field does not need to be retrieved, set index to false.
- If a field does not need to be retrieved, sorted, or aggregated, set enable to false.
- In the norms field, norms is the index score factor. If you do not need to sort documents by score, set this field to false. The default value is true.
- The _source field is enabled by default. If the update, reindex, and highlight operations are not required, you can set _source to false to save more disk space.
Parent topic: Service Planning Suggestions
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
The system is busy. Please try again later.
For any further questions, feel free to contact us through the chatbot.
Chatbot