0
0
Elasticsearchquery~10 mins

Pagination (from/size) in Elasticsearch - Interactive Code Practice

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

Complete the code to set the starting point for pagination in Elasticsearch.

Elasticsearch
{
  "from": [1],
  "size": 10
}
Drag options to blanks, or click blank then click option'
A0
B10
C5
D20
Attempts:
3 left
💡 Hint
Common Mistakes
Using 1 instead of 0 for the first result index.
Confusing from with size.
2fill in blank
medium

Complete the code to set the number of results per page in Elasticsearch.

Elasticsearch
{
  "from": 0,
  "size": [1]
}
Drag options to blanks, or click blank then click option'
A20
B10
C15
D5
Attempts:
3 left
💡 Hint
Common Mistakes
Setting size to 0 or a negative number.
Confusing size with from.
3fill in blank
hard

Fix the error in the pagination code to correctly get the second page with 10 results per page.

Elasticsearch
{
  "from": [1],
  "size": 10
}
Drag options to blanks, or click blank then click option'
A10
B20
C1
D0
Attempts:
3 left
💡 Hint
Common Mistakes
Using 1 instead of 10 for the second page.
Setting from to 0 for the second page.
4fill in blank
hard

Fill both blanks to get the third page with 15 results per page.

Elasticsearch
{
  "from": [1],
  "size": [2]
}
Drag options to blanks, or click blank then click option'
A30
B15
C10
D20
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up from and size values.
Using incorrect multiplication for from.
5fill in blank
hard

Fill all three blanks to get the fourth page with 20 results per page and start from the correct offset.

Elasticsearch
{
  "from": [1],
  "size": [2],
  "query": {
    "match_all": [3]
  }
}
Drag options to blanks, or click blank then click option'
A60
B20
C{}
D40
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong from value for the page.
Setting match_all to null or missing braces.