SQL 文档没有提到 MATCH 上的布尔运算符。我不认为它被支持。
您可以执行上述搜索如下 1. 使用查询而不是匹配进行全文搜索
"query": "SELECT SUM(FlightTimeHour) Avg_Flight_Time FROM flights where QUERY('OriginCountry: AE OR OriginCountry: FR')"
- 执行关键字搜索
"query": "SELECT SUM(FlightTimeHour) Avg_Flight_Time FROM flights where OriginCountry.keyword='AE' OR OriginCountry.keyword='FR'"
编辑:以上查询为弹性搜索
GET fonds/_search
{
"query": {
"bool": {
"must": [
{
"multi_match": {
"query": "bordeaux",
"fields": [
"IDEE",
"SLOGAN",
"NOM",
"ADRESSE",
"VILLE",
"ACTIVITE1",
"ACTIVITE2",
"KEYWORDS",
"KEYWORDS_SITE",
"SITE_H1_H6",
"DESCRIPTION",
"DESCRIPTION_SITE",
"ACTIVITE3",
"BUSINESS_MODEL",
"COLORS"
]
}
},
{
"range": {
"FONDS_LEVEES_TOTAL": {
"gt": 0
}
}
},
{
"script": {
"script": "doc['COMPE_RESULTAT_CA_2000'].value + doc['COMPE_RESULTAT_CA_2001'].value>0"
}
}
]
}
},
"aggs": {
"SUM": {
"sum": {
"field": "FONDS_LEVEES_TOTAL"
}
}
}
}