Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ private static String buildCompleteErrorMessage(String endpointId, ErrorResponse
message.append("; caused by: [").append(cause.type()).append("] ").append(cause.reason());
}

// Root causes carry the actual error for generic errors such "all shards failed"
// Root causes carry the actual error for generic errors such "all shards
// failed"
for (ErrorCause rootCause : error.rootCause()) {
// Avoid repeating same message
if (Objects.equals(rootCause.type(), error.type()) && Objects.equals(rootCause.reason(), error.reason())) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,17 +61,19 @@
public class InnerRetriever implements JsonpSerializable {
private final Retriever retriever;

private final float weight;
@Nullable
private final Float weight;

@Nullable
private final ScoreNormalizer normalizer;

// ---------------------------------------------------------------------------------------------

private InnerRetriever(Builder builder) {

this.retriever = ApiTypeHelper.requireNonNull(builder.retriever, this, "retriever");
this.weight = ApiTypeHelper.requireNonNull(builder.weight, this, "weight", 0);
this.normalizer = ApiTypeHelper.requireNonNull(builder.normalizer, this, "normalizer");
this.weight = builder.weight;
this.normalizer = builder.normalizer;

}

Expand All @@ -80,22 +82,33 @@ public static InnerRetriever of(Function<Builder, ObjectBuilder<InnerRetriever>>
}

/**
* Required - API name: {@code retriever}
* Required - The nested retriever configuration.
* <p>
* API name: {@code retriever}
*/
public final Retriever retriever() {
return this.retriever;
}

/**
* Required - API name: {@code weight}
* Weight multiplier for this retriever's contribution to the linear
* combination. Must be non-negative.
* <p>
* API name: {@code weight}
*/
public final float weight() {
@Nullable
public final Float weight() {
return this.weight;
}

/**
* Required - API name: {@code normalizer}
* Score normalizer to apply to this retriever's results before weighting. Falls
* back to the top-level <code>normalizer</code> on the linear retriever if
* unset, then to <code>none</code> (identity) if neither is set.
* <p>
* API name: {@code normalizer}
*/
@Nullable
public final ScoreNormalizer normalizer() {
return this.normalizer;
}
Expand All @@ -114,11 +127,15 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
generator.writeKey("retriever");
this.retriever.serialize(generator, mapper);

generator.writeKey("weight");
generator.write(this.weight);
if (this.weight != null) {
generator.writeKey("weight");
generator.write(this.weight);

generator.writeKey("normalizer");
this.normalizer.serialize(generator, mapper);
}
if (this.normalizer != null) {
generator.writeKey("normalizer");
this.normalizer.serialize(generator, mapper);
}

}

Expand All @@ -136,8 +153,10 @@ public String toString() {
public static class Builder extends WithJsonObjectBuilderBase<Builder> implements ObjectBuilder<InnerRetriever> {
private Retriever retriever;

@Nullable
private Float weight;

@Nullable
private ScoreNormalizer normalizer;

public Builder() {
Expand All @@ -149,40 +168,53 @@ private Builder(InnerRetriever instance) {

}
/**
* Required - API name: {@code retriever}
* Required - The nested retriever configuration.
* <p>
* API name: {@code retriever}
*/
public final Builder retriever(Retriever value) {
this.retriever = value;
return this;
}

/**
* Required - API name: {@code retriever}
* Required - The nested retriever configuration.
* <p>
* API name: {@code retriever}
*/
public final Builder retriever(Function<Retriever.Builder, ObjectBuilder<Retriever>> fn) {
return this.retriever(fn.apply(new Retriever.Builder()).build());
}

/**
* Required - API name: {@code retriever}
* Required - The nested retriever configuration.
* <p>
* API name: {@code retriever}
*/
public final Builder retriever(RetrieverVariant value) {
this.retriever = value._toRetriever();
return this;
}

/**
* Required - API name: {@code weight}
* Weight multiplier for this retriever's contribution to the linear
* combination. Must be non-negative.
* <p>
* API name: {@code weight}
*/
public final Builder weight(float value) {
public final Builder weight(@Nullable Float value) {
this.weight = value;
return this;
}

/**
* Required - API name: {@code normalizer}
* Score normalizer to apply to this retriever's results before weighting. Falls
* back to the top-level <code>normalizer</code> on the linear retriever if
* unset, then to <code>none</code> (identity) if neither is set.
* <p>
* API name: {@code normalizer}
*/
public final Builder normalizer(ScoreNormalizer value) {
public final Builder normalizer(@Nullable ScoreNormalizer value) {
this.normalizer = value;
return this;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@
<title>Elasticsearch API specification</title>
<script>
var paths = {
'_global.bulk.CreateOperation': '_global/bulk/types.ts#L140-L140',
'_global.bulk.DeleteOperation': '_global/bulk/types.ts#L144-L144',
'_global.bulk.CreateOperation': '_global/bulk/types.ts#L141-L141',
'_global.bulk.DeleteOperation': '_global/bulk/types.ts#L145-L145',
'_global.bulk.FailureStoreStatus': '_global/bulk/types.ts#L86-L91',
'_global.bulk.IndexOperation': '_global/bulk/types.ts#L142-L142',
'_global.bulk.OperationBase': '_global/bulk/types.ts#L100-L117',
'_global.bulk.OperationContainer': '_global/bulk/types.ts#L158-L185',
'_global.bulk.IndexOperation': '_global/bulk/types.ts#L143-L143',
'_global.bulk.OperationBase': '_global/bulk/types.ts#L100-L118',
'_global.bulk.OperationContainer': '_global/bulk/types.ts#L159-L186',
'_global.bulk.OperationType': '_global/bulk/types.ts#L93-L98',
'_global.bulk.Request': '_global/bulk/BulkRequest.ts#L33-L259',
'_global.bulk.Request': '_global/bulk/BulkRequest.ts#L33-L260',
'_global.bulk.Response': '_global/bulk/BulkResponse.ts#L24-L45',
'_global.bulk.ResponseItem': '_global/bulk/types.ts#L37-L84',
'_global.bulk.UpdateAction': '_global/bulk/types.ts#L187-L226',
'_global.bulk.UpdateOperation': '_global/bulk/types.ts#L146-L156',
'_global.bulk.WriteOperation': '_global/bulk/types.ts#L119-L138',
'_global.bulk.UpdateAction': '_global/bulk/types.ts#L188-L227',
'_global.bulk.UpdateOperation': '_global/bulk/types.ts#L147-L157',
'_global.bulk.WriteOperation': '_global/bulk/types.ts#L120-L139',
'_global.clear_scroll.Request': '_global/clear_scroll/ClearScrollRequest.ts#L23-L63',
'_global.clear_scroll.Response': '_global/clear_scroll/ClearScrollResponse.ts#L22-L43',
'_global.close_point_in_time.Request': '_global/close_point_in_time/ClosePointInTimeRequest.ts#L23-L50',
Expand All @@ -25,9 +25,9 @@
'_global.count.Response': '_global/count/CountResponse.ts#L23-L25',
'_global.create.Request': '_global/create/CreateRequest.ts#L33-L202',
'_global.create.Response': '_global/create/CreateResponse.ts#L22-L24',
'_global.delete.Request': '_global/delete/DeleteRequest.ts#L35-L148',
'_global.delete.Request': '_global/delete/DeleteRequest.ts#L35-L149',
'_global.delete.Response': '_global/delete/DeleteResponse.ts#L22-L34',
'_global.delete_by_query.Request': '_global/delete_by_query/DeleteByQueryRequest.ts#L38-L323',
'_global.delete_by_query.Request': '_global/delete_by_query/DeleteByQueryRequest.ts#L38-L324',
'_global.delete_by_query.Response': '_global/delete_by_query/DeleteByQueryResponse.ts#L26-L88',
'_global.delete_by_query_rethrottle.Request': '_global/delete_by_query_rethrottle/DeleteByQueryRethrottleRequest.ts#L24-L56',
'_global.delete_by_query_rethrottle.Response': '_global/delete_by_query_rethrottle/DeleteByQueryRethrottleResponse.ts#L22-L24',
Expand Down Expand Up @@ -88,7 +88,7 @@
'_global.health_report.SlmIndicatorDetails': '_global/health_report/types.ts#L180-L184',
'_global.health_report.SlmIndicatorUnhealthyPolicies': '_global/health_report/types.ts#L186-L189',
'_global.health_report.StagnatingBackingIndices': '_global/health_report/types.ts#L158-L162',
'_global.index.Request': '_global/index/IndexRequest.ts#L36-L276',
'_global.index.Request': '_global/index/IndexRequest.ts#L36-L277',
'_global.index.Response': '_global/index/IndexResponse.ts#L22-L24',
'_global.info.Request': '_global/info/RootNodeInfoRequest.ts#L23-L42',
'_global.info.Response': '_global/info/RootNodeInfoResponse.ts#L23-L40',
Expand Down Expand Up @@ -247,10 +247,10 @@
'_global.termvectors.Term': '_global/termvectors/types.ts#L34-L40',
'_global.termvectors.TermVector': '_global/termvectors/types.ts#L23-L26',
'_global.termvectors.Token': '_global/termvectors/types.ts#L42-L47',
'_global.update.Request': '_global/update/UpdateRequest.ts#L39-L197',
'_global.update.Request': '_global/update/UpdateRequest.ts#L39-L198',
'_global.update.Response': '_global/update/UpdateResponse.ts#L27-L29',
'_global.update.UpdateWriteResponseBase': '_global/update/UpdateResponse.ts#L23-L25',
'_global.update_by_query.Request': '_global/update_by_query/UpdateByQueryRequest.ts#L38-L346',
'_global.update_by_query.Request': '_global/update_by_query/UpdateByQueryRequest.ts#L38-L347',
'_global.update_by_query.Response': '_global/update_by_query/UpdateByQueryResponse.ts#L26-L67',
'_global.update_by_query_rethrottle.Request': '_global/update_by_query_rethrottle/UpdateByQueryRethrottleRequest.ts#L24-L56',
'_global.update_by_query_rethrottle.Response': '_global/update_by_query_rethrottle/UpdateByQueryRethrottleResponse.ts#L23-L25',
Expand Down Expand Up @@ -303,9 +303,9 @@
'_types.IndicesOptions': '_types/common.ts#L350-L377',
'_types.IndicesResponseBase': '_types/Base.ts#L146-L148',
'_types.InlineGet': '_types/common.ts#L335-L348',
'_types.InnerRetriever': '_types/Retriever.ts#L85-L89',
'_types.InnerRetriever': '_types/Retriever.ts#L85-L101',
'_types.KnnQuery': '_types/Knn.ts#L66-L89',
'_types.KnnRetriever': '_types/Retriever.ts#L115-L133',
'_types.KnnRetriever': '_types/Retriever.ts#L127-L145',
'_types.KnnSearch': '_types/Knn.ts#L35-L64',
'_types.LatLonGeoLocation': '_types/Geo.ts#L114-L123',
'_types.Level': '_types/common.ts#L264-L268',
Expand All @@ -323,7 +323,7 @@
'_types.PluginStats': '_types/Stats.ts#L205-L215',
'_types.QueryCacheStats': '_types/Stats.ts#L217-L251',
'_types.QueryVectorBuilder': '_types/Knn.ts#L91-L94',
'_types.RRFRetriever': '_types/Retriever.ts#L135-L144',
'_types.RRFRetriever': '_types/Retriever.ts#L147-L156',
'_types.RankBase': '_types/Rank.ts#L30-L30',
'_types.RankContainer': '_types/Rank.ts#L22-L28',
'_types.RecoveryStats': '_types/Stats.ts#L253-L258',
Expand All @@ -339,8 +339,8 @@
'_types.RetrieverBase': '_types/Retriever.ts#L53-L60',
'_types.RetrieverContainer': '_types/Retriever.ts#L28-L51',
'_types.RrfRank': '_types/Rank.ts#L32-L37',
'_types.RuleRetriever': '_types/Retriever.ts#L159-L168',
'_types.ScoreNormalizer': '_types/Retriever.ts#L91-L95',
'_types.RuleRetriever': '_types/Retriever.ts#L171-L180',
'_types.ScoreNormalizer': '_types/Retriever.ts#L103-L107',
'_types.ScoreSort': '_types/sort.ts#L54-L56',
'_types.Script': '_types/Scripting.ts#L75-L99',
'_types.ScriptField': '_types/Scripting.ts#L101-L104',
Expand All @@ -361,14 +361,14 @@
'_types.SortMode': '_types/sort.ts#L108-L117',
'_types.SortOptions': '_types/sort.ts#L86-L96',
'_types.SortOrder': '_types/sort.ts#L119-L128',
'_types.SpecifiedDocument': '_types/Retriever.ts#L97-L100',
'_types.StandardRetriever': '_types/Retriever.ts#L102-L113',
'_types.SpecifiedDocument': '_types/Retriever.ts#L109-L112',
'_types.StandardRetriever': '_types/Retriever.ts#L114-L125',
'_types.StoreStats': '_types/Stats.ts#L395-L422',
'_types.StoredScript': '_types/Scripting.ts#L47-L59',
'_types.SuggestMode': '_types/common.ts#L297-L310',
'_types.TaskFailure': '_types/Errors.ts#L71-L76',
'_types.TextEmbedding': '_types/Knn.ts#L96-L105',
'_types.TextSimilarityReranker': '_types/Retriever.ts#L146-L157',
'_types.TextSimilarityReranker': '_types/Retriever.ts#L158-L169',
'_types.ThreadType': '_types/common.ts#L312-L318',
'_types.TimeUnit': '_types/Time.ts#L70-L78',
'_types.TokenPruningConfig': '_types/TokenPruningConfig.ts#L22-L35',
Expand Down Expand Up @@ -2191,20 +2191,20 @@
'ml._types.CategorizationAnalyzerDefinition': 'ml/_types/Analysis.ts#L119-L133',
'ml._types.CategorizationStatus': 'ml/_types/Model.ts#L84-L87',
'ml._types.Category': 'ml/_types/Category.ts#L23-L49',
'ml._types.ChunkingConfig': 'ml/_types/Datafeed.ts#L251-L264',
'ml._types.ChunkingMode': 'ml/_types/Datafeed.ts#L245-L249',
'ml._types.ChunkingConfig': 'ml/_types/Datafeed.ts#L255-L268',
'ml._types.ChunkingMode': 'ml/_types/Datafeed.ts#L249-L253',
'ml._types.ClassificationInferenceOptions': 'ml/_types/inference.ts#L118-L133',
'ml._types.CommonTokenizationConfig': 'ml/_types/inference.ts#L160-L186',
'ml._types.ConditionOperator': 'ml/_types/Rule.ts#L74-L79',
'ml._types.DataCounts': 'ml/_types/Job.ts#L354-L374',
'ml._types.DataDescription': 'ml/_types/Job.ts#L376-L392',
'ml._types.Datafeed': 'ml/_types/Datafeed.ts#L37-L61',
'ml._types.DatafeedAuthorization': 'ml/_types/Authorization.ts#L31-L43',
'ml._types.DatafeedConfig': 'ml/_types/Datafeed.ts#L63-L120',
'ml._types.DatafeedRunningState': 'ml/_types/Datafeed.ts#L210-L224',
'ml._types.DatafeedState': 'ml/_types/Datafeed.ts#L136-L141',
'ml._types.DatafeedStats': 'ml/_types/Datafeed.ts#L143-L172',
'ml._types.DatafeedTimingStats': 'ml/_types/Datafeed.ts#L174-L202',
'ml._types.DatafeedConfig': 'ml/_types/Datafeed.ts#L63-L124',
'ml._types.DatafeedRunningState': 'ml/_types/Datafeed.ts#L214-L228',
'ml._types.DatafeedState': 'ml/_types/Datafeed.ts#L140-L145',
'ml._types.DatafeedStats': 'ml/_types/Datafeed.ts#L147-L176',
'ml._types.DatafeedTimingStats': 'ml/_types/Datafeed.ts#L178-L206',
'ml._types.DataframeAnalysis': 'ml/_types/DataframeAnalytics.ts#L134-L213',
'ml._types.DataframeAnalysisAnalyzedFields': 'ml/_types/DataframeAnalytics.ts#L238-L244',
'ml._types.DataframeAnalysisClassification': 'ml/_types/DataframeAnalytics.ts#L227-L236',
Expand Down Expand Up @@ -2242,7 +2242,7 @@
'ml._types.DataframeEvaluationRegressionMetricsHuber': 'ml/_types/DataframeEvaluation.ts#L117-L120',
'ml._types.DataframeEvaluationRegressionMetricsMsle': 'ml/_types/DataframeEvaluation.ts#L112-L115',
'ml._types.DataframeState': 'ml/_types/Dataframe.ts#L20-L26',
'ml._types.DelayedDataCheckConfig': 'ml/_types/Datafeed.ts#L122-L133',
'ml._types.DelayedDataCheckConfig': 'ml/_types/Datafeed.ts#L126-L137',
'ml._types.DeploymentAllocationState': 'ml/_types/TrainedModel.ts#L331-L344',
'ml._types.DeploymentAssignmentState': 'ml/_types/TrainedModel.ts#L346-L363',
'ml._types.DetectionRule': 'ml/_types/Rule.ts#L25-L39',
Expand All @@ -2252,7 +2252,7 @@
'ml._types.DiscoveryNodeCompact': 'ml/_types/DiscoveryNode.ts#L39-L48',
'ml._types.DiscoveryNodeContent': 'ml/_types/DiscoveryNode.ts#L27-L37',
'ml._types.ExcludeFrequent': 'ml/_types/Detector.ts#L91-L96',
'ml._types.ExponentialAverageCalculationContext': 'ml/_types/Datafeed.ts#L204-L208',
'ml._types.ExponentialAverageCalculationContext': 'ml/_types/Datafeed.ts#L208-L212',
'ml._types.FillMaskInferenceOptions': 'ml/_types/inference.ts#L284-L299',
'ml._types.FillMaskInferenceUpdateOptions': 'ml/_types/inference.ts#L430-L437',
'ml._types.Filter': 'ml/_types/Filter.ts#L22-L29',
Expand Down Expand Up @@ -2302,7 +2302,7 @@
'ml._types.RoutingState': 'ml/_types/TrainedModel.ts#L408-L429',
'ml._types.RuleAction': 'ml/_types/Rule.ts#L41-L50',
'ml._types.RuleCondition': 'ml/_types/Rule.ts#L52-L65',
'ml._types.RunningStateSearchInterval': 'ml/_types/Datafeed.ts#L226-L243',
'ml._types.RunningStateSearchInterval': 'ml/_types/Datafeed.ts#L230-L247',
'ml._types.SnapshotUpgradeState': 'ml/_types/Model.ts#L95-L100',
'ml._types.TextClassificationInferenceOptions': 'ml/_types/inference.ts#L202-L214',
'ml._types.TextClassificationInferenceUpdateOptions': 'ml/_types/inference.ts#L382-L391',
Expand Down Expand Up @@ -2465,8 +2465,8 @@
'ml.put_calendar_job.Response': 'ml/put_calendar_job/MlPutCalendarJobResponse.ts#L22-L31',
'ml.put_data_frame_analytics.Request': 'ml/put_data_frame_analytics/MlPutDataFrameAnalyticsRequest.ts#L36-L163',
'ml.put_data_frame_analytics.Response': 'ml/put_data_frame_analytics/MlPutDataFrameAnalyticsResponse.ts#L31-L47',
'ml.put_datafeed.Request': 'ml/put_datafeed/MlPutDatafeedRequest.ts#L38-L187',
'ml.put_datafeed.Response': 'ml/put_datafeed/MlPutDatafeedResponse.ts#L31-L49',
'ml.put_datafeed.Request': 'ml/put_datafeed/MlPutDatafeedRequest.ts#L38-L195',
'ml.put_datafeed.Response': 'ml/put_datafeed/MlPutDatafeedResponse.ts#L31-L50',
'ml.put_filter.Request': 'ml/put_filter/MlPutFilterRequest.ts#L23-L60',
'ml.put_filter.Response': 'ml/put_filter/MlPutFilterResponse.ts#L22-L28',
'ml.put_job.Request': 'ml/put_job/MlPutJobRequest.ts#L30-L153',
Expand Down Expand Up @@ -2511,8 +2511,8 @@
'ml.stop_trained_model_deployment.Response': 'ml/stop_trained_model_deployment/MlStopTrainedModelDeploymentResponse.ts#L20-L22',
'ml.update_data_frame_analytics.Request': 'ml/update_data_frame_analytics/MlUpdateDataFrameAnalyticsRequest.ts#L24-L82',
'ml.update_data_frame_analytics.Response': 'ml/update_data_frame_analytics/MlUpdateDataFrameAnalyticsResponse.ts#L30-L45',
'ml.update_datafeed.Request': 'ml/update_datafeed/MlUpdateDatafeedRequest.ts#L31-L166',
'ml.update_datafeed.Response': 'ml/update_datafeed/MlUpdateDatafeedResponse.ts#L31-L49',
'ml.update_datafeed.Request': 'ml/update_datafeed/MlUpdateDatafeedRequest.ts#L31-L174',
'ml.update_datafeed.Response': 'ml/update_datafeed/MlUpdateDatafeedResponse.ts#L31-L50',
'ml.update_filter.Request': 'ml/update_filter/MlUpdateFilterRequest.ts#L23-L62',
'ml.update_filter.Response': 'ml/update_filter/MlUpdateFilterResponse.ts#L22-L28',
'ml.update_job.Request': 'ml/update_job/MlUpdateJobRequest.ts#L33-L149',
Expand Down Expand Up @@ -3385,10 +3385,10 @@
if (hash.length > 1) {
hash = hash.substring(1);
}
window.location = "https://github.com/elastic/elasticsearch-specification/tree/1238d46521feb57fd76cef640240d927ca0ad05d/specification/" + (paths[hash] || "");
window.location = "https://github.com/elastic/elasticsearch-specification/tree/4340716a5cdb8b75654131337835e74e1f5c4c80/specification/" + (paths[hash] || "");
</script>
</head>
<body>
Please see the <a href="https://github.com/elastic/elasticsearch-specification/tree/1238d46521feb57fd76cef640240d927ca0ad05d/specification/">Elasticsearch API specification</a>.
Please see the <a href="https://github.com/elastic/elasticsearch-specification/tree/4340716a5cdb8b75654131337835e74e1f5c4c80/specification/">Elasticsearch API specification</a>.
</body>
</html>
Loading
Loading