Templated search with a array of complex objects

Hi Guys,

I'm having a issue getting a templated search to work, I want to be able to
add new term filters to the query based on a array that is generated from a
UI.

{
"template":{
"filter":{
"bool":{
"must":[
"{{#features}}",
{
"term":{
"{{field}}":"{{value}}"
}
},
"{{/features}}"
]
}
}
},
"params":{
"features":[
{
"field":"services.TV.features.HD",
"value":true
},
{
"field":"services.TV.features.3D",
"value":true
}
]
}
}

This seems to get it really close to the query i'm looking for expect it's
fail because of the added double quotes shown in the error message below:

Error:
Parse Failure[
Failed to parse source[
{
"filter":{

  "bool":{

     "must":[

        "",

        {

           "term":{

              "services.TV.features.HD":"true"

           }

        },

        "",

        {

           "term":{

              "services.TV.features.3D":"true"

           }

        },

        ""

     ]

  }

}

}

Can anyone offer suggestions.

Regards,

Keith

--
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 elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/e715bd85-0677-4f49-872e-481851d7004e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.