Recall & Review
beginner
What is a multi-match query in Elasticsearch?
A multi-match query lets you search for a text across multiple fields in your documents at once. It helps find matches in any of the specified fields.
Click to reveal answer
beginner
Which parameter specifies the fields to search in a multi-match query?
The
fields parameter lists the fields where Elasticsearch will look for the search text.Click to reveal answer
intermediate
What does the
type option in a multi-match query control?The
type option controls how the query matches text across fields, like best_fields (default), most_fields, cross_fields, phrase, or phrase_prefix.Click to reveal answer
intermediate
How does the
operator parameter affect a multi-match query?The
operator parameter decides if all words must match (and) or if any word can match (or) in the search text.Click to reveal answer
beginner
Give an example of a simple multi-match query searching for 'apple' in fields 'title' and 'description'.
{
"query": {
"multi_match": {
"query": "apple",
"fields": ["title", "description"]
}
}
}
Click to reveal answer
What does a multi-match query do in Elasticsearch?
✗ Incorrect
A multi-match query searches for the given text across multiple fields in the documents.
Which parameter lists the fields to search in a multi-match query?
✗ Incorrect
The 'fields' parameter specifies which fields to search in.
What is the default
type for a multi-match query?✗ Incorrect
The default type is 'best_fields', which finds the single best matching field.
If you want all words in the query to match, which operator should you use?
✗ Incorrect
The 'and' operator requires all words to match in the fields.
Which multi-match type treats multiple fields as one combined field for matching?
✗ Incorrect
The 'cross_fields' type treats fields as one combined field to match terms.
Explain how a multi-match query works and when you would use it.
Think about searching a book by title and author at the same time.
You got /4 concepts.
Describe the difference between 'best_fields' and 'cross_fields' types in a multi-match query.
Imagine searching for a phrase split across two fields.
You got /3 concepts.