-
Notifications
You must be signed in to change notification settings - Fork 25.7k
Closed
Copy link
Labels
:StorageEngine/MappingThe storage related side of mappingsThe storage related side of mappings>bugTeam:StorageEngine
Description
For object arrays that are within nested object and contain leaf values that are "mixed" (some synthetic source values come from doc_values and some from ignored source) synthetic source is not correct.
Following test demonstrates that:
public void testObjectArrayWithinNestedObjects() throws IOException {
DocumentMapper documentMapper = createMapperService(syntheticSourceMapping(b -> {
b.startObject("path").startObject("properties");
{
b.startObject("to").field("type", "nested").startObject("properties");
{
b.startObject("obj").startObject("properties");
{
b.startObject("id").field("type", "integer").field("synthetic_source_keep", "arrays").endObject();
}
b.endObject().endObject();
}
b.endObject().endObject();
}
b.endObject().endObject();
})).documentMapper();
var syntheticSource = syntheticSource(documentMapper, b -> {
b.startObject("path");
{
b.startObject("to");
{
b.startArray("obj");
{
b.startObject().array("id", 1, 20, 3).endObject();
b.startObject().field("id", 10).endObject();
}
b.endArray();
}
b.endObject();
}
b.endObject();
});
assertEquals("""
{"path":{"to":{"obj":{"id":[1,20,3,10]}}}}""", syntheticSource);
}
This test produces {"path":{"to":{"obj":{"id":[1,20,3]}}}}.
Metadata
Metadata
Assignees
Labels
:StorageEngine/MappingThe storage related side of mappingsThe storage related side of mappings>bugTeam:StorageEngine