Add format to docvalues in elasticsearch js client request

Using the Elasticsearch client js, I am able to add the doc values to the request like so:

callWithRequest(_req, 'search', {
    index: indexPatternTitle,
    scroll: '1m',
    body: body,

But I want to be able to specify the format.
In the console I can add the field "format": "MM/d/YYYY h:mm:ss a"

And the result will be formatted according to the format I specified.

But I am not able to pass the format using the js client.
I tried passing an object with like:

    "field": "timestamp",
   "format": "MM/d/YYYY h:mm:ss a"

But it doesn't work.

Any Idea on How to do that? or could it even be done using the js client?


This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.