ElasticSearch Research & Evidence-Based Practice 3 — Questions and Answers
Question 1: A research platform needs to implement peer review scoring where each reviewer scores a paper from 1-10. Which Elasticsearch aggregation computes the average score across all reviews for a paper?
- stats aggregation
- avg aggregation (Correct answer)
- sum aggregation
- extended_stats aggregation
Correct answer: avg aggregation
The avg aggregation computes the arithmetic mean of numeric field values across matching documents, making it ideal for average review scores.
Question 2: An evidence repository indexes documents from multiple languages. Researchers need to search English and Spanish content simultaneously using language-specific analyzers. Which mapping approach supports this?
- Store all content in one field with the standard analyzer
- Use multi-fields with language-specific analyzers per language variant (Correct answer)
- Use a single custom analyzer combining both language token filters
- Index each language in a separate index and use a cross-cluster search
Correct answer: Use multi-fields with language-specific analyzers per language variant
Multi-fields allow the same content to be analyzed multiple ways, enabling language-specific subfields (e.g., content.en, content.es) with appropriate analyzers.
Question 3: A researcher uses Elasticsearch to power a citation graph. They need to find all documents that cite a specific paper (paper ID = 'A123'). Which query should they use?
- match query on citations field with value 'A123'
- term query on citations field with value 'A123' (Correct answer)
- fuzzy query on citations field
- prefix query on citations field
Correct answer: term query on citations field with value 'A123'
The term query performs an exact, keyword-level match without analysis, which is correct for matching a precise document ID in a citations array.
Question 4: Research data indexed with a daily date_histogram shows sparse days with zero publications. Which date_histogram parameter ensures empty buckets are included in the response?
- min_doc_count: 0 with extended_bounds (Correct answer)
- size: 0 in the aggregation
- missing parameter set to 0
- keyed: true parameter
Correct answer: min_doc_count: 0 with extended_bounds
Setting min_doc_count: 0 combined with extended_bounds forces Elasticsearch to return buckets even when no documents fall in that interval.
Question 5: A scientific search engine needs to suggest corrections for misspelled medical terms (e.g., 'diabetis' → 'diabetes'). Which Elasticsearch feature handles this?
- term suggester (Correct answer)
- phrase suggester
- completion suggester
- context suggester
Correct answer: term suggester
The term suggester uses edit distance to propose corrections for individual misspelled words, making it suitable for fixing typos in search queries.
Question 6: A research index needs to support faceted navigation by study type, year, and country simultaneously. Queries must not affect each other's facet counts. Which approach achieves this?
- Use separate indices for each facet
- Use post_filter combined with global aggregations (Correct answer)
- Use nested aggregations with sub-aggregations
- Use collapse field on each facet
Correct answer: Use post_filter combined with global aggregations
post_filter narrows search hits without affecting aggregations; pairing it with global aggregations produces unfiltered facet counts regardless of active filters.
Question 7: Researchers need to detect outlier studies where the effect size is in the top 5th percentile of the dataset. Which aggregation provides this insight?
- avg aggregation
- percentiles aggregation with percents:[95] (Correct answer)
- histogram aggregation
- max aggregation
Correct answer: percentiles aggregation with percents:[95]
The percentiles aggregation computes requested quantile thresholds, so requesting the 95th percentile identifies the effect size value above which the top 5% of studies fall.
A research platform needs to implement peer review scoring where each reviewer scores a paper from 1-10.
Which Elasticsearch aggregation computes the average score across all reviews for a paper?