Complete the code to define a percolator field in the mapping.
{
"mappings": {
"properties": {
"query": {
"type": "[1]"
}
}
}
}The percolator field type is used to store queries for reverse search in Elasticsearch.
Complete the code to register a percolate query document.
{
"query": {
"match": {
"message": "[1]"
}
}
}The example query matches documents where the 'message' field contains the word 'warning'.
Fix the error in the percolate query to match documents with 'error' in the 'message' field.
{
"query": {
"percolate": {
"field": "query",
"document": {
"message": "[1]"
}
}
}
}The document field 'message' should contain 'error' to match the percolate queries registered for that term.
Fill both blanks to create a percolate query that matches documents with 'timeout' in the 'message' field and uses the correct percolator field.
{
"query": {
"percolate": {
"field": "[1]",
"document": {
"message": "[2]"
}
}
}
}The percolate field is named 'query', and the document message contains 'timeout' to match relevant queries.
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.
{
"query": {
"[1]": {
"field": "[2]",
"document": {
"message": "[3]"
}
}
}
}The query type is 'percolate', the field is 'query', and the document message contains 'failure' to match registered queries.