일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | |||||
3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 | 25 | 26 | 27 | 28 | 29 | 30 |
- licence delete curl
- sort
- zip 암호화
- high level client
- Kafka
- aggregation
- aggs
- zip 파일 암호화
- Mac
- MySQL
- plugin
- license delete
- Test
- TensorFlow
- analyzer test
- ELASTIC
- flask
- token filter test
- License
- API
- 차트
- Elasticsearch
- Python
- query
- springboot
- Java
- 파이썬
- matplotlib
- docker
- 900gle
- Today
- Total
개발잡부
[es] bucket aggregations 본문
전체 쿼리
GET hyper-item,ds-item/_search
{
"from": 0,
"size": 0,
"timeout": "60s",
"query": {
"bool": {
"filter": [
{
"range": {
"saleStartDt": {
"from": null,
"to": "now/m",
"include_lower": true,
"include_upper": true,
"boost": 1
}
}
},
{
"range": {
"saleEndDt": {
"from": "now/m",
"to": null,
"include_lower": true,
"include_upper": true,
"boost": 1
}
}
},
{
"term": {
"docDispYn": {
"value": "Y",
"boost": 1
}
}
},
{
"bool": {
"should": [
{
"terms": {
"itemStoreInfo.storeId": [
"37",
"20163"
],
"boost": 1
}
},
{
"term": {
"shipMethod": {
"value": "TD_DLV",
"boost": 1
}
}
},
{
"term": {
"storeType": {
"value": "DS",
"boost": 1
}
}
}
],
"adjust_pure_negative": true,
"boost": 1
}
},
{
"multi_match": {
"query": "풀무원",
"fields": [
"brandNmEng^1.0",
"brandNmKor^1.0",
"category.categorySearchKeyword^1.0",
"category.dcateNm^1.0",
"isbn^1.0",
"itemNo^1.0",
"itemOptionNms^1.0",
"itemStoreInfo.eventInfo.eventKeyword^1.0",
"searchItemNm^1.0",
"searchKeyword^1.0"
],
"type": "cross_fields",
"operator": "AND",
"slop": 0,
"prefix_length": 0,
"max_expansions": 50,
"zero_terms_query": "NONE",
"auto_generate_synonyms_phrase_query": false,
"fuzzy_transpositions": true,
"boost": 1
}
}
],
"adjust_pure_negative": true,
"boost": 1
}
},
"aggregations": {
"LCATE": {
"terms": {
"field": "filterInfo.lcate",
"size": 500,
"min_doc_count": 1,
"shard_min_doc_count": 0,
"show_term_doc_count_error": false,
"order": [
{
"_count": "desc"
},
{
"LCATE_ORDER": "asc"
},
{
"_key": "asc"
}
]
},
"aggregations": {
"LCATE_ORDER": {
"min": {
"field": "category.lcatePriority"
}
}
}
},
"PARTNER": {
"terms": {
"field": "filterInfo.shop",
"size": 20,
"min_doc_count": 1,
"shard_min_doc_count": 0,
"show_term_doc_count_error": false,
"order": [
{
"_count": "desc"
},
{
"_key": "asc"
}
]
}
},
"BRAND": {
"terms": {
"field": "filterInfo.brand",
"size": 20,
"min_doc_count": 1,
"shard_min_doc_count": 0,
"show_term_doc_count_error": false,
"order": [
{
"_count": "desc"
},
{
"_key": "asc"
}
]
}
},
"MALL_TYPE": {
"terms": {
"field": "mallType",
"size": 20,
"min_doc_count": 1,
"shard_min_doc_count": 0,
"show_term_doc_count_error": false,
"order": [
{
"_count": "desc"
},
{
"_key": "asc"
}
]
}
},
"GRADE": {
"range": {
"field": "grade",
"ranges": [
{
"to":1
},
{
"from": 1,
"to": 2
},
{
"from": 2,
"to": 3
},
{
"from": 3,
"to": 4
},
{
"from": 4,
"to": 5
},
{
"from": 5
}
]
}
}
}
}
"GRADE": {
"range": {
"field": "grade",
"ranges": [
{
"to":1
},
{
"from": 1,
"to": 2
},
{
"from": 2,
"to": 3
},
{
"from": 3,
"to": 4
},
{
"from": 4,
"to": 5
},
{
"from": 5
}
]
}
}
결과값
"GRADE" : {
"buckets" : [
{
"key" : "*-1.0",
"to" : 1.0,
"doc_count" : 158
},
{
"key" : "1.0-2.0",
"from" : 1.0,
"to" : 2.0,
"doc_count" : 2
},
{
"key" : "2.0-3.0",
"from" : 2.0,
"to" : 3.0,
"doc_count" : 1
},
{
"key" : "3.0-4.0",
"from" : 3.0,
"to" : 4.0,
"doc_count" : 2
},
{
"key" : "4.0-5.0",
"from" : 4.0,
"to" : 5.0,
"doc_count" : 309
},
{
"key" : "5.0-*",
"from" : 5.0,
"doc_count" : 15
}
]
},
'ElasticStack > Elasticsearch' 카테고리의 다른 글
[es] Array Aggregations (0) | 2022.07.15 |
---|---|
[es] Aggregations (0) | 2022.07.14 |
[es] aggregations script (0) | 2022.07.14 |
[es] sort - payload sort 2 (0) | 2022.07.03 |
[es] script similarity test phase 2 (0) | 2022.07.03 |