In this section, we will discuss the core data types supported by Elasticsearch. You can set the mapping using the Mapping API.
Core data types
Text
Starting Elasticsearch 5.0, the string data type is deprecated and replaced by the text and keyword data types. If you want to perform a full-text search as we discussed in the previous section, you should use text data type. If you only want an exact match, you should use keyword data type. We will discuss keyword data type in the next section.
Let's take the same example we used in Chapter 1, Introduction to Elasticsearch. We have a document containing the following fields:
{
"date": "2017-01-01",
"description": "Yosemite national...