protected ValuesSourceConfig<VS> resolveConfig(SearchContext context) { ValueType valueType = this.valueType != null ? this.valueType : targetValueType; return ValuesSourceConfig.resolve(context.getQueryShardContext(), valueType, field, script, missing, timeZone, format); }
@Override protected final MultiValuesSourceAggregatorFactory<VS, ?> doBuild(SearchContext context, AggregatorFactory<?> parent, AggregatorFactories.Builder subFactoriesBuilder) throws IOException { ValueType finalValueType = this.valueType != null ? this.valueType : targetValueType; Map<String, ValuesSourceConfig<VS>> configs = new HashMap<>(fields.size()); fields.forEach((key, value) -> { ValuesSourceConfig<VS> config = ValuesSourceConfig.resolve(context.getQueryShardContext(), finalValueType, value.getFieldName(), value.getScript(), value.getMissing(), value.getTimeZone(), format); configs.put(key, config); }); DocValueFormat docValueFormat = resolveFormat(format, finalValueType); return innerBuild(context, configs, docValueFormat, parent, subFactoriesBuilder); }
public final CompositeValuesSourceConfig build(SearchContext context) throws IOException { ValuesSourceConfig<?> config = ValuesSourceConfig.resolve(context.getQueryShardContext(), valueType, field, script, missing, null, format); if (missingBucket && missing != null) { throw new QueryShardException(context.getQueryShardContext(), "cannot use [missing] option in conjunction with [missing_bucket]"); } return innerBuild(context, config); } }
protected ValuesSourceConfig<VS> resolveConfig(SearchContext context) { ValueType valueType = this.valueType != null ? this.valueType : targetValueType; return ValuesSourceConfig.resolve(context.getQueryShardContext(), valueType, field, script, missing, timeZone, format); }
protected ValuesSourceConfig<VS> resolveConfig(SearchContext context) { ValueType valueType = this.valueType != null ? this.valueType : targetValueType; return ValuesSourceConfig.resolve(context.getQueryShardContext(), valueType, field, script, missing, timeZone, format); }
protected ValuesSourceConfig<VS> resolveConfig(SearchContext context) { ValueType valueType = this.valueType != null ? this.valueType : targetValueType; return ValuesSourceConfig.resolve(context.getQueryShardContext(), valueType, field, script, missing, timeZone, format); }
@Override protected final MultiValuesSourceAggregatorFactory<VS, ?> doBuild(SearchContext context, AggregatorFactory<?> parent, AggregatorFactories.Builder subFactoriesBuilder) throws IOException { ValueType finalValueType = this.valueType != null ? this.valueType : targetValueType; Map<String, ValuesSourceConfig<VS>> configs = new HashMap<>(fields.size()); fields.forEach((key, value) -> { ValuesSourceConfig<VS> config = ValuesSourceConfig.resolve(context.getQueryShardContext(), finalValueType, value.getFieldName(), value.getScript(), value.getMissing(), value.getTimeZone(), format); configs.put(key, config); }); DocValueFormat docValueFormat = resolveFormat(format, finalValueType); return innerBuild(context, configs, docValueFormat, parent, subFactoriesBuilder); }
@Override protected final MultiValuesSourceAggregatorFactory<VS, ?> doBuild(SearchContext context, AggregatorFactory<?> parent, AggregatorFactories.Builder subFactoriesBuilder) throws IOException { ValueType finalValueType = this.valueType != null ? this.valueType : targetValueType; Map<String, ValuesSourceConfig<VS>> configs = new HashMap<>(fields.size()); fields.forEach((key, value) -> { ValuesSourceConfig<VS> config = ValuesSourceConfig.resolve(context.getQueryShardContext(), finalValueType, value.getFieldName(), value.getScript(), value.getMissing(), value.getTimeZone(), format); configs.put(key, config); }); DocValueFormat docValueFormat = resolveFormat(format, finalValueType); return innerBuild(context, configs, docValueFormat, parent, subFactoriesBuilder); }
public final CompositeValuesSourceConfig build(SearchContext context) throws IOException { ValuesSourceConfig<?> config = ValuesSourceConfig.resolve(context.getQueryShardContext(), valueType, field, script, missing, null, format); if (config.unmapped() && field != null && missing == null && missingBucket == false) { // this source cannot produce any values so we refuse to build // since composite buckets are not created on null values by default. throw new QueryShardException(context.getQueryShardContext(), "failed to find field [" + field + "] and [missing_bucket] is not set"); } if (missingBucket && missing != null) { throw new QueryShardException(context.getQueryShardContext(), "cannot use [missing] option in conjunction with [missing_bucket]"); } return innerBuild(context, config); } }
public final CompositeValuesSourceConfig build(SearchContext context) throws IOException { ValuesSourceConfig<?> config = ValuesSourceConfig.resolve(context.getQueryShardContext(), valueType, field, script, missing, null, format); if (config.unmapped() && field != null && missing == null && missingBucket == false) { // this source cannot produce any values so we refuse to build // since composite buckets are not created on null values by default. throw new QueryShardException(context.getQueryShardContext(), "failed to find field [" + field + "] and [missing_bucket] is not set"); } if (missingBucket && missing != null) { throw new QueryShardException(context.getQueryShardContext(), "cannot use [missing] option in conjunction with [missing_bucket]"); } return innerBuild(context, config); } }