0
0
Elasticsearchquery~10 mins

Why performance tuning handles growth in Elasticsearch - Test Your Understanding

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to set the number of shards for an index.

Elasticsearch
PUT /my_index
{
  "settings": {
    "number_of_shards": [1]
  }
}
Drag options to blanks, or click blank then click option'
A5
B3
C1
D0
Attempts:
3 left
💡 Hint
Common Mistakes
Setting number_of_shards to 0 causes errors.
Using too many shards can reduce performance.
2fill in blank
medium

Complete the code to update the refresh interval for better indexing performance.

Elasticsearch
PUT /my_index/_settings
{
  "index": {
    "refresh_interval": [1]
  }
}
Drag options to blanks, or click blank then click option'
A"-1"
B"30s"
C"1s"
D"0s"
Attempts:
3 left
💡 Hint
Common Mistakes
Using "0s" is invalid.
Setting refresh_interval too low can hurt indexing speed.
3fill in blank
hard

Fix the error in the query to filter documents by a field value.

Elasticsearch
{
  "query": {
    "term": {
      "status": [1]
    }
  }
}
Drag options to blanks, or click blank then click option'
A"active"
Btrue
C"status"
Dactive
Attempts:
3 left
💡 Hint
Common Mistakes
Omitting quotes around string values.
Using field names instead of values.
4fill in blank
hard

Fill both blanks to create a range query filtering documents with age greater than 30.

Elasticsearch
{
  "query": {
    "range": {
      "age": {
        "[1]": [2]
      }
    }
  }
}
Drag options to blanks, or click blank then click option'
Agt
B30
Cgte
D25
Attempts:
3 left
💡 Hint
Common Mistakes
Using "gte" includes 30, not strictly greater.
Putting the number in quotes causes errors.
5fill in blank
hard

Fill all three blanks to create an aggregation that counts documents per status where count is greater than 5.

Elasticsearch
{
  "aggs": {
    "status_count": {
      "terms": {
        "field": "[1]"
      },
      "aggs": {
        "filtered_count": {
          "bucket_selector": {
            "buckets_path": {
              "count": "_count"
            },
            "script": "params.count [2] [3]"
          }
        }
      }
    }
  }
}
Drag options to blanks, or click blank then click option'
Astatus
B>
C5
Dcount
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong field name.
Using >= instead of >.
Putting numbers in quotes in script.