percolator field called queryquery fieldJump into concepts and practice - no test required
percolator field called queryquery fieldnews_queries with a mapping that has a query field of type percolator and a content field of type text.Use the PUT method to create an index with a mapping. The query field must be of type percolator.
news_queries index. Use document IDs 1 and 2. The first query should match documents containing the word sports in content. The second query should match documents containing the word politics in content. Store these queries in the query field.Use PUT /news_queries/_doc/1 and PUT /news_queries/_doc/2 to index the saved queries. The queries go inside the query field.
news_articles with ID 1. The document should have a content field with the text: Latest sports update from the championship.Create a new index news_articles and add a document with the given content.
news_queries index using a percolate query. The query should check which saved queries match the document with content: Latest sports update from the championship. Print the IDs of matching saved queries.Use a percolate query in the search body on news_queries to find matching saved queries.
What is the main purpose of a percolate query in Elasticsearch?
Which mapping type must be included in an Elasticsearch index to use percolate queries?
{
"mappings": {
"properties": {
"query": {
"type": "???"
}
}
}
}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".
Identify the error in this percolate query:
{
"query": {
"percolate": {
"field": "query"
"document": {
"content": "Test document"
}
}
}
}You want to build an alert system that triggers when new documents match any stored queries. Which steps are necessary to implement this using percolate queries?