It is often useful to index the same field in Elasticsearch in different ways, to serve different purposes, for example, mapping a POCO string property as a text datatype for full text search as well as mapping as a keyword datatype for structured search, sorting and aggregations. Another example is mapping a POCO string property to use different analyzers, to serve different full text search needs.

对一个field设置多种索引方式。用于不同的搜索场景。
例子:
multi-fields elasticsearch_第1张图片

使url field设置为”text”类型用于进行全文检索,同时又给它设置”keyword”类型用于排序或聚合。