ElasticSearch Technology & Digital Applications 4 — Questions and Answers
Question 1: What is the purpose of the Elasticsearch 'shrink' API?
- To reduce the number of replicas on an index
- To reduce the number of primary shards in an index (Correct answer)
- To compress index data on disk
- To merge multiple indices into one
Correct answer: To reduce the number of primary shards in an index
The shrink API allows you to reduce the number of primary shards in an index, useful for optimizing indices that have grown past their initial shard requirements.
Question 2: In Elasticsearch, what is a 'nested' field type used for?
- Storing deeply compressed binary data
- Indexing arrays of objects while preserving inner object relationships (Correct answer)
- Creating parent-child relationships across separate indices
- Defining multi-level routing keys
Correct answer: Indexing arrays of objects while preserving inner object relationships
Nested fields allow arrays of objects to be indexed independently, preserving the relationship between fields within each object for accurate querying.
Question 3: What does the 'profile' API in Elasticsearch help with?
- User authentication profiling
- Detailed timing breakdown of query and aggregation execution (Correct answer)
- Index-level performance benchmarking
- Cluster resource usage reporting
Correct answer: Detailed timing breakdown of query and aggregation execution
The profile API provides detailed timing information about how each component of a search query and its aggregations executed, helping identify bottlenecks.
Question 4: Which Elasticsearch mechanism allows you to automatically enrich documents at index time using data from another index?
- Pipeline processors
- Ingest enrichment processor (Correct answer)
- Cross-cluster replication
- Index aliases with filters
Correct answer: Ingest enrichment processor
The enrich processor in an ingest pipeline looks up matching documents in an enrich index and adds that data to incoming documents at index time.
Question 5: What is the difference between 'filter' context and 'query' context in Elasticsearch?
- Filter context limits result count, query context does not
- Query context scores documents for relevance; filter context does not score and is cacheable (Correct answer)
- Filter context runs before indexing; query context runs at search time
- There is no functional difference; they are interchangeable
Correct answer: Query context scores documents for relevance; filter context does not score and is cacheable
Query context contributes to relevance scoring, while filter context only determines inclusion/exclusion and results are cached for better performance.
Question 6: In Elasticsearch, what does the 'fielddata' setting enable on text fields?
- Full-text search on keyword fields
- Sorting and aggregations on analyzed text fields by loading data into heap memory (Correct answer)
- Faster indexing by caching incoming documents
- Automatic field type detection during indexing
Correct answer: Sorting and aggregations on analyzed text fields by loading data into heap memory
Fielddata enables sorting and aggregations on text fields by loading the entire field's data into heap memory, which can be memory-intensive.
Question 7: What is 'cross-cluster replication' (CCR) in Elasticsearch used for?
- Balancing shards within a single cluster
- Replicating indices from one cluster to another for DR or geo-distribution (Correct answer)
- Synchronizing ILM policies across nodes
- Merging data from multiple indices into one
Correct answer: Replicating indices from one cluster to another for DR or geo-distribution
CCR replicates indices from a leader cluster to a follower cluster, enabling disaster recovery, geo-proximity reads, and data centralization use cases.
What is the purpose of the Elasticsearch 'shrink' API?