Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - What are the data types of elasticsearch mapping?
What are the data types of elasticsearch mapping?
Es supports most data types in java:

(1) Core data type:

(1) String: It is segmented by default. A complete example is as follows.

"Status": {

"type": "string",//string type

"index": "analyzed"// participle, non-participle: not_analyzed, set to no, the field will not be indexed.

"analyzer":"ik"// Specify a word breaker.

"Promotion": 1.23// field-level score weight

"doc _ values": the false//not _ analyzed field is turned on by default, and the word segmentation field cannot be used, which can improve performance and save memory for sorting and aggregation.

"fielddata": {"format": "disabled"}/For segmented fields, participating in sorting or aggregation can improve performance. Doc_value is recommended for non-segmented fields.

"fields": {"raw": {"type": "string", "index ":" not _ analyzed"} }/ You can provide multiple indexing methods for a field, the value of the same field, a participle and a non-participle.

"Ignore _ above": 100//Text with more than100 characters will be ignored and will not be indexed.

"include _ in _all ":true// Sets whether the field is included in the _ all field. The default value is true unless index is set to the no option.

"index_options":"docs"//4 Optional parameters Docs (index document number), freqs (document number+word frequency), positions (document number+word frequency+position, usually used for distance query) and offsets (document number+word frequency+position +offset, usually used for highlighted fields) have the default word segmentation field of position.

"norms": {"enable": true," loading ":" lazy "}// Word segmentation field is configured by default, and the word segmentation field is {"enable":false} by default. boost is used when storing length factors and indexes. It is recommended to use fields that need to participate in scoring, which will increase memory consumption.

"null_value":"NULL"// Set the initialization values of some missing fields, only string can be used, and the null values of the participle fields will also be segmented.

"position _ increase _ gap": 0//Influence distance query or approximate query, which can be set in the data segmentation field of multi-value field, and the slope interval can be specified when querying. The default value is 100.

"Store": false//Whether to separate this field from the _source field by setting whether to store it separately. The default value is false, and you can only search, but you can't get the value.

"search_analyzer":"ik"// Set the word breaker when searching, which is consistent with an analyzer by default. For example, use standard+ngram when indexing, and use standard to complete the automatic prompt function when searching.

"Similarity": "BM25"// The default is TF/IDF algorithm, and a field scoring strategy is specified, which is only valid for string types and word segmentation types.

"$ term_vector":"no"// By default, vector information is not stored, and parameters Yes ($ TERM storage), With _ Positions ($ TERM+position) and With _ Positions _ Offsets ($ TERM+position+offset) are supported to improve the performance of quick highlighting.

}

(2) Number types mainly include the following:

Long: 64-bit storage

Integer: 32-bit storage

Short: 16 bit storage

Bytes: 8-bit storage

Double: 64-bit double-precision storage

Floating point: 32-bit single-precision storage

Support parameters:

Compete:true/false If the data is not clean, the string will be automatically converted to an appropriate number type, the string will be forcibly converted to a number, the floating-point type will be converted to an integer, and the latitude and longitude will be converted to a standard type.

Promotion: weighting factor in indexing

Doc_value: Do you want to open doc_value?

Ignore _ formatting:false (wrong number type will report exception) true (will be ignored).

Include_in_all: whether it is included in the _all field.

Index:not_analyzed does not divide words by default.

Null_value: The value that is replaced by default.

Precision _ step: 16 additionally stores the corresponding $ term, which is used to speed up the performance of numeric types when performing range query, and the index amount is relatively large.

Store: Whether to store a specific value.

(3) Type of compound

Array type: there is no obvious field type setting, and the value of any field can be added from 0 to more. They must be of the same type:

Object type: Store hierarchical data like json.

Nested type: supports the array type object Aarray[Object], which can be nested layer by layer.

(4) Geographical type

Geographic point type: supports latitude and longitude storage and distance range retrieval.

Geo-shape type: supports the retrieval of any graphic range, such as rectangles and planar polygons.

(5) Special types

Ipv4 type: used to store IP addresses, which will be converted into long storage inside es.

Completion type: fst finite state machine is used to provide suggested prefix query function.

Token_count type: provides token-level counting function.

Mapper-murmurmur3 type: install Sudobin/Plugin and install Mapper-size plug-in, which can support _size statistics _ source data size.

Attachment type: it needs the support of/elastic/elastic search-mapper-attachments open source es plug-in, and can store office, html and other types.

(6) Multi-valued fields:

Field values can be stored by various word breakers, use field parameters, and support most es data types.