标签:style keyword prope content 就是 col match world pos
PUT test/_doc/1 { "content":"Hello World" } GET test/_mapping { "test" : { "mappings" : { "properties" : { "content" : { "type" : "text", "fields" : { "keyword" : { "type" : "keyword", "ignore_above" : 256 } } } } } } } GET test/_analyze { "explain": true, "analyzer": "standard", "text": "Hello World" } POST test/_search { "profile": "true", "query": { "match": { "content": "Hello World" } } } POST test/_search { "profile": "true", "query": { "match": { "content": "hello world" } } } #查的到数据,因为content.keyword在存数据的时候不分词,不做任何处理.存的就是Hello World POST test/_search { "profile": "true", "query": { "match": { "content.keyword": "Hello World" } } } #查不到数据,因为content.keyword在存数据的时候不分词,不做任何处理.存的就是Hello World,而你用小写的hello world去查询,所以查不到数据 POST test/_search { "profile": "true", "query": { "match": { "content.keyword": "hello world" } } } #查不到,termquery :content:Hello World,你存的数据content是hello POST test/_search { "profile": "true", "query": { "term": { "content": "Hello World" } } } #termquery.查不到content作为整体去查 POST test/_search { "profile": "true", "query": { "term": { "content": "hello world" } } } #查的到,content存的数据是Hello World,所以查得到 POST test/_search { "profile": "true", "query": { "term": { "content.keyword": "Hello World" } } }
标签:style keyword prope content 就是 col match world pos
原文地址:https://www.cnblogs.com/wangchuanfu/p/14182520.html