Elastic node js client point in time syntax

Can someone show me the right syntax for using point in time in elastic search on node js client. I'm trying like this:

const body = {
      query: {
        geo_shape: {
          geometry: {
            relation: 'within',
            shape: {
              type: 'polygon',
              coordinates: [$polygon],
      pit: {
        keep_alive: "1m",
    return client.search({
      body: body,

and it gives me search_phase_execution_exception
This query works fine in Kibana so I guess the problem is in syntax.

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