【发布时间】:2019-05-14 15:32:12
【问题描述】:
我想将multi-match 与通配符 字段一起使用,如下所示:"fields" : [ "A*", "B*" ],。
现在,我希望任何 A 字段中的命中率都高于 B 字段中的命中率。
所以我的假设是"fields" : [ "A*^5", "B*^1" ], 应该可以工作。不是,不管5在A还是B上,结果顺序都是一样的。
哦,这是 Amazon ES (v1.5.xx)。最终我想要带有术语查询的 edgeNgram,但下面的示例使用股票短语前缀更短:
curl -XPUT 'http://localhost:9200/test123'
curl -XPUT http://localhost:9200/test123/type1/001 -d '{"A_01": "Solace"}'
curl -XPUT http://localhost:9200/test123/type1/002 -d '{"B_64": "Solitude"}'
curl -XGET 'http://localhost:9200/test123/_search?explain' -d '{
"query" : {
"multi_match": {
"query" : "Sol",
"fields" : [ "A*^5", "B*^1" ],
"type" : "phrase_prefix"
}
}
}'
恐怕我一定忽略了一些东西(很简单)。任何指针都非常感谢!
【问题讨论】:
标签: elasticsearch