0
0
Elasticsearchquery~20 mins

Cross-cluster search in Elasticsearch - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Cross-Cluster Search Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
Predict Output
intermediate
2:00remaining
Output of a basic cross-cluster search query
What is the output of the following Elasticsearch cross-cluster search query when searching for documents with status:active across two clusters named clusterA and clusterB?
Elasticsearch
GET clusterA:logs-2023,clusterB:logs-2023/_search
{
  "query": {
    "term": { "status": "active" }
  }
}
ARaises an error because cross-cluster search requires a special plugin
BReturns documents only from clusterA because clusterB is not included in the query
CReturns documents from clusterB only because clusterA is ignored in cross-cluster search
DReturns all documents with status 'active' from both clusterA and clusterB indices named logs-2023
Attempts:
2 left
💡 Hint
Cross-cluster search allows querying multiple clusters by prefixing the index name with the cluster alias.
🧠 Conceptual
intermediate
1:30remaining
Understanding remote cluster configuration
Which statement correctly describes how to configure a remote cluster for cross-cluster search in Elasticsearch?
AYou must add the remote cluster's seed nodes in the local cluster's settings under <code>cluster.remote.<cluster_name>.seeds</code>
BRemote clusters are automatically discovered without any configuration
CYou need to install a plugin on both clusters to enable remote cluster communication
DRemote clusters must share the same cluster name to be searchable
Attempts:
2 left
💡 Hint
Think about how the local cluster knows where to find the remote cluster nodes.
🔧 Debug
advanced
2:00remaining
Identify the error in cross-cluster search query
Given the following cross-cluster search query, what error will Elasticsearch return?
Elasticsearch
GET clusterX:logs-2023/_search
{
  "query": {
    "match": { "message": "error" }
  }
}
A"No such remote cluster [clusterX]" error because clusterX is not configured
BSyntaxError due to missing curly braces around the query
CReturns empty results because no documents contain 'error' in message
DTimeout error because cross-cluster search is disabled by default
Attempts:
2 left
💡 Hint
Check if the remote cluster alias is configured in the local cluster.
📝 Syntax
advanced
1:30remaining
Correct syntax for cross-cluster search index pattern
Which option shows the correct syntax to search across indices named logs-2023 in remote clusters east and west simultaneously?
AGET logs-2023@east,logs-2023@west/_search
BGET east:logs-2023,west:logs-2023/_search
CGET logs-2023:east,logs-2023:west/_search
DGET east.logs-2023,west.logs-2023/_search
Attempts:
2 left
💡 Hint
Remember the format is cluster_alias:index_name.
🚀 Application
expert
2:30remaining
Result count from cross-cluster search with filters
You run this cross-cluster search query to count documents with status:failed in clusters alpha and beta. Cluster alpha has 5 matching documents, beta has 3. What is the value of hits.total.value in the response?
Elasticsearch
GET alpha:app-logs,beta:app-logs/_search
{
  "query": {
    "term": { "status": "failed" }
  }
}
A5
B3
C8
D0
Attempts:
2 left
💡 Hint
Cross-cluster search merges results from all targeted clusters.