码迷,mamicode.com
首页 > 其他好文 > 详细

multi-fields elasticsearch

时间:2019-03-13 12:06:35      阅读:131      评论:0      收藏:0      [点我收藏+]

标签:purpose   prope   keyword   src   map   sort   img   app   analyzer   

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设置多种索引方式。用于不同的搜索场景。
例子:
技术图片

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

multi-fields elasticsearch

标签:purpose   prope   keyword   src   map   sort   img   app   analyzer   

原文地址:https://blog.51cto.com/3922078/2362209

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!