Good day:
I'm querying my Elastic instance and getting back results for both my scriptField
and Aggregation
:
ScriptField
"fields": {
"distance": [
6569.304614953225
]
}
Aggregations
"aggregations": {
"children#Capacity": {
"doc_count": 15,
"histogram#Capacity": {
"buckets": [
{
"key": 0,
"doc_count": 15
}
]
}
},
"geo_distance#Distance": {
"buckets": [
{
"key": "*-5.0",
"from": 0,
"to": 5,
"doc_count": 15
},
{
"key": "6.0-105.0",
"from": 6,
"to": 105,
"doc_count": 0
},
{
"key": "106.0-505.0",
"from": 106,
"to": 505,
"doc_count": 0
}
]
}
}
The Elastic response gets mapped to ISearchResponse
however serializing ISearchResponse.Hits.Aggregations
and ISearchResponse.Hits.Fields
into JSON, the values are all empty:
Fields
{
"fields": {
"distance": {}
}
}
Aggregations
{
"Aggs": {
"Capacity": {
"Capacity": {
"Items": [
{}
],
"DocCountErrorUpperBound": null,
"SumOtherDocCount": null,
"Meta": null,
"DocCount": 0,
"BgCount": 0
}
},
"Distance": {
"Items": [
{},
{},
{}
],
"DocCountErrorUpperBound": null,
"SumOtherDocCount": null,
"Meta": null,
"DocCount": 0,
"BgCount": 0
}
}
}
As you can see the distance
in the scriptField
response is empty. Also the items
in the Aggregation is also empty.