Complete the code to enable query cache in Elasticsearch.
{
"query": {
"match_all": {}
},
"[1]": true
}The query_cache setting enables caching of query results in Elasticsearch.
Complete the code to enable request cache for a search request.
{
"size": 10,
"query": {
"term": { "user": "kimchy" }
},
"[1]": true
}The request_cache setting enables caching of the entire search request response.
Fix the error in the field data cache setting to enable it correctly.
{
"fielddata": {
"[1]": true
}
}The correct setting to enable field data cache is enable inside the fielddata object.
Fill both blanks to create a query that uses request cache and disables query cache.
{
"query": {
"match": { "title": "Elasticsearch" }
},
"[1]": false,
"[2]": true
}Setting query_cache to false disables query caching, while setting request_cache to true enables request caching.
Fill all three blanks to create a dictionary comprehension that caches field lengths greater than 5.
{
"field_lengths_cache": {
"lengths": {word: len(word) for word in words if len(word) [1] [2],
"[3]": true
}
}The comprehension filters words with length greater than 5 using > and 5. The cache is enabled with cache_enabled.