Это официальный сайт, предоставленный Java api -
SearchResponse sr = new SearchTemplateRequestBuilder(client)
.setScript("template_gender")
.setScriptType(ScriptService.ScriptType.FILE) //this ScriptService.ScriptType.FILE
.setScriptParams(template_params)
.setRequest(new SearchRequest())
.get()
.getResponse();
Мой код следующий:
SearchResponse response = new SearchTemplateRequestBuilder(client)
.setScript("query_by_type")
.setScriptType(ScriptService.ScriptType.FILE) //error (ScriptService not found ScriptType)
.setScriptParams(scriptParams)
.setRequest(new SearchRequest("bookrack").types("book"))
.get().getResponse();
моя версия elastisearch - 6.5.2
Чем он отличается от официального сайта? SetScriptType () setScriptType здесь могут быть только (ScriptType.INLINE) и (ScriptType.STORED)