标签:img 查询 src quick stand blog 字符串 settings ber
POST blogs/_search { "query": { "dis_max": { "queries": [ { "match": { "title": "Quick pets" }}, { "match": { "body": "Quick pets" }} ], "tie_breaker": 0.2 } } } POST blogs/_search { "query": { "multi_match": { "type": "best_fields", "query": "Quick pets", "fields": ["title","body"], "tie_breaker": 0.2, "minimum_should_match": "20%" } } } POST books/_search { "multi_match": { "query": "Quick brown fox", "fields": "*_title" } } POST books/_search { "multi_match": { "query": "Quick brown fox", "fields": [ "*_title", "chapter_title^2" ] } } DELETE /titles PUT /titles { "settings": { "number_of_shards": 1 }, "mappings": { "my_type": { "properties": { "title": { "type": "string", "analyzer": "english", "fields": { "std": { "type": "string", "analyzer": "standard" } } } } } } } PUT /titles { "mappings": { "properties": { "title": { "type": "text", "analyzer": "english" } } } } POST titles/_bulk { "index": { "_id": 1 }} { "title": "My dog barks" } { "index": { "_id": 2 }} { "title": "I see a lot of barking dogs on the road " } GET titles/_search { "query": { "match": { "title": "barking dogs" } } } DELETE /titles PUT /titles { "mappings": { "properties": { "title": { "type": "text", "analyzer": "english", "fields": {"std": {"type": "text","analyzer": "standard"}} } } } } POST titles/_bulk { "index": { "_id": 1 }} { "title": "My dog barks" } { "index": { "_id": 2 }} { "title": "I see a lot of barking dogs on the road " } GET /titles/_search { "query": { "multi_match": { "query": "barking dogs", "type": "most_fields", "fields": [ "title", "title.std" ] } } } GET /titles/_search { "query": { "multi_match": { "query": "barking dogs", "type": "most_fields", "fields": [ "title^10", "title.std" ] } } }
ES基础(二十一) 单字符串多字段查询:Multi Match
标签:img 查询 src quick stand blog 字符串 settings ber
原文地址:https://www.cnblogs.com/qiu-hua/p/14196897.html