* Add index pages and reorganize content for header clickability Signed-off-by: Fanit Kolchina <kolchfa@amazon.com> * Apply suggestions from code review Co-authored-by: Melissa Vagi <vagimeli@amazon.com> * Implemented doc review comments Signed-off-by: Fanit Kolchina <kolchfa@amazon.com> * Punctuation fix Signed-off-by: Fanit Kolchina <kolchfa@amazon.com> * Renamed to creating and tuning cluster Signed-off-by: Fanit Kolchina <kolchfa@amazon.com> * Content planning dashboards index page Signed-off-by: vagimeli <vagimeli@amazon.com> * Add Dashboards index page Signed-off-by: vagimeli <vagimeli@amazon.com> * Add Dashboards index page Signed-off-by: vagimeli <vagimeli@amazon.com> * Add Dashboards index Signed-off-by: vagimeli <vagimeli@amazon.com> * Update _dashboards/index.md Co-authored-by: Heather Halter <HDHALTER@AMAZON.COM> Signed-off-by: Melissa Vagi <vagimeli@amazon.com> * Address doc feedback Signed-off-by: vagimeli <vagimeli@amazon.com> * Apply suggestions from code review Co-authored-by: Nathan Bower <nbower@amazon.com> Signed-off-by: kolchfa-aws <105444904+kolchfa-aws@users.noreply.github.com> * Implemented editorial comments Signed-off-by: Fanit Kolchina <kolchfa@amazon.com> * Link fix Signed-off-by: Fanit Kolchina <kolchfa@amazon.com> --------- Signed-off-by: Fanit Kolchina <kolchfa@amazon.com> Signed-off-by: vagimeli <vagimeli@amazon.com> Signed-off-by: Melissa Vagi <vagimeli@amazon.com> Signed-off-by: kolchfa-aws <105444904+kolchfa-aws@users.noreply.github.com> Co-authored-by: Melissa Vagi <vagimeli@amazon.com> Co-authored-by: Heather Halter <HDHALTER@AMAZON.COM> Co-authored-by: Nathan Bower <nbower@amazon.com>
3.0 KiB
layout, title, nav_order, has_children, parent, redirect_from
layout | title | nav_order | has_children | parent | redirect_from | ||
---|---|---|---|---|---|---|---|
default | Percolator | 65 | false | Supported field types |
|
Percolator field type
A percolator field type specifies to treat this field as a query. Any JSON object field can be marked as a percolator field. Normally, documents are indexed and searches are run against them. When you use a percolator field, you store a search, and later the percolate query matches documents to that search.
Example
A customer is searching for a table priced at $400 or less and wants to create an alert for this search.
Create a mapping assigning a percolator field type to the query field:
PUT testindex1
{
"mappings": {
"properties": {
"search": {
"properties": {
"query": {
"type": "percolator"
}
}
},
"price": {
"type": "float"
},
"item": {
"type": "text"
}
}
}
}
{% include copy-curl.html %}
Index a query:
PUT testindex1/_doc/1
{
"search": {
"query": {
"bool": {
"filter": [
{
"match": {
"item": {
"query": "table"
}
}
},
{
"range": {
"price": {
"lte": 400.00
}
}
}
]
}
}
}
}
{% include copy-curl.html %}
Fields referenced in the query must already exist in the mapping. {: .note }
Run a percolate query to search for matching documents:
GET testindex1/_search
{
"query" : {
"bool" : {
"filter" :
{
"percolate" : {
"field" : "search.query",
"document" : {
"item" : "Mahogany table",
"price": 399.99
}
}
}
}
}
}
{% include copy-curl.html %}
The response contains the originally indexed query:
{
"took" : 30,
"timed_out" : false,
"_shards" : {
"total" : 1,
"successful" : 1,
"skipped" : 0,
"failed" : 0
},
"hits" : {
"total" : {
"value" : 1,
"relation" : "eq"
},
"max_score" : 0.0,
"hits" : [
{
"_index" : "testindex1",
"_type" : "_doc",
"_id" : "1",
"_score" : 0.0,
"_source" : {
"search" : {
"query" : {
"bool" : {
"filter" : [
{
"match" : {
"item" : {
"query" : "table"
}
}
},
{
"range" : {
"price" : {
"lte" : 400.0
}
}
}
]
}
}
}
},
"fields" : {
"_percolator_document_slot" : [
0
]
}
}
]
}
}