I'm trying to use the java-api to pass an array of parameters to a search
template. Since the SearchRequestBuilder.setTemplateParams only allows am Map<String,
String> as parameter I'm stuck. Any ideas are wellcomed. I'm using
Elasticsearch 1.4.0
Search Template created via sense:
GET /_search/template/test
{
"template": {
"query": {
"terms": {
"searchterm": [
"{{#searchterm}}",
"{{.}}",
"{{/searchterm}}"
]
}
}
}
}
Calling the search template via REST works fine:
GET /myindex/_search/template
{
"template": {
"id" : "test"
},
"params" : {
"searchterm" : [
"term1",
"term2"
]
}
}
I'm trying to use the java-api to pass an array of parameters to a search template. Since the SearchRequestBuilder.setTemplateParams only allows am Map<String, String> as parameter I'm stuck. Any ideas are wellcomed. I'm using Elasticsearch 1.4.0
Search Template created via sense:
GET /_search/template/test
{
"template": {
"query": {
"terms": {
"searchterm": [
"{{#searchterm}}",
"{{.}}",
"{{/searchterm}}"
]
}
}
}
}
Calling the search template via REST works fine:
GET /myindex/_search/template
{
"template": {
"id" : "test"
},
"params" : {
"searchterm" : [
"term1",
"term2"
]
}
}
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.