Recall & Review
beginner
What is a wildcard query in Elasticsearch?
A wildcard query searches for terms that match a pattern with special characters like
* (matches any number of characters) and ? (matches a single character). It helps find words with unknown parts.Click to reveal answer
beginner
How does a prefix query work in Elasticsearch?
A prefix query finds documents where a field's value starts with a specified string. It is like searching for all words beginning with a certain prefix.
Click to reveal answer
beginner
Which wildcard characters are used in Elasticsearch wildcard queries?
The two main wildcard characters are
* which matches zero or more characters, and ? which matches exactly one character.Click to reveal answer
intermediate
What is a key difference between wildcard and prefix queries?
Wildcard queries allow patterns anywhere in the word using
* and ?, while prefix queries only match the beginning of a word with a fixed string.Click to reveal answer
intermediate
Why should wildcard queries be used carefully in Elasticsearch?
Wildcard queries can be slow and resource-heavy because they scan many terms. Using them on large datasets or with leading wildcards (like
*abc) can hurt performance.Click to reveal answer
Which wildcard character matches exactly one character in Elasticsearch?
✗ Incorrect
The
? character matches exactly one character, while * matches zero or more characters.What does a prefix query in Elasticsearch do?
✗ Incorrect
Prefix queries find words that start with the given string.
Which query is generally faster on large datasets?
✗ Incorrect
Prefix queries are faster because they only match the start of terms, while wildcard queries can scan many terms.
Which wildcard query pattern is considered bad for performance?
✗ Incorrect
Leading wildcards like
*abc cause Elasticsearch to scan many terms, slowing down the search.In Elasticsearch, which query would you use to find all documents where a field starts with 'pre'?
✗ Incorrect
Prefix query with value 'pre' efficiently finds all terms starting with 'pre'.
Explain how wildcard and prefix queries differ in Elasticsearch and when you might use each.
Think about how flexible the search pattern is and performance.
You got /4 concepts.
Describe the performance considerations when using wildcard queries in Elasticsearch.
Consider how Elasticsearch searches terms internally.
You got /4 concepts.