How to create a new search template through node js client

I'm using Javascript client. Trying to create search templates through it, but didn't found the method to do it.

Use the putScript API to create a search template (which is nothing else than a script). API Reference | Elasticsearch Node.js client [7.x] | Elastic

Then the searchTemplate should be the way to go.

Thanks

1 Like