Skip to content

Commit 6ffa8a0

Browse files
committed
Document the limitation around field aliases and percolator. (#40073)
Currently if a field alias is updated, any percolator queries that contain the alias will still refer to its old target. This PR documents the issue while we look into addressing it. Relates to #37212.
1 parent c72feed commit 6ffa8a0

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

docs/reference/mapping/types/alias.asciidoc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,10 @@ There are a few restrictions on the target of an alias:
6868
Additionally, a field alias can only have one target. This means that it is not possible to use a
6969
field alias to query over multiple target fields in a single clause.
7070

71+
An alias can be changed to refer to a new target through a mappings update. A known limitation is that
72+
if any stored percolator queries contain the field alias, they will still refer to its original target.
73+
More information can be found in the <<percolator, percolator documentation>>.
74+
7175
[[unsupported-apis]]
7276
==== Unsupported APIs
7377

docs/reference/mapping/types/percolator.asciidoc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -743,3 +743,11 @@ The script inside a `script` query can only access doc values fields. The `perco
743743
into an in-memory index. This in-memory index doesn't support stored fields and because of that the `_source` field and
744744
other stored fields are not stored. This is the reason why in the `script` query the `_source` and other stored fields
745745
aren't available.
746+
747+
[float]
748+
===== Field aliases
749+
750+
Percolator queries that contain <<alias, field aliases>> may not always behave as expected. In particular, if a
751+
percolator query is registered that contains a field alias, and then that alias is updated in the mappings to refer
752+
to a different field, the stored query will still refer to the original target field. To pick up the change to
753+
the field alias, the percolator query must be explicitly reindexed.

0 commit comments

Comments
 (0)