0
0
Elasticsearchquery~10 mins

Percolate queries (reverse search) in Elasticsearch - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to define a percolator field in the mapping.

Elasticsearch
{
  "mappings": {
    "properties": {
      "query": {
        "type": "[1]"
      }
    }
  }
}
Drag options to blanks, or click blank then click option'
Apercolator
Btext
Ckeyword
Dnested
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'text' or 'keyword' instead of 'percolator' for the query field type.
2fill in blank
medium

Complete the code to register a percolate query document.

Elasticsearch
{
  "query": {
    "match": {
      "message": "[1]"
    }
  }
}
Drag options to blanks, or click blank then click option'
Aerror
Bdebug
Cinfo
Dwarning
Attempts:
3 left
💡 Hint
Common Mistakes
Using a log level not matching the example or the intended query.
3fill in blank
hard

Fix the error in the percolate query to match documents with 'error' in the 'message' field.

Elasticsearch
{
  "query": {
    "percolate": {
      "field": "query",
      "document": {
        "message": "[1]"
      }
    }
  }
}
Drag options to blanks, or click blank then click option'
Awarn
Berror
Cinfo
Ddebug
Attempts:
3 left
💡 Hint
Common Mistakes
Using a different log level word that does not match registered queries.
4fill in blank
hard

Fill both blanks to create a percolate query that matches documents with 'timeout' in the 'message' field and uses the correct percolator field.

Elasticsearch
{
  "query": {
    "percolate": {
      "field": "[1]",
      "document": {
        "message": "[2]"
      }
    }
  }
}
Drag options to blanks, or click blank then click option'
Aquery
Bmessage
Ctimeout
Derror
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'message' as the percolator field name instead of 'query'.
Using the wrong keyword in the document message.
5fill in blank
hard

Fill all three blanks to create a percolate query that matches documents with 'failure' in the 'message' field, using the correct percolator field and query type.

Elasticsearch
{
  "query": {
    "[1]": {
      "field": "[2]",
      "document": {
        "message": "[3]"
      }
    }
  }
}
Drag options to blanks, or click blank then click option'
Apercolate
Bquery
Cfailure
Dmatch
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'match' instead of 'percolate' as the query type.
Using the wrong field name for the percolator.
Using a different keyword than 'failure' in the document message.