Hi! I'm facing a problem using a terms lookup query inside a percolator query.
The actual problem is that the terms are not re-fetched until I reindex the document with the percolator query. I was expecting that, if I update the document referenced by the terms lookup query, and I performed a percolate, the new updated terms will be used.
I'm currently using ES 7.9.
I found a reference of what I think the problem is, under percolator ES documentation:
There are a number of queries that fetch data via a get call during query parsing. For example the
termsquery when using terms lookup,
templatequery when using indexed scripts and
geo_shapewhen using pre-indexed shapes. When these queries are indexed by the
percolatorfield type then the get call is executed once. So each time the
percolatorquery evaluates these queries, the fetches terms, shapes etc. as the were upon index time will be used. Important to note is that fetching of terms that these queries do, happens both each time the percolator query gets indexed on both primary and replica shards, so the terms that are actually indexed can be different between shard copies, if the source index changed while indexing.
If this actually is the reason behind my issue, anyone knows if there is a mechanism in order to force the document with the percolator query to re-fetch the terms lookup after the referenced document has been updated? Again, the workaround I found is to update the document manually (with the same body, no change at all, only perform the update just to force terms lookup refresh) but I want to know if there is a better way.
Thank your for your time!