From a9136031c831e830e55f893e6269b38d38adf402 Mon Sep 17 00:00:00 2001 From: Panagiotis Bailis Date: Wed, 23 Oct 2024 13:22:32 +0300 Subject: [PATCH 1/8] adding breaking change entry --- .../org/elasticsearch/xpack/rank/rrf/RRFRetrieverBuilder.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/x-pack/plugin/rank-rrf/src/main/java/org/elasticsearch/xpack/rank/rrf/RRFRetrieverBuilder.java b/x-pack/plugin/rank-rrf/src/main/java/org/elasticsearch/xpack/rank/rrf/RRFRetrieverBuilder.java index c3c9f19cde6ef..af482d58ecdbc 100644 --- a/x-pack/plugin/rank-rrf/src/main/java/org/elasticsearch/xpack/rank/rrf/RRFRetrieverBuilder.java +++ b/x-pack/plugin/rank-rrf/src/main/java/org/elasticsearch/xpack/rank/rrf/RRFRetrieverBuilder.java @@ -39,6 +39,8 @@ * meaning it has a set of child retrievers that each return a set of * top docs that will then be combined and ranked according to the rrf * formula. + * + * Breaking change */ public final class RRFRetrieverBuilder extends CompoundRetrieverBuilder { From c288e569b0a593b15af418a281d5cf66a89b0899 Mon Sep 17 00:00:00 2001 From: Panagiotis Bailis Date: Wed, 23 Oct 2024 13:23:46 +0300 Subject: [PATCH 2/8] Update docs/changelog/115399.yaml --- docs/changelog/115399.yaml | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 docs/changelog/115399.yaml diff --git a/docs/changelog/115399.yaml b/docs/changelog/115399.yaml new file mode 100644 index 0000000000000..98e3596c18977 --- /dev/null +++ b/docs/changelog/115399.yaml @@ -0,0 +1,12 @@ +pr: 115399 +summary: Adding breaking change entry for retrievers +area: Ranking +type: breaking +issues: [] +breaking: + title: Adding breaking change entry for retrievers + area: Ranking + details: Please describe the details of this change for the release notes. You can + use asciidoc. + impact: Please describe the impact of this change to users + notable: false From 7204e81f23a9bd4621002c0c1b0392afdcf51393 Mon Sep 17 00:00:00 2001 From: Panagiotis Bailis Date: Wed, 23 Oct 2024 13:25:44 +0300 Subject: [PATCH 3/8] updating breaking change entry --- docs/changelog/115399.yaml | 18 ++++++++++++++---- .../xpack/rank/rrf/RRFRetrieverBuilder.java | 2 -- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/docs/changelog/115399.yaml b/docs/changelog/115399.yaml index 98e3596c18977..301905114d228 100644 --- a/docs/changelog/115399.yaml +++ b/docs/changelog/115399.yaml @@ -4,9 +4,19 @@ area: Ranking type: breaking issues: [] breaking: - title: Adding breaking change entry for retrievers + title: Reworking RRF retriever to be evaluated during rewrite phase area: Ranking - details: Please describe the details of this change for the release notes. You can - use asciidoc. - impact: Please describe the impact of this change to users + details: |- + In this release (8.16), we have introduced major changes to the retrievers framework and how they can be evaluated, + focusing mainly on compound retrievers like `rrf` and `text_similarity_reranker`, which allowed us to support + additional search features like highlighting, collapsing, explaining, and aggregations. + To ensure consistency and avoid unexpected failures, we have introduced a new cluster_feature that ensures that + all nodes must satisfy, in order for the `rrf` and `text_similarity_reranker` retriever queries to be evaluated. + This guarantees that all nodes are able to take advantage of the new framework and provide compatible responses. + As part of the rework, we have removed the `_rank` property from the responses of an `rrf` retriever. + impact: |- + - Users will not be able to use the `rrf` and `text_similarity_reranker` retrievers in a mixed cluster scenario + with previous releases (i.e. prior to 8.16), and the request will throw an `UnsupportedOperationException`. + - `_rank` has now been removed from the output of the `rrf` retrievers so trying to directly parse the field + will throw an exception notable: false diff --git a/x-pack/plugin/rank-rrf/src/main/java/org/elasticsearch/xpack/rank/rrf/RRFRetrieverBuilder.java b/x-pack/plugin/rank-rrf/src/main/java/org/elasticsearch/xpack/rank/rrf/RRFRetrieverBuilder.java index af482d58ecdbc..c3c9f19cde6ef 100644 --- a/x-pack/plugin/rank-rrf/src/main/java/org/elasticsearch/xpack/rank/rrf/RRFRetrieverBuilder.java +++ b/x-pack/plugin/rank-rrf/src/main/java/org/elasticsearch/xpack/rank/rrf/RRFRetrieverBuilder.java @@ -39,8 +39,6 @@ * meaning it has a set of child retrievers that each return a set of * top docs that will then be combined and ranked according to the rrf * formula. - * - * Breaking change */ public final class RRFRetrieverBuilder extends CompoundRetrieverBuilder { From 34e0a3f1b97dace12af56e3f6b6f39bf61365a0d Mon Sep 17 00:00:00 2001 From: Panagiotis Bailis Date: Wed, 23 Oct 2024 13:33:11 +0300 Subject: [PATCH 4/8] Update 115399.yaml --- docs/changelog/115399.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/changelog/115399.yaml b/docs/changelog/115399.yaml index 301905114d228..d5c0e40ad8f42 100644 --- a/docs/changelog/115399.yaml +++ b/docs/changelog/115399.yaml @@ -9,14 +9,14 @@ breaking: details: |- In this release (8.16), we have introduced major changes to the retrievers framework and how they can be evaluated, focusing mainly on compound retrievers like `rrf` and `text_similarity_reranker`, which allowed us to support - additional search features like highlighting, collapsing, explaining, and aggregations. - To ensure consistency and avoid unexpected failures, we have introduced a new cluster_feature that ensures that + additional search features like collapsing, explaining, aggregations, and highlighting. + To ensure consistency and avoid unexpected failures, we have introduced a new cluster_feature that all nodes must satisfy, in order for the `rrf` and `text_similarity_reranker` retriever queries to be evaluated. This guarantees that all nodes are able to take advantage of the new framework and provide compatible responses. - As part of the rework, we have removed the `_rank` property from the responses of an `rrf` retriever. + As part of the rework, we have also removed the `_rank` property from the responses of an `rrf` retriever. impact: |- - Users will not be able to use the `rrf` and `text_similarity_reranker` retrievers in a mixed cluster scenario - with previous releases (i.e. prior to 8.16), and the request will throw an `UnsupportedOperationException`. + with previous releases (i.e. prior to 8.16), and the request will throw a `ParsingException`. - `_rank` has now been removed from the output of the `rrf` retrievers so trying to directly parse the field will throw an exception notable: false From e568e6ca1f387573fd816fe3fa0c94f3f21605de Mon Sep 17 00:00:00 2001 From: Panagiotis Bailis Date: Wed, 23 Oct 2024 13:50:40 +0300 Subject: [PATCH 5/8] updating breaking change entry --- docs/changelog/115399.yaml | 4 ++-- .../textsimilarity/TextSimilarityRankRetrieverBuilder.java | 3 ++- .../elasticsearch/xpack/rank/rrf/RRFRetrieverBuilder.java | 5 ++++- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/docs/changelog/115399.yaml b/docs/changelog/115399.yaml index d5c0e40ad8f42..e16d0e4941bf5 100644 --- a/docs/changelog/115399.yaml +++ b/docs/changelog/115399.yaml @@ -1,11 +1,11 @@ pr: 115399 summary: Adding breaking change entry for retrievers -area: Ranking +area: Search type: breaking issues: [] breaking: title: Reworking RRF retriever to be evaluated during rewrite phase - area: Ranking + area: REST API details: |- In this release (8.16), we have introduced major changes to the retrievers framework and how they can be evaluated, focusing mainly on compound retrievers like `rrf` and `text_similarity_reranker`, which allowed us to support diff --git a/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/rank/textsimilarity/TextSimilarityRankRetrieverBuilder.java b/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/rank/textsimilarity/TextSimilarityRankRetrieverBuilder.java index 342199dc51db8..cdc2a95bae149 100644 --- a/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/rank/textsimilarity/TextSimilarityRankRetrieverBuilder.java +++ b/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/rank/textsimilarity/TextSimilarityRankRetrieverBuilder.java @@ -81,7 +81,8 @@ public static TextSimilarityRankRetrieverBuilder fromXContent(XContentParser par throw new ParsingException(parser.getTokenLocation(), "unknown retriever [" + TextSimilarityRankBuilder.NAME + "]"); } if (context.clusterSupportsFeature(TEXT_SIMILARITY_RERANKER_COMPOSITION_SUPPORTED) == false) { - throw new UnsupportedOperationException( + throw new ParsingException( + parser.getTokenLocation(), "[text_similarity_reranker] retriever composition feature is not supported by all nodes in the cluster" ); } diff --git a/x-pack/plugin/rank-rrf/src/main/java/org/elasticsearch/xpack/rank/rrf/RRFRetrieverBuilder.java b/x-pack/plugin/rank-rrf/src/main/java/org/elasticsearch/xpack/rank/rrf/RRFRetrieverBuilder.java index c3c9f19cde6ef..84949b693d140 100644 --- a/x-pack/plugin/rank-rrf/src/main/java/org/elasticsearch/xpack/rank/rrf/RRFRetrieverBuilder.java +++ b/x-pack/plugin/rank-rrf/src/main/java/org/elasticsearch/xpack/rank/rrf/RRFRetrieverBuilder.java @@ -83,7 +83,10 @@ public static RRFRetrieverBuilder fromXContent(XContentParser parser, RetrieverP throw new ParsingException(parser.getTokenLocation(), "unknown retriever [" + NAME + "]"); } if (context.clusterSupportsFeature(RRF_RETRIEVER_COMPOSITION_SUPPORTED) == false) { - throw new UnsupportedOperationException("[rrf] retriever composition feature is not supported by all nodes in the cluster"); + throw new ParsingException( + parser.getTokenLocation(), + "[rrf] retriever composition feature is not supported by all nodes in the cluster" + ); } if (RRFRankPlugin.RANK_RRF_FEATURE.check(XPackPlugin.getSharedLicenseState()) == false) { throw LicenseUtils.newComplianceException("Reciprocal Rank Fusion (RRF)"); From cc938df36e74d1965d6a507f3dcd3062db73ebfc Mon Sep 17 00:00:00 2001 From: Panagiotis Bailis Date: Wed, 23 Oct 2024 14:03:06 +0300 Subject: [PATCH 6/8] iter --- docs/changelog/115399.yaml | 2 +- .../textsimilarity/TextSimilarityRankRetrieverBuilder.java | 3 +-- .../elasticsearch/xpack/rank/rrf/RRFRetrieverBuilder.java | 5 +---- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/docs/changelog/115399.yaml b/docs/changelog/115399.yaml index e16d0e4941bf5..9129a68325ce8 100644 --- a/docs/changelog/115399.yaml +++ b/docs/changelog/115399.yaml @@ -16,7 +16,7 @@ breaking: As part of the rework, we have also removed the `_rank` property from the responses of an `rrf` retriever. impact: |- - Users will not be able to use the `rrf` and `text_similarity_reranker` retrievers in a mixed cluster scenario - with previous releases (i.e. prior to 8.16), and the request will throw a `ParsingException`. + with previous releases (i.e. prior to 8.16), and the request will throw an `IllegalArgumentException`. - `_rank` has now been removed from the output of the `rrf` retrievers so trying to directly parse the field will throw an exception notable: false diff --git a/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/rank/textsimilarity/TextSimilarityRankRetrieverBuilder.java b/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/rank/textsimilarity/TextSimilarityRankRetrieverBuilder.java index cdc2a95bae149..91b6cdc61afe4 100644 --- a/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/rank/textsimilarity/TextSimilarityRankRetrieverBuilder.java +++ b/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/rank/textsimilarity/TextSimilarityRankRetrieverBuilder.java @@ -81,8 +81,7 @@ public static TextSimilarityRankRetrieverBuilder fromXContent(XContentParser par throw new ParsingException(parser.getTokenLocation(), "unknown retriever [" + TextSimilarityRankBuilder.NAME + "]"); } if (context.clusterSupportsFeature(TEXT_SIMILARITY_RERANKER_COMPOSITION_SUPPORTED) == false) { - throw new ParsingException( - parser.getTokenLocation(), + throw new IllegalArgumentException( "[text_similarity_reranker] retriever composition feature is not supported by all nodes in the cluster" ); } diff --git a/x-pack/plugin/rank-rrf/src/main/java/org/elasticsearch/xpack/rank/rrf/RRFRetrieverBuilder.java b/x-pack/plugin/rank-rrf/src/main/java/org/elasticsearch/xpack/rank/rrf/RRFRetrieverBuilder.java index 84949b693d140..792ff4eac3893 100644 --- a/x-pack/plugin/rank-rrf/src/main/java/org/elasticsearch/xpack/rank/rrf/RRFRetrieverBuilder.java +++ b/x-pack/plugin/rank-rrf/src/main/java/org/elasticsearch/xpack/rank/rrf/RRFRetrieverBuilder.java @@ -83,10 +83,7 @@ public static RRFRetrieverBuilder fromXContent(XContentParser parser, RetrieverP throw new ParsingException(parser.getTokenLocation(), "unknown retriever [" + NAME + "]"); } if (context.clusterSupportsFeature(RRF_RETRIEVER_COMPOSITION_SUPPORTED) == false) { - throw new ParsingException( - parser.getTokenLocation(), - "[rrf] retriever composition feature is not supported by all nodes in the cluster" - ); + throw new IllegalArgumentException("[rrf] retriever composition feature is not supported by all nodes in the cluster"); } if (RRFRankPlugin.RANK_RRF_FEATURE.check(XPackPlugin.getSharedLicenseState()) == false) { throw LicenseUtils.newComplianceException("Reciprocal Rank Fusion (RRF)"); From f204578e6976ecc545abed7a3edb03f3a4119920 Mon Sep 17 00:00:00 2001 From: Panagiotis Bailis Date: Wed, 23 Oct 2024 16:27:28 +0300 Subject: [PATCH 7/8] Update 115399.yaml --- docs/changelog/115399.yaml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/docs/changelog/115399.yaml b/docs/changelog/115399.yaml index 9129a68325ce8..bc7f003ae80ec 100644 --- a/docs/changelog/115399.yaml +++ b/docs/changelog/115399.yaml @@ -10,9 +10,8 @@ breaking: In this release (8.16), we have introduced major changes to the retrievers framework and how they can be evaluated, focusing mainly on compound retrievers like `rrf` and `text_similarity_reranker`, which allowed us to support additional search features like collapsing, explaining, aggregations, and highlighting. - To ensure consistency and avoid unexpected failures, we have introduced a new cluster_feature that - all nodes must satisfy, in order for the `rrf` and `text_similarity_reranker` retriever queries to be evaluated. - This guarantees that all nodes are able to take advantage of the new framework and provide compatible responses. + To ensure consistency and avoid unexpected failures, `rrf` and `text_similarity_reranker` retriever queries are no longer compatible + with previous releases ( <= 8.15). As part of the rework, we have also removed the `_rank` property from the responses of an `rrf` retriever. impact: |- - Users will not be able to use the `rrf` and `text_similarity_reranker` retrievers in a mixed cluster scenario From 3083b919fe6075c23e475f2c1294afd74a45f6e3 Mon Sep 17 00:00:00 2001 From: Panagiotis Bailis Date: Wed, 23 Oct 2024 17:51:12 +0300 Subject: [PATCH 8/8] Update 115399.yaml --- docs/changelog/115399.yaml | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/docs/changelog/115399.yaml b/docs/changelog/115399.yaml index bc7f003ae80ec..9f69657a5d167 100644 --- a/docs/changelog/115399.yaml +++ b/docs/changelog/115399.yaml @@ -7,12 +7,20 @@ breaking: title: Reworking RRF retriever to be evaluated during rewrite phase area: REST API details: |- - In this release (8.16), we have introduced major changes to the retrievers framework and how they can be evaluated, - focusing mainly on compound retrievers like `rrf` and `text_similarity_reranker`, which allowed us to support - additional search features like collapsing, explaining, aggregations, and highlighting. - To ensure consistency and avoid unexpected failures, `rrf` and `text_similarity_reranker` retriever queries are no longer compatible - with previous releases ( <= 8.15). - As part of the rework, we have also removed the `_rank` property from the responses of an `rrf` retriever. + In this release (8.16), we have introduced major changes to the retrievers framework + and how they can be evaluated, focusing mainly on compound retrievers + like `rrf` and `text_similarity_reranker`, which allowed us to support full + composability (i.e. any retriever can be nested under any compound retriever), + as well as supporting additional search features like collapsing, explaining, + aggregations, and highlighting. + + To ensure consistency, and given that this rework is not available until 8.16, + `rrf` and `text_similarity_reranker` retriever queries would now + throw an exception in a mixed cluster scenario, where there are nodes + both in current or later (i.e. >= 8.16) and previous ( <= 8.15) versions. + + As part of the rework, we have also removed the `_rank` property from + the responses of an `rrf` retriever. impact: |- - Users will not be able to use the `rrf` and `text_similarity_reranker` retrievers in a mixed cluster scenario with previous releases (i.e. prior to 8.16), and the request will throw an `IllegalArgumentException`.