Here we go with very simple example of statement "I'm running now!" and see how it will be splits into token and store into elastic search index.
statement : "I'm running now!"
if type="keyword" : [I'm running now!] - it will store in one token, you can not retrieve document it by matching 'running' or 'now' terms
if type="text": [i'm, running, now!] - it will store in three tokens, you can retrieve document by matching 'running' or 'now' terms
Text datatype
A field to index full-text values, such as the body of an email or the description of a product. These fields are
analyzed, that is they are passed through an analyzer to convert the string into a list of individual terms before being indexed. The analysis process allows Elasticsearch to search for individual words within each full text field. Text fields are not used for sorting and seldom used for aggregations (although the significant text aggregation is a notable exception).If you need to index structured content such as email addresses, hostnames, status codes, or tags, it is likely that you should rather use a
keywordfield.Keyword datatype
A field to index structured content such as email addresses, hostnames, status codes, zip codes or tags.
They are typically used for filtering (Find me all blog posts where
statusispublished), for sorting, and for aggregations. Keyword fields are only searchable by their exact value.If you need to index full text content such as email bodies or product descriptions, it is likely that you should rather use a
textfield.



