面试题答案
一键面试{
"query": {
"range": {
"商品价格字段名": {
"gte": 100,
"lte": 200
}
}
}
}
range
:表示范围查询。商品价格字段名
:需要替换为实际索引中存储商品价格的字段名称。gte
:即“greater than or equal to”,表示大于等于,这里指定价格下限为100。lte
:即“less than or equal to”,表示小于等于,这里指定价格上限为200。