Bird
Raised Fist0

Given the following percolate query, what will it return?

medium📝 Predict Output Q13 of Q15
Elasticsearch - Advanced Patterns

Given the following percolate query, what will it return?

{
  "query": {
    "percolate": {
      "field": "query",
      "document": {
        "message": "Elasticsearch alerting"
      }
    }
  }
}

Assuming the index has stored queries matching documents containing "alerting".

ADocuments containing the word "alerting"
BAn error because "document" is missing an ID
CAll documents in the index
DStored queries that match the document with message "Elasticsearch alerting"
Step-by-Step Solution
Solution:
  1. Step 1: Understand percolate query behavior

    The percolate query matches stored queries against the provided document, returning matching stored queries.
  2. Step 2: Analyze the given query

    The query uses "document" with a message field; it will find stored queries matching this document's content.
  3. Final Answer:

    Stored queries that match the document with message "Elasticsearch alerting" -> Option D
  4. Quick Check:

    Percolate query returns matching stored queries [OK]
Quick Trick: Percolate queries return stored queries matching the input document [OK]
Common Mistakes:
MISTAKES
  • Thinking it returns documents instead of queries
  • Assuming document ID is required for percolate query
  • Confusing percolate with regular search

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Elasticsearch Quizzes