【发布时间】:2017-10-24 23:22:39
【问题描述】:
这是一个代码
GET /news/_search
{
"query": {
"bool": {
"must": [
{
"multi_match": {
"query": "France and Luxembourg",
"fields": [
"stkno",
"tag",
"content",
"htext"
],
"operator": "and"
}
},
{
"range": {
"CDate": {
"gt": "2017-05-23T14:02:11",
"lte": "2017-05-24T23:59:59"
}
}
}
]
}
},
"from": 0,
"size": 100,
"sort": [
{
"CDate": {
"order": "desc"
}
}
]
}
使用上述命令后,命中总数为 2 条记录。但是一个有确切的单词“France and Luxembourg”,另一个只有“France”。
我的问题如下:
- 已经使用“必须”,为什么不只显示“法国和卢森堡”这个词?
- 操作员的目的是什么? elasticsearch我已经看过了,但是实在看不懂,能不能多解释一下?
重新编辑:
我尝试使用如下编码,但结果为空。enter code here
POST _search
{
"query": {
"bool": {
"should": [
{
"term": {
"stkno": "France and Luxembourg"
}
},
{
"term": {
"tag": "France and Luxembourg"
}
},
{
"term": {
"context": "France and Luxembourg"
}
},
{
"term": {
"htext": "France and Luxembourg"
}
}
],
"minimum_should_match": 1
}
}
}
谢谢...
【问题讨论】:
标签: elasticsearch