You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/main/asciidoc/reference/elasticsearch-object-mapping.adoc
+11-20Lines changed: 11 additions & 20 deletions
Original file line number
Diff line number
Diff line change
@@ -3,12 +3,15 @@
3
3
4
4
Spring Data Elasticsearch Object Mapping is the process that maps a Java object - the domain entity - into the JSON representation that is stored in Elasticsearch and back.
5
5
6
-
Earlier versions of Spring Data Elasticsearch used a Jackson based conversion, Spring Data Elasticsearch 3.2.x introduced the <<elasticsearch.mapping.meta-model>>. As of version 4.0 only the Meta Object Mapping is used, the Jackson based mapper is not available anymore.
6
+
Earlier versions of Spring Data Elasticsearch used a Jackson based conversion, Spring Data Elasticsearch 3.2.x introduced the <<elasticsearch.mapping.meta-model>>. As of version 4.0 only the Meta Object Mapping is used, the Jackson based mapper is not available anymore and the `MappingElasticsearchConverter` is used.
7
7
8
8
The main reasons for the removal of the Jackson based mapper are:
9
9
10
10
* Custom mappings of fields needed to be done with annotations like `@JsonFormat` or `@JsonInclude`. This often caused problems when the same object was used in different JSON based datastores or sent over a JSON based API.
11
11
* Custom field types and formats also need to be stored into the Elasticsearch index mappings. The Jackson based annotations did not fully provide all the information that is necessary to represent the types of Elasticsearch.
12
+
* Fields must be mapped not only when converting fromand to entities, but also an query argument, returned data and on other places.
13
+
14
+
Using the `MappingElasticsearchConverter` now covers all these cases.
12
15
13
16
14
17
[[elasticsearch.mapping.meta-model]]
@@ -20,7 +23,7 @@ This allows to register `Converter` instances for specific domain type mapping.
20
23
[[elasticsearch.mapping.meta-model.annotations]]
21
24
=== Mapping Annotation Overview
22
25
23
-
The `ElasticsearchEntityMapper` can use metadata to drive the mapping of objects to documents. The metadata is taken from the entities properties which can be annotated.
26
+
The `MappingElasticsearchConverter` uses metadata to drive the mapping of objects to documents. The metadata is taken from the entity's properties which can be annotated.
24
27
25
28
The following annotations are available:
26
29
@@ -206,25 +209,14 @@ public class Config extends AbstractElasticsearchConfiguration {
0 commit comments