json - Elasticsearch search templates -


I tried to use ES's search template, as specified in a conditional clause. I am sending my request to / [my_index] / _ search / template endpoint Request JSON fails due to parsing issues, which makes sense because after adding conditional clause the payload is no longer valid JSON. How do I feel about using search templates? Is there a named endpoint for non-Jasonan templates?

You need to avoid the template in stripping wrapping.

From the same link you are referring to:

It has been written above, this template is not valid JSON because it contains section markers like {{#line_no}}. For this reason, the template must be stored in a file (see section "Pre-Registered Template Edit") or when used through the REST API, it should be written as string:

{\ "Query \": {\ "match \": {\ "line \": \ "{{text}} \" "{}}", \ "Filter \": {{# LINE_NO}} \ "border \": {\ "LINE_NO \": {{{begin}} \ "gte \": \ "{{start}} \ "{{End}} \" {{end}}} {\ {end}} {{end}} { {/ LINE_NO}}}}}} "


Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -