I've noticed that, while trying to migrate from Elasticsearch 7.5.2 -> 7.9.2, something seems to have changed in how percolator queries seem to work. I have narrowed down my problem to a change between 7.6.2 and 7.7.0; the following repro results in 1 hit in ES 7.6.2, but 0 hits in ES 7.7+:
curl -XPUT "localhost:${PORT}/percolation-index" -H 'Content-Type:application/json' -d '
{
"settings": {
"percolator": {
"map_unmapped_fields_as_text": true
}
},
"mappings": {
"properties": {
"percolator_field": {
"type": "percolator"
}
}
}
}'
curl -XPOST "localhost:${PORT}/percolation-index/_doc?refresh=true" -H 'Content-Type:application/json' -d '
{
"percolator_field": {
"query_string": {
"query": "message:test"
}
}
}'
curl -XPOST "localhost:${PORT}/percolation-index/_search?pretty" -H 'Content-Type:application/json' -d '
{
"query": {
"percolate": {
"field": "percolator_field",
"document": {
"message": "test stuff"
}
}
}
}'
If I instead do a match
query in my percolator:
curl -XPOST "localhost:${PORT}/percolation-index/_doc?refresh=true" -H 'Content-Type:application/json' -d '
{
"percolator_field": {
"match": {
"message": "test"
}
}
}'
The percolator matches as expected on both versions.