Skip to content

Commit 1cf21e5

Browse files
committed
add note on same name field across types
1 parent 7a311df commit 1cf21e5

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

guide/reference/mapping/index.textile

+9
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,12 @@ sidebar: reference_mapping
88
p. Mapping is the process of defining how a document should be mapped to the Search Engine, including its searchable characteristics. ElasticSearch allows for support of multiple typed mapping definitions registered with the same index, and different types registered with different indices.
99

1010
p. Explicit mapping is defined on an index type level. By default, there isn't a need to define explicit mappings as they are automatically created and registered once new type or new field is introduced (with no performance overhead) and have sensible defaults. Only when the defaults need to be overridden then mappings should be set.
11+
12+
h2. Mapping Types
13+
14+
p. Mapping types are a way to try and divide the documents indexed into the same index into logical groups. Think of it as tables in a database. Though there is separation between types, its not a full separation (all end up as a document within the same Lucene index).
15+
16+
p. Field names with the same name across types are highly recommended to have the same type and same mapping characteristics (analysis settings for example). There is an effort to allow to explicitly "choose" which field to use by using type prefix (@my_type.my_field@), but its not complete, and there are places where it will never work (like faceting on the field).
17+
18+
p. In practice though, this restriction is almost never an issue. The field name usually ends up being a good indication to its "typeness" (i.e., first_name will always be a string). Note also, that this does not apply to cross index case.
19+

0 commit comments

Comments
 (0)