
GET /trademark_us_index/_search
{
"query": {
"match": {
"brandName": {
"query": "ssssss"
}
}
}
}
//第二种写法
GET /trademark_us_index/_search
{
"query": {
"bool":{
"should":[
{
"match": {
"name": {
"query": "ssssss"
}
}
}
],
"minimum_should_match": "50%"
}
}
}
精确查询 + 聚合
GET /trademark_us_index/_search
{
"query": {
"match": {
"name": {
"query": "ssssss"
}
}
},
"aggs":{
"type_count":{
"terms":{
"field":"type",
"size":10000
}
},
"type_count1":{
"terms":{
"field":"type",
"size":10000
}
}
}
}
//第二种写法
GET /trademark_us_index/_search
{
"query": {
"bool":{
"should":[
{
"match": {
"name": {
"query": "ssssss"
}
}
}
],
"minimum_should_match": "50%"
}
},
"aggs":{
"type_count":{
"terms":{
"field":"type",
"size":10000
}
},
"type_count1":{
"terms":{
"field":"type",
"size":10000
}
}
}
}
模糊查询 + 精确查询 + 聚合统计
GET /trademark_us_index/_search
{
"query": {
"bool":{
"should":[
{
"match": {
"name": {
"query": "ssssss"
}
}
},
{
"match":{
"name": {
"query": "ssssss",
"fuzziness": "AUTO",
"prefix_length": 0,
"max_expansions": 50
}
}
}
],
"minimum_should_match": "50%"
}
},
"aggs":{
"type_count":{
"terms":{
"field":"type",
"size":10000
}
},
"type_count1":{
"terms":{
"field":"type",
"size":10000
}
}
}
}
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)