Mapping is the process of defining how a JSON document and the fields it contains are stored and indexed in Elasticsearch. There are various field types offered by Elasticsearch which you can assign to the fields that will be stored in Elasticsearch.
Mappings are immutable in Elasticsearch. Once a mapping type is assigned to a field, it can be only modified by re-indexing the data with the new mapping type.
Appbase.io's Schema UI (earlier called App Settings) lets you do the following:
- Add a new field and set its data type,
- In addition to a data type, you can also set the use-case for each field as either search or aggregation,
- You can update the data type of an existing field,
- You can delete an existing field.
Once you make schema changes, appbase.io does an in place re-index of the data.
Field data types are present in one of three shapes:
Primitive: Text, Keyword, Integer, Float, Double, Date, Geo Point, Boolean are some examples.
Array: An array shape in appbase.io is just a container that can hold one or more values of the primitive data type. There is no special data type associated with it.
Object: An object shape in appbase.io acts as a container that can hold a nested JSON object, each keys of which representing a primitive data type or another object / array container.
Beyond the primitive data types, there are also specialized data types that are specific to a search engine, like
percolator. You can read all about the supported data types over here.
In addition to the Schema UI described above, you can use:
- Data Browser: The data browser UI can be used to set mappings via the
Add New FieldUI button.
The UI supports adding all the primitive types. You can set your own mapping object for creating a specialized type or if you want to set any non-default options within a type.
Mappings are immutable in Elasticsearch. Once set, they can't be changed.