1

I've create an search template in a mustache file and place it on /config/scripts.

I'm able to do a java search with this template by specifiing the templateType

SearchResponse sr = clientES.prepareSearch("symposium-statistique-application").setTypes("application")
            .setTemplateName("aggregationByApplicationsTemplate").setTemplateType(ScriptService.ScriptType.FILE)

Note : I'm able to do indexed searchTemplate in javascript, but i have to use file template. .setTemplateParams(template_params).get();

But i don't find in the documentation Elk javascript documentation, how to do the same thing in javascript.

Thanks in advance, Alexandre

1 Answers1

0

Hoops,

it is written in the documentation use :

"template": {
    "file": "storedTemplate" 
},

instead of

"template": {
    "id": "idTemplate" 
},