Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nested term's are broken #2955

Closed
etra opened this issue Feb 9, 2015 · 1 comment
Closed

Nested term's are broken #2955

etra opened this issue Feb 9, 2015 · 1 comment

Comments

@etra
Copy link

etra commented Feb 9, 2015

KIBANA 4 3beta
ES: 1.4.2
i'm trying to use nested fields as term field and it's not working i have. The problem is Kibana isn't constructing correctly aggregation for nested fields.

Generated by kibana (not working)

{
"query": {
"filtered": {
"query": {
"query_string": {
"query": ""
}
},
"filter": {
"bool": {
"must": [
{
"query": {
"query_string": {
"query": "
"
}
}
},
{
"range": {
"@timestamp": {
"gte": 1422745200000,
"lte": 1423516221647
}
}
}
],
"must_not": []
}
}
}
},
"size": 0,
"aggs": {
"2": {
"terms": {
"field": "ndc.pm",
"size": 5,
"order": {
"_count": "desc"
}
}
}
},
"fields": [
"*",
"_source"
],
"script_fields": {
"@timestamp": {
"script": "if (doc["@timestamp"].value == 0) { null } else { doc["@timestamp"].value }"
}
}
}

Eddited: (working)
{
"size": 0,
"aggs": {
"2": {
"nested": {
"path": "ndc"
},
"aggs": {
"2": {
"terms": {
"field": "ndc.pm"
}
}
}
}
}
}

{
"query": {
"filtered": {
"query": {
"query_string": {
"query": ""
}
},
"filter": {
"bool": {
"must": [
{
"query": {
"query_string": {
"query": "
"
}
}
},
{
"range": {
"@timestamp": {
"gte": 1422745200000,
"lte": 1423516221647
}
}
}
],
"must_not": []
}
}
}
},
"size": 0,
"aggs": {
"2": {
"nested": {
"path": "ndc"
},
"aggs": {
"2": {
"terms": {
"field": "ndc.pm"
}
}
}
}
},
"fields": [
"*",
"_source"
],
"script_fields": {
"@timestamp": {
"script": "if (doc["@timestamp"].value == 0) { null } else { doc["@timestamp"].value }"
}
}
}

@rashidkpc
Copy link
Contributor

Duplicate of #1084

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants