Hello Group, I´m facing a problem with pre-registered templates. I´m able to store them, and I´m able to call them via REST (passing params) - everything works like a charm :) But using the Java-API there is a problem: the setTemplateParams method only accepts a Map<String, String> as a parameter.
I want to pass a collection of numbers to my tempate in order to get a result, without success, because i need to pass a Map<String, Object> to my SearchRequestBuilder. I´ve found this (this is similar to what I´m looking for): https://github.com/elasticsearch/elasticsearch/blob/master/src/test/java/org/elasticsearch/index/query/TemplateQueryTest.java#L393 Map<String, Object> arrayTemplateParams = new HashMap<>(); String[] fieldParams = {"foo","bar"}; arrayTemplateParams.put("fieldParam", fieldParams); SearchResponse searchResponse = client().prepareSearch("test").setTypes("type").setTemplateName("/mustache/4").setTemplateType(ScriptService.ScriptType.INDEXED).setTemplateParams(arrayTemplateParams).get(); assertHitCount(searchResponse, 5); Not in version 1.4.2 nor in 1.4.3-SNAPSHOT the method signature have changed. So how can I pass (not string) collections to my template? Cheers, Rafael -- You received this message because you are subscribed to the Google Groups "elasticsearch" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/99aac531-20e7-44c5-821f-e04b4f7b9f38%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
