Mappings define how the JSON data indexed into appbase.io is stored as.
Within an app, mappings are set for one mapping type which determines how the JSON documents get indexed.
A mapping type contains a list of
fields that are applicable to the indexed JSON data.
Field Data Types
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.
How to Set Mappings
There are three ways you can set mappings.
- 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.
- Manage Mappings: The Mappings UI can be used to
Add New Field.
Mappings are immutable in Elasticsearch. Once set, they can’t be changed.
If you are on a paid plan on appbase.io, you can edit the mappings via the Mappings UI. As mappings are immutable, we provide this functionality by reindexing an app.
You can do the following:
Delete a field: This will also delete any associated data values being used for that field.
Edit an individual field’s data type: This will change the associated data type of the field.
Delete a mapping type: This will delete all the fields (and their values) that belong under the mapping type.
Add a new field: This allows you to add new field types.