@@ -211,7 +211,7 @@ const getAggIntervals = async (
211211 query,
212212 aggs : buildSamplerAggregation ( minMaxAggs , samplerShardSize ) ,
213213 size : 0 ,
214- ...( runtimeMappings !== undefined ? { runtime_mappings : runtimeMappings } : { } ) ,
214+ ...( isPopulatedObject ( runtimeMappings ) ? { runtime_mappings : runtimeMappings } : { } ) ,
215215 } ,
216216 } ) ;
217217
@@ -297,7 +297,7 @@ export const getHistogramsForFields = async (
297297 query,
298298 aggs : buildSamplerAggregation ( chartDataAggs , samplerShardSize ) ,
299299 size : 0 ,
300- ...( runtimeMappings !== undefined ? { runtime_mappings : runtimeMappings } : { } ) ,
300+ ...( isPopulatedObject ( runtimeMappings ) ? { runtime_mappings : runtimeMappings } : { } ) ,
301301 } ,
302302 } ) ;
303303
@@ -753,7 +753,7 @@ export class DataVisualizer {
753753 filter : filterCriteria ,
754754 } ,
755755 } ,
756- ...( runtimeMappings !== undefined ? { runtime_mappings : runtimeMappings } : { } ) ,
756+ ...( isPopulatedObject ( runtimeMappings ) ? { runtime_mappings : runtimeMappings } : { } ) ,
757757 } ;
758758 filterCriteria . push ( { exists : { field } } ) ;
759759
@@ -799,7 +799,7 @@ export class DataVisualizer {
799799 } ,
800800 } ,
801801 aggs,
802- ...( runtimeMappings !== undefined ? { runtime_mappings : runtimeMappings } : { } ) ,
802+ ...( isPopulatedObject ( runtimeMappings ) ? { runtime_mappings : runtimeMappings } : { } ) ,
803803 } ;
804804
805805 const { body } = await this . _asCurrentUser . search ( {
@@ -904,7 +904,7 @@ export class DataVisualizer {
904904 } ,
905905 } ,
906906 aggs : buildSamplerAggregation ( aggs , samplerShardSize ) ,
907- ...( runtimeMappings !== undefined ? { runtime_mappings : runtimeMappings } : { } ) ,
907+ ...( isPopulatedObject ( runtimeMappings ) ? { runtime_mappings : runtimeMappings } : { } ) ,
908908 } ;
909909
910910 const { body } = await this . _asCurrentUser . search ( {
@@ -1027,7 +1027,7 @@ export class DataVisualizer {
10271027 } ,
10281028 } ,
10291029 aggs : buildSamplerAggregation ( aggs , samplerShardSize ) ,
1030- ...( runtimeMappings !== undefined ? { runtime_mappings : runtimeMappings } : { } ) ,
1030+ ...( isPopulatedObject ( runtimeMappings ) ? { runtime_mappings : runtimeMappings } : { } ) ,
10311031 } ;
10321032
10331033 const { body } = await this . _asCurrentUser . search ( {
@@ -1103,7 +1103,7 @@ export class DataVisualizer {
11031103 } ,
11041104 } ,
11051105 aggs : buildSamplerAggregation ( aggs , samplerShardSize ) ,
1106- ...( runtimeMappings !== undefined ? { runtime_mappings : runtimeMappings } : { } ) ,
1106+ ...( isPopulatedObject ( runtimeMappings ) ? { runtime_mappings : runtimeMappings } : { } ) ,
11071107 } ;
11081108
11091109 const { body } = await this . _asCurrentUser . search ( {
@@ -1172,7 +1172,7 @@ export class DataVisualizer {
11721172 } ,
11731173 } ,
11741174 aggs : buildSamplerAggregation ( aggs , samplerShardSize ) ,
1175- ...( runtimeMappings !== undefined ? { runtime_mappings : runtimeMappings } : { } ) ,
1175+ ...( isPopulatedObject ( runtimeMappings ) ? { runtime_mappings : runtimeMappings } : { } ) ,
11761176 } ;
11771177
11781178 const { body } = await this . _asCurrentUser . search ( {
@@ -1237,7 +1237,7 @@ export class DataVisualizer {
12371237 filter : filterCriteria ,
12381238 } ,
12391239 } ,
1240- ...( runtimeMappings !== undefined ? { runtime_mappings : runtimeMappings } : { } ) ,
1240+ ...( isPopulatedObject ( runtimeMappings ) ? { runtime_mappings : runtimeMappings } : { } ) ,
12411241 } ;
12421242
12431243 const { body } = await this . _asCurrentUser . search ( {
0 commit comments