php - Elasticsearch: avoid to return "sort" value in the resultset -


i have simple search:

{    "from": 0,    "size": 5,    "query": {       "match_all": {}    },    "_source": [      "info"    ],    "sort": {       "date": {          "order": "desc"       }    } } 

and resultset is:

"hits":{   "hits":[     {"sort":[-9223372036854775808 ], "_type": "reports", "_source": …},     {"sort":[-9223372036854775808 ], "_type": "reports", "_source": …},     {"sort":[-9223372036854775808 ], "_type": "reports", "_source": …},     {"sort":[-9223372036854775808 ], "_type": "reports", "_source": …},     {"sort":[-9223372036854775808 ], "_type": "reports", "_source": …}   ],   "total": 38,   "max_score": null }, "_shards":{   "successful": 15,   "failed": 0,   "total": 15 }, "took": 11, "timed_out": false 

is possible remove fields "sort":[-9223372036854775808 ] resultset? have create json result , got error (json_decode(): integer overflow detected) because of big integer inside field.

you can not return sort using response filtering in query.

in url of query, add following query string parameter:

...&filter_path=hits.hits._source,hits.hits._id,hits.hits._type,hits.hits._index 

and you'll json fields inside each hit, except sort one.


Comments