Skip to content

Commit a913828

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 9e08f9b commit a913828

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
@@ -74,6 +74,10 @@ There are a few restrictions on the target of an alias:
7474
Additionally, a field alias can only have one target. This means that it is not possible to use a
7575
field alias to query over multiple target fields in a single clause.
7676

77+
An alias can be changed to refer to a new target through a mappings update. A known limitation is that
78+
if any stored percolator queries contain the field alias, they will still refer to its original target.
79+
More information can be found in the <<percolator, percolator documentation>>.
80+
7781
[[unsupported-apis]]
7882
==== Unsupported APIs
7983

docs/reference/mapping/types/percolator.asciidoc

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

0 commit comments

Comments
 (0)