es essays

To es search for vehicle information returned field to start:
search rules sort:
GET _search
{
"from": 0,
"size": 3,
"Query": {
"BOOL": {
"filter": [{
"Terms": {
"loginName": [ "ADMIN"],
"Boost": 1.0
}
}, {
"Term": {
"saleStatus": {
"value": 0,
"Boost": 1.0
}
}
}],
"adjust_pure_negative": to true ,
"Boost": 1.0
}
},
"_Source": [ "ID", "Color", "year", "Brand", "Memo"], // specified field information returned by the search es
"sort":[{
"modifyTime": {
"order": "desc"
}
}]
}
GET _search
{
"from": 0,
"size": 3,
"query": {
"bool": {
"filter": [{
"terms": {
"loginName": ["admin"],
"boost": 1.0
}
}, {
"term": {
"saleStatus": {
"value": 0,
"boost": 1.0
}
}
}],
"adjust_pure_negative": true,
"boost": 1.0
}
},
"_source": {
"includes": [ "id", "brand" ,"year"],
"excludes": [ "year" ]
},
"sort": [{
"modifyTime": {
"order": "desc"
}
}]
}
GET _search
{
"query": {
"bool": {
"filter": [{
"term": {
"saleStatus": {
"value": 0,
"boost": 1.0
}
}
}, {
"terms": {
"loginName": ["admin"],
"boost": 1.0
}
}],
"adjust_pure_negative": true,
"boost": 1.0
}
},
"_source": {
"includes": [ "id", "brand" ,"year"],
"excludes": [ "year" ]
},
"aggregations": {
"mileAgeObj": {
"range": {
"field": "mileAge",
"ranges": [{
"from": 0.0,
"to": 1.0
}, {
"from": 1.0,
"to": 2.0
}, {
"from": 2.0,
"to": 3.0
}, {
"from": 3.0,
"to": 5.0
}, {
"from": 5.0,
"to": 10.0
}, {
"from": 10.0,
"to": 999.0
}],
"keyed": false
}
}
}
}

// Specify es returned by the search to exclude or include information fields
"_Source": {
"Includes": [. "OBJ1 *",. "Obj2 *"],
"excludes": [ "* .description"]
}
// Specify es field information returned by the search
"_source": [ "id" , "color", "year", "brand", "memo"],

Guess you like

Origin www.cnblogs.com/devin-sl/p/11958850.html