Amazon Elasticsearch Service is a powerful, scalable search engine built on Apache Lucene. Chapter 3 explores essential concepts like full-text search, Query DSL, index templates, and advanced search techniques such as fuzzy search and suggestions. This set of MCQs will help you deepen your knowledge and prepare for real-world Elasticsearch challenges.
Multiple-Choice Questions (MCQs)
Basics of Full-Text Search
Full-text search in Elasticsearch is designed to: a) Store data in structured formats b) Retrieve exact matches for queries c) Search and retrieve documents based on relevance d) Perform basic keyword searches only
In Elasticsearch, which of the following is used to analyze a field during indexing? a) Analyzer b) Tokenizer c) Aggregation d) Filter
Which of the following is an advantage of using full-text search in Elasticsearch? a) Faster retrieval of structured data b) Better handling of fuzzy queries and relevance scoring c) Efficient database joins d) Limited to exact phrase searches
What happens when Elasticsearch performs full-text search on analyzed text? a) It searches based on the original text b) It uses tokenization and indexing for efficiency c) It ignores stop words d) It returns exact matches
Which is a common tokenizer used in Elasticsearch for text analysis? a) Standard tokenizer b) Wildcard tokenizer c) Date tokenizer d) Term tokenizer
Query DSL: Filters, Queries, and Aggregations
What is the purpose of using filters in Elasticsearch queries? a) To rank results based on relevance b) To limit the scope of data returned c) To calculate field values d) To perform complex joins
In Query DSL, which type of query is used to search for a term within a field? a) Match query b) Term query c) Range query d) Fuzzy query
Aggregations in Elasticsearch are used to: a) Sort data in ascending order b) Perform calculations on data and group results c) Analyze data trends over time d) Retrieve exact field matches
What is the difference between a query and a filter in Elasticsearch? a) Queries score results based on relevance, filters do not b) Queries sort the data, filters do not c) Filters allow fuzzy matching, queries do not d) Filters are used for aggregations, queries are not
Which of the following is an example of an aggregation type in Elasticsearch? a) Range aggregation b) Match aggregation c) Term aggregation d) Filter aggregation
Creating and Managing Index Templates
An index template in Elasticsearch is used to: a) Define the structure and settings for indices b) Create backups of data c) Automatically query data d) Perform fuzzy searches on indexes
Which of the following is required to create an index template? a) A query DSL b) A predefined index pattern c) A tokenized field d) A mapping configuration
In Elasticsearch, which operation is used to apply an index template to newly created indices? a) PUT request b) POST request c) DELETE request d) GET request
What happens when an index template is applied? a) It merges settings with existing templates b) It changes the index structure c) It defines index settings and mappings for new indices d) It filters the indexed data
Which of the following is true about index templates in Elasticsearch? a) They are only applied to existing indices b) They are automatically applied to all indices c) They cannot be used with filters d) They define rules for index mappings and settings
Sorting, Filtering, and Pagination
When performing sorting in Elasticsearch, which of the following is true? a) Sorting is always ascending b) Sorting requires a custom query language c) Sorting can be done by field value or relevance score d) Sorting is not supported in Elasticsearch
Which query type is typically used to filter out documents based on specific criteria? a) Match query b) Term query c) Range query d) Filter query
In Elasticsearch, how is pagination typically achieved? a) Using the size and from parameters b) By splitting data into separate indices c) By applying multiple aggregations d) Using the limit keyword
What is the result of setting a high value for the “from” parameter in a query? a) The query will return more results b) The query will be slower to execute c) The query will ignore filters d) The query will be faster to execute
In Elasticsearch, which of the following filters would you use to include only documents within a specific range of values? a) Term filter b) Range filter c) Match filter d) Exists filter
Fuzzy search in Elasticsearch is useful for: a) Searching for exact matches b) Matching documents with small typos or variations c) Searching through date ranges d) Filtering by document type
The fuzziness parameter in Elasticsearch is used to: a) Control the number of documents returned b) Define how many errors are tolerated in a match c) Sort results by relevance d) Specify the range of query terms
Suggestions in Elasticsearch are primarily used for: a) Finding related documents b) Providing autocomplete results or spelling corrections c) Aggregating data over time d) Sorting documents by date
Which query in Elasticsearch is used for fuzzy matching of a term? a) Match query b) Term query c) Fuzzy query d) Prefix query
Which of the following would be an appropriate use case for Elasticsearch’s fuzzy search? a) Searching for misspelled terms or typos b) Querying for exact document identifiers c) Aggregating search results d) Filtering documents by date
Handling Multilingual and Analyzed Data
When handling multilingual data, Elasticsearch provides support for: a) Automatically translating documents b) Using different analyzers based on language c) Storing data in multiple formats d) Sorting documents by language
What is the role of an analyzer in Elasticsearch when handling multilingual data? a) It is used to store data b) It tokenizes and normalizes text based on language c) It sorts documents by relevance d) It performs data transformations
To ensure proper text analysis for multilingual data, you should: a) Use a single default analyzer for all languages b) Define language-specific analyzers in the index mappings c) Only store data in one language d) Disable text analysis
What happens if the wrong analyzer is used for a multilingual field in Elasticsearch? a) It may result in poor search performance and incorrect results b) It will cause the index to fail c) It will automatically select a different analyzer d) It will filter out irrelevant documents
In Elasticsearch, which type of field should be used for multilingual data to ensure compatibility with different analyzers? a) Keyword field b) Text field c) Integer field d) Date field
Answers
QNo
Answer
1
c) Search and retrieve documents based on relevance
2
a) Analyzer
3
b) Better handling of fuzzy queries and relevance scoring
4
b) It uses tokenization and indexing for efficiency
5
a) Standard tokenizer
6
b) To limit the scope of data returned
7
b) Term query
8
b) Perform calculations on data and group results
9
a) Queries score results based on relevance, filters do not
10
a) Range aggregation
11
a) Define the structure and settings for indices
12
b) A predefined index pattern
13
a) PUT request
14
c) It defines index settings and mappings for new indices
15
d) They define rules for index mappings and settings
16
c) Sorting can be done by field value or relevance score
17
b) Term query
18
a) Using the size and from parameters
19
b) The query will be slower to execute
20
b) Range filter
21
b) Matching documents with small typos or variations
22
b) Define how many errors are tolerated in a match
23
b) Providing autocomplete results or spelling corrections
24
c) Fuzzy query
25
a) Searching for misspelled terms or typos
26
b) Using different analyzers based on language
27
b) It tokenizes and normalizes text based on language
28
b) Define language-specific analyzers in the index mappings
29
a) It may result in poor search performance and incorrect results