Created
October 31, 2014 18:04
-
-
Save lukas-vlcek/56540a7e8206d122d55c to your computer and use it in GitHub Desktop.
Search Template with Sections?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## This works: | |
curl -X GET 'localhost:9200/_search/template' -d '{ | |
"template" : "{ \"size\": \"{{size}}\", \"query\":{\"match_all\":{}}}", | |
"params":{ | |
"size":1, | |
"use_size": false | |
} | |
}' | |
## Let's just add {{#use_size}} ... {{/use_size}} around "size" parameter. | |
curl -X GET 'localhost:9200/_search/template' -d '{ | |
"template" : "{ {{#use_size}} \"size\": \"{{size}}\", {{/use_size}} \"query\":{\"match_all\":{}}}", | |
"params":{ | |
"size":1, | |
"use_size": false | |
} | |
}' | |
{"error":"SearchPhaseExecutionException[Failed to execute phase [query], all shards failed; shardFailures {[ccMkzywSSfi-4ttibpHh9w][twitter][3]: ElasticsearchParseException[Failed to parse template]; nested: JsonParseException[Unexpected character ('{' (code 123)): was expecting either valid name character (for unquoted name) or double-quote (for quoted) to start field name\n at [Source: [B@2307886c; line: 1, column: 4]]; }{[ccMkzywSSfi-4ttibpHh9w][twitter][4]: ElasticsearchParseException[Failed to parse template]; nested: JsonParseException[Unexpected character ('{' (code 123)): was expecting either valid name character (for unquoted name) or double-quote (for quoted) to start field name\n at [Source: [B@438d7c6b; line: 1, column: 4]]; }{[ccMkzywSSfi-4ttibpHh9w][twitter][0]: ElasticsearchParseException[Failed to parse template]; nested: JsonParseException[Unexpected character ('{' (code 123)): was expecting either valid name character (for unquoted name) or double-quote (for quoted) to start field name\n at [Source: [B@bae166c; line: 1, column: 4]]; }{[ccMkzywSSfi-4ttibpHh9w][twitter][2]: ElasticsearchParseException[Failed to parse template]; nested: JsonParseException[Unexpected character ('{' (code 123)): was expecting either valid name character (for unquoted name) or double-quote (for quoted) to start field name\n at [Source: [B@52421271; line: 1, column: 4]]; }{[ccMkzywSSfi-4ttibpHh9w][twitter][1]: ElasticsearchParseException[Failed to parse template]; nested: JsonParseException[Unexpected character ('{' (code 123)): was expecting either valid name character (for unquoted name) or double-quote (for quoted) to start field name\n at [Source: [B@6fc8e2e7; line: 1, column: 4]]; }]","status":400} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment