我的mapping 主要字段 put /goods_index
{
"mappings":{
"goods_type":{
"properties":{
"id":{
"type":"keyword",
"store":"true"
},
"attrs":{
"type":"nested",
"properties":{
"attr_name":{
"type":"keyword",
"index":true
},
"attr_value":{
"type":"keyword",
"index":true
}
}
}
}
}
}
}
现在有2条数据
'attrs': [
{
'attr_name': '最大长度',
'attr_value': '100',
},
{
'attr_name': '最小长度',
'attr_value': '20',
},
]
'attrs': [
{
'attr_name': '最大长度',
'attr_value': '30',
},
{
'attr_name': '最小长度',
'attr_value': '10',
},
]
我现在要查询长度范围50到100的 ,用Querybuilders改如何实现
{
"mappings":{
"goods_type":{
"properties":{
"id":{
"type":"keyword",
"store":"true"
},
"attrs":{
"type":"nested",
"properties":{
"attr_name":{
"type":"keyword",
"index":true
},
"attr_value":{
"type":"keyword",
"index":true
}
}
}
}
}
}
}
现在有2条数据
'attrs': [
{
'attr_name': '最大长度',
'attr_value': '100',
},
{
'attr_name': '最小长度',
'attr_value': '20',
},
]
'attrs': [
{
'attr_name': '最大长度',
'attr_value': '30',
},
{
'attr_name': '最小长度',
'attr_value': '10',
},
]
我现在要查询长度范围50到100的 ,用Querybuilders改如何实现
1 个回复
森 - Elasticsearch,php
赞同来自: