What's the difference between the 'field' and 'field.keyword' fields in Kibana?

后端 未结 3 1849
生来不讨喜
生来不讨喜 2021-02-07 09:29

When adding a filter in kibana all string fields have a entry and .keyword entry. What is the difference?

3条回答
  •  旧巷少年郎
    2021-02-07 10:20

    From elasticsearch 5 there is no string field type, instead there is two types:

    Keyword - use it for filter, aggregation and sort.

    Text - use it for search text.

    When you index documents with string field, for example name, elasticsearch mapping the field to text field for search and to keyword for filter.

    Kibana use the field for filter and aggregation, therefore using the keyword.

    Look at elasticsearch documentation

提交回复
热议问题