[ElasticSearch]分析之Analysis(分析)
分析(analysis)是将文本(如任何电子邮件的正文)转换为添加到倒排索引中进行搜索的tokens或terms的过程。 分析由分析器analyzer执行,分析器可以是内置分析器或者每个索引定制的自定义分析器。 1. 索引时分析(Index time analysis) 例如在索引时,内置的英文分析器将会转换下面句子: "The QUICK brown foxes jumped over the lazy dog!" 转换为添加到倒排索引中的terms如下: [ quick, brown, fox, jump, over, lazi, dog ] 1.1 指定索引时分析器 映射中的每个text字段都可以指定其自己的分析器: curl -XPUT 'localhost:9200/my_index?pretty' -H 'Content-Type: application/json' -d' { "mappings": { "my_type": { "properties": { "title": { "type": "text", "analyzer": "standard" } } }...