任何人都可以请告诉我如何可以在elasticsearch中使用多个字段编写通配符查询我在这方面搜索了很多,但有人告诉我使用查询字符串或多个匹配,但在我的情况下问题是查询字符串不工作我我的代码下面给出了一个单场通配符查询,如果任何人都知道这事,请大家分享一些光在这ES中有多个字段的通配符查询?
"query": {
"wildcard" : { "places_area1.city.raw_wildcard" : last_wildcard_string }
}
UPDATE 映射
"settings": {
"index": {
"analysis": {
"analyzer": {
"synonym_wildcard": {
"tokenizer": "whitespace",
"filter": ["filter_wildcard"]
},
"synonym_term": {
"tokenizer": "keyword",
"filter": ["filter_term"]
},
"simple_wildcard": {
"tokenizer": "whitespace"
}
},
"filter": {
"filter_term": {
"tokenizer": "keyword", // here you have to write this only for tokenizer keyword but not for whitespace
"type": "synonym",
"synonyms_path": "synonyms.txt",
},
"filter_wildcard": {
"type": "synonym",
"synonyms_path": "synonyms.txt",
}
}
}
}
},
mappings : {
places_area1: {
properties:{
area1 : {"type" : "string", "index": "analyzed", "analyzer": "simple_wildcard"},
city : {"type" : "string", "fields": {
"raw": {
"type": "string",
"analyzer": "synonym_term"
},
"raw_wildcard": {
"type": "string",
"analyzer": "synonym_wildcard"
}
} },
}
}
}
}
预先感谢您
什么是您对字段映射你正在运行查询?你能告诉我们你想要像样本文件一样匹配吗? – ChintanShah25
hey chintan你能帮我一个忙吗你知道如何在ES中编写带有多个字段的通配符查询? –