Skip to content

Commit

Permalink
Allow unmapped fields in MultiClustersIT tests (#120873)
Browse files Browse the repository at this point in the history
The message_id field may be unmapped if documents were indexed into some 
indices but not all. This change specifies the unmapped type for
message_id, allowing it to be sorted in such cases.

Closes #120796
  • Loading branch information
dnhatn authored Jan 27, 2025
1 parent bc57545 commit 9d90d05
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,11 @@ public void testSource() throws IOException {
final boolean sorted = randomBoolean();
if (sorted) {
searchSource.startArray("sort");
searchSource.value("message_id");
searchSource.startObject();
searchSource.startObject("message_id");
searchSource.field("unmapped_type", "long"); // message_id can be unmapped if no doc is indexed.
searchSource.endObject();
searchSource.endObject();
searchSource.endArray();
}
final Predicate<String> filterHost;
Expand Down

0 comments on commit 9d90d05

Please sign in to comment.