ElasticSearch-- data modeling best practices

 

 

How to model

mapping design is very important and need to be considered from two dimensions:

  • Features: search, sort, aggregate
  • Performance: The performance of the storage unlock, memory overhead, search

mapping Note:

  • It is easy to add a new field (required update_by_query if necessary)
  • Update Delete field does not allow (reconstruction needs reindex data)

 

 

Best Practices

1, does not allow automatic new field, the dynamic set to strict. The default is true;

2, no word field, the type provided keyword. Use the default multi-field characteristics, text, keyword these two types have;

3, no need to check the field, the index set to false. The default is true;

4, and does not need to sort the polymerization field, doc_values ​​arranged false. The default is true;

5, no checking, sorting, polymeric field, arranged to enable false, do only memory;

6, type = text field can not sort by default, such as the need to sort the fielddata set to true, the default is false;

7, to avoid excessive single index field, the default maximum value of 1000;

8, to avoid the problem of inaccurate polymerization caused by nulls;

9. Avoid using regular query;

10, try not to associate index designed to be a little more redundant fields, space for time, truthfully can not be avoided, according to the following ways:

 

 

 

 

 

 

Guess you like

Origin www.cnblogs.com/caoweixiong/p/12010353.html