Elasticsearch search template resulting in “Improperly closed variable” when trying to renderHow to update date field in elasticsearchHasChild and function score sortingElastic search remove objects from a nested listElasticsearch fielddata unsupported while index mappingHow to write Elasticsearch multiple must scripts query?ElasticSearch and Groovy scripting with “n”Determining a parameter value on a ElasticSearch template: search TemplateElastic query to search a term and with in a date range
Does trying to charm an uncharmable creature cost a spell slot?
What are the IPSE’s, the ASPE’s, the FRIPSE’s and the GRIPSE’s?
How to determine algebraically whether an equation has an infinite solutions or not?
What to do about my 1-month-old boy peeing through diapers?
How many petaflops does it take to land on the moon? What does Artemis need with an Aitken?
What was the point of "Substance"?
Force SQL Server to use fragmented indexes?
Is it unusual for a math department not to have a mail/web server?
Can MuseScore be used programmatically?
Find most "academic" implementation of doubly linked list
Dotted background on a flowchart
Why did the population of Bhutan drop by 70% between 2007 and 2008?
How to pass 2>/dev/null as a variable?
Is a Centaur PC considered an animal when calculating carrying capacity for vehicles?
Are (c#) dictionaries an Anti Pattern?
助けてくれて有難う meaning and usage
Recommended Breathing Exercises to Play Woodwinds
Should I use the words "pyromancy" and "necromancy" even if they don't mean what people think they do?
Can someone identify this unusual plane at airport?
Find feasible point in polynomial time in linear programming
Do sharpies or markers damage soft rock climbing gear?
Was a star-crossed lover
Why is there not a willingness from the world to step in between Pakistan and India?
Can an object tethered to a spaceship be pulled out of event horizon?
Elasticsearch search template resulting in “Improperly closed variable” when trying to render
How to update date field in elasticsearchHasChild and function score sortingElastic search remove objects from a nested listElasticsearch fielddata unsupported while index mappingHow to write Elasticsearch multiple must scripts query?ElasticSearch and Groovy scripting with “n”Determining a parameter value on a ElasticSearch template: search TemplateElastic query to search a term and with in a date range
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I have the following template I am trying to use on Elasticsearch 6.6.2:
#hasSpecialIDFilters
"query":
"bool":
"must": [
"terms":
"mySpecialID": [#joinmySpecialIDFilters/join]
]
,
/hasSpecialIDFilters
"sort": [
"mySortingField": "desc"
]
I have a Java application that transforms this template to be part of a RESTful request body and sends it to my cluster. I should note that I have other templates that run through this system with no issue. The resulting request is:
"script":
"lang": "mustache",
"source":"#hasSpecialIDFilters"query":"bool":"must":["terms":"mySpecialID":[#joinmySpecialIDFilters/join]],/hasSpecialIDFilters"sort":["mySortingField":"desc"]"
When I try to render the template:
POST _render/template/my-special-template
I get the following error:
"error":
"root_cause": [
"type": "general_script_exception",
"reason": "Failed to compile stored script [my-special-template] using lang [mustache]"
],
"type": "general_script_exception",
"reason": "Failed to compile stored script [my-special-template] using lang [mustache]",
"caused_by":
"type": "mustache_exception",
"reason": "Improperly closed variable in query-template:1"
,
"status": 500
If I remove the #hasSpecialIDFilters
and /hasSpecialIDFilters
lines, the template renders fine, but I use that value as a boolean to dictate whether I should include the terms array bool query within. I am not sure why this is an issue, since everything looks syntactically correct.
A workaround for me would be to just maintain two separate templates, one requiring the mySpecialIDFilters
array, and one without it, with my calling code dictating which one to call, but I'd rather have it within one template.
Does anyone have any ideas what might be the issue?
Thanks in advance!
elasticsearch
add a comment |
I have the following template I am trying to use on Elasticsearch 6.6.2:
#hasSpecialIDFilters
"query":
"bool":
"must": [
"terms":
"mySpecialID": [#joinmySpecialIDFilters/join]
]
,
/hasSpecialIDFilters
"sort": [
"mySortingField": "desc"
]
I have a Java application that transforms this template to be part of a RESTful request body and sends it to my cluster. I should note that I have other templates that run through this system with no issue. The resulting request is:
"script":
"lang": "mustache",
"source":"#hasSpecialIDFilters"query":"bool":"must":["terms":"mySpecialID":[#joinmySpecialIDFilters/join]],/hasSpecialIDFilters"sort":["mySortingField":"desc"]"
When I try to render the template:
POST _render/template/my-special-template
I get the following error:
"error":
"root_cause": [
"type": "general_script_exception",
"reason": "Failed to compile stored script [my-special-template] using lang [mustache]"
],
"type": "general_script_exception",
"reason": "Failed to compile stored script [my-special-template] using lang [mustache]",
"caused_by":
"type": "mustache_exception",
"reason": "Improperly closed variable in query-template:1"
,
"status": 500
If I remove the #hasSpecialIDFilters
and /hasSpecialIDFilters
lines, the template renders fine, but I use that value as a boolean to dictate whether I should include the terms array bool query within. I am not sure why this is an issue, since everything looks syntactically correct.
A workaround for me would be to just maintain two separate templates, one requiring the mySpecialIDFilters
array, and one without it, with my calling code dictating which one to call, but I'd rather have it within one template.
Does anyone have any ideas what might be the issue?
Thanks in advance!
elasticsearch
add a comment |
I have the following template I am trying to use on Elasticsearch 6.6.2:
#hasSpecialIDFilters
"query":
"bool":
"must": [
"terms":
"mySpecialID": [#joinmySpecialIDFilters/join]
]
,
/hasSpecialIDFilters
"sort": [
"mySortingField": "desc"
]
I have a Java application that transforms this template to be part of a RESTful request body and sends it to my cluster. I should note that I have other templates that run through this system with no issue. The resulting request is:
"script":
"lang": "mustache",
"source":"#hasSpecialIDFilters"query":"bool":"must":["terms":"mySpecialID":[#joinmySpecialIDFilters/join]],/hasSpecialIDFilters"sort":["mySortingField":"desc"]"
When I try to render the template:
POST _render/template/my-special-template
I get the following error:
"error":
"root_cause": [
"type": "general_script_exception",
"reason": "Failed to compile stored script [my-special-template] using lang [mustache]"
],
"type": "general_script_exception",
"reason": "Failed to compile stored script [my-special-template] using lang [mustache]",
"caused_by":
"type": "mustache_exception",
"reason": "Improperly closed variable in query-template:1"
,
"status": 500
If I remove the #hasSpecialIDFilters
and /hasSpecialIDFilters
lines, the template renders fine, but I use that value as a boolean to dictate whether I should include the terms array bool query within. I am not sure why this is an issue, since everything looks syntactically correct.
A workaround for me would be to just maintain two separate templates, one requiring the mySpecialIDFilters
array, and one without it, with my calling code dictating which one to call, but I'd rather have it within one template.
Does anyone have any ideas what might be the issue?
Thanks in advance!
elasticsearch
I have the following template I am trying to use on Elasticsearch 6.6.2:
#hasSpecialIDFilters
"query":
"bool":
"must": [
"terms":
"mySpecialID": [#joinmySpecialIDFilters/join]
]
,
/hasSpecialIDFilters
"sort": [
"mySortingField": "desc"
]
I have a Java application that transforms this template to be part of a RESTful request body and sends it to my cluster. I should note that I have other templates that run through this system with no issue. The resulting request is:
"script":
"lang": "mustache",
"source":"#hasSpecialIDFilters"query":"bool":"must":["terms":"mySpecialID":[#joinmySpecialIDFilters/join]],/hasSpecialIDFilters"sort":["mySortingField":"desc"]"
When I try to render the template:
POST _render/template/my-special-template
I get the following error:
"error":
"root_cause": [
"type": "general_script_exception",
"reason": "Failed to compile stored script [my-special-template] using lang [mustache]"
],
"type": "general_script_exception",
"reason": "Failed to compile stored script [my-special-template] using lang [mustache]",
"caused_by":
"type": "mustache_exception",
"reason": "Improperly closed variable in query-template:1"
,
"status": 500
If I remove the #hasSpecialIDFilters
and /hasSpecialIDFilters
lines, the template renders fine, but I use that value as a boolean to dictate whether I should include the terms array bool query within. I am not sure why this is an issue, since everything looks syntactically correct.
A workaround for me would be to just maintain two separate templates, one requiring the mySpecialIDFilters
array, and one without it, with my calling code dictating which one to call, but I'd rather have it within one template.
Does anyone have any ideas what might be the issue?
Thanks in advance!
elasticsearch
elasticsearch
asked Mar 27 at 20:15
ryanlutgenryanlutgen
1,9431 gold badge15 silver badges24 bronze badges
1,9431 gold badge15 silver badges24 bronze badges
add a comment |
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55385735%2felasticsearch-search-template-resulting-in-improperly-closed-variable-when-try%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.
Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55385735%2felasticsearch-search-template-resulting-in-improperly-closed-variable-when-try%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown