Hi
I am new in ELK stack, need your advice.
I am using nested aggregation.
GET account_credit/person/_search
{
"aggs": {
"count_by_gender": {
"terms": {
"field": "creditcard_number.keyword"
},
"aggs": {
"ip_address": {
"terms": {
"field": "ip_address.keyword"
}
}
}
}
}
}
result is
{
"key": "3555539887215424",
"doc_count": 3,
"ip_address": {
"doc_count_error_upper_bound": 0,
"sum_other_doc_count": 0,
"buckets": [
{
"key": "6.202.255.220",
"doc_count": 3
but when I am using below DSL
GET account_credit/person/_search
{
"query" : {
"term" : {"creditcard_number.keyword":"3555539887215424"}
},
"sort": [
{
"ip_address.keyword": {
"order": "desc"
}
}
]
}
response
{
"took": 3,
"timed_out": false,
"_shards": {
"total": 5,
"successful": 5,
"skipped": 0,
"failed": 0
},
"hits": {
"total": 8,
"max_score": null,
"hits": [
{
"_index": "account_credit",
"_type": "person",
"_id": "3jupwWQBCxMvYbonq5dD",
"_score": null,
"_source": {
"id": 2000001,
"first_name": "Felicle",
"last_name": "Evitt",
"email": "fevitt0@ustream.tv",
"gender": "Female",
"ip_address": "75.73.29.197",
"creditcard_type": "switch",
"creditcard_number": "3555539887215424",
"balance": "96862289.14"
},
"sort": [
"75.73.29.197"
]
},
{
"_index": "account_credit",
"_type": "person",
"_id": "B76hwWQBR_kMIhVB6dfC",
"_score": null,
"_source": {
"id": 1,
"first_name": "Felicle",
"last_name": "Evitt",
"email": "fevitt0@ustream.tv",
"gender": "Female",
"ip_address": "75.73.29.197",
"creditcard_type": "switch",
"creditcard_number": "3555539887215424",
"balance": "96862289.14"
},
"sort": [
"75.73.29.197"
]
},
{
"_index": "account_credit",
"_type": "person",
"_id": "Db6qwWQBR_kMIhVBPtcE",
"_score": null,
"_source": {
"id": 2000001,
"first_name": "Felicle",
"last_name": "Evitt",
"email": "fevitt0@ustream.tv",
"gender": "Female",
"ip_address": "75.73.21.197",
"creditcard_type": "switch",
"creditcard_number": "3555539887215424",
"balance": "96862289.14"
},
"sort": [
"75.73.21.197"
]
},
{
"_index": "account_credit",
"_type": "person",
"_id": "9TutwWQBCxMvYbonBpey",
"_score": null,
"_source": {
"id": 222,
"first_name": "Felicle",
"last_name": "Evitt",
"email": "fevitt0@ustream.tv",
"gender": "Female",
"ip_address": "75.73.21.197",
"creditcard_type": "switch",
"creditcard_number": "3555539887215424",
"balance": "96862289.14"
},
"sort": [
"75.73.21.197"
]
},
{
"_index": "account_credit",
"_type": "person",
"_id": "-TutwWQBCxMvYbonZZfA",
"_score": null,
"_source": {
"id": 222,
"first_name": "Felicle",
"last_name": "Evitt",
"email": "fevitt0@ustream.tv",
"gender": "Female",
"ip_address": "75.73.20.197",
"creditcard_type": "switch",
"creditcard_number": "3555539887215424",
"balance": "96862289.14"
},
"sort": [
"75.73.20.197"
]
},
{
"_index": "account_credit",
"_type": "person",
"_id": "pr7yjGQBR_kMIhVBbaCL",
"_score": null,
"_source": {
"id": 222,
"first_name": "Darryl",
"last_name": "Cabrales",
"email": "dcabrales65@cafepress.com",
"gender": "Male",
"ip_address": "6.202.255.220",
"creditcard_type": "jcb",
"creditcard_number": "3555539887215424",
"balance": "7367624.70"
},
"sort": [
"6.202.255.220"
]
},
{
"_index": "account_credit",
"_type": "person",
"_id": "6DuCwWQBCxMvYbonP4_Y",
"_score": null,
"_source": {
"id": 222,
"first_name": "Darryl",
"last_name": "Cabrales",
"email": "dcabrales65@cafepress.com",
"gender": "Male",
"ip_address": "6.202.255.220",
"creditcard_type": "visa",
"creditcard_number": "3555539887215424",
"balance": "7367624.70"
},
"sort": [
"6.202.255.220"
]
},
{
"_index": "account_credit",
"_type": "person",
"_id": "2DuDwWQBCxMvYboncpPM",
"_score": null,
"_source": {
"id": 222,
"first_name": "Darryl",
"last_name": "Cabrales",
"email": "dcabrales65@cafepress.com",
"gender": "Male",
"ip_address": "6.202.255.220",
"creditcard_type": "visa",
"creditcard_number": "3555539887215424",
"balance": "7367624.70"
},
"sort": [
"6.202.255.220"
]
}
]
}
}
why in aggregation I am not getting all ip address.
Please help on this