Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jdconrad committed Feb 26, 2024
1 parent 72ce090 commit 4300470
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ public class RetrieversFeatures implements FeatureSpecification {
public Set<NodeFeature> getFeatures() {
return Set.of(
RetrieverBuilder.RETRIEVERS_SUPPORTED,
StandardRetrieverBuilder.RETRIEVERS_SUPPORTED,
KnnRetrieverBuilder.RETRIEVERS_SUPPORTED
StandardRetrieverBuilder.STANDARD_RETRIEVER_SUPPORTED,
KnnRetrieverBuilder.KNN_RETRIEVER_SUPPORTED
);
}
}
4 changes: 3 additions & 1 deletion x-pack/plugin/rank-rrf/src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
* 2.0.
*/

import org.elasticsearch.xpack.rank.rrf.RRFFeatures;

module org.elasticsearch.rank.rrf {
requires org.apache.lucene.core;
requires org.elasticsearch.base;
Expand All @@ -14,5 +16,5 @@

exports org.elasticsearch.xpack.rank.rrf;

provides org.elasticsearch.features.FeatureSpecification with org.elasticsearch.xpack.rank.rrf.RRFFeatureSpecification;
provides org.elasticsearch.features.FeatureSpecification with RRFFeatures;
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
/**
* A set of features specifically for the rrf plugin.
*/
public class RRFFeatureSpecification implements FeatureSpecification {
public class RRFFeatures implements FeatureSpecification {

@Override
public Set<NodeFeature> getFeatures() {
return Set.of(RRFRetrieverBuilder.RETRIEVERS_SUPPORTED);
return Set.of(RRFRetrieverBuilder.RRF_RETRIEVER_SUPPORTED);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
# 2.0.
#

org.elasticsearch.xpack.rank.rrf.RRFFeatureSpecification
org.elasticsearch.xpack.rank.rrf.RRFFeatures
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public void testRetrieverExtractionErrors() throws IOException {
) {
SearchSourceBuilder ssb = new SearchSourceBuilder();
IllegalArgumentException iae = expectThrows(IllegalArgumentException.class, () -> ssb.parseXContent(parser, true, nf -> true));
assertEquals("[search_after] cannot be declared on multiple retrievers", iae.getMessage());
assertEquals("[search_after] cannot be used in children of compound retrievers", iae.getMessage());
}

try (
Expand All @@ -61,7 +61,7 @@ public void testRetrieverExtractionErrors() throws IOException {
) {
SearchSourceBuilder ssb = new SearchSourceBuilder();
IllegalArgumentException iae = expectThrows(IllegalArgumentException.class, () -> ssb.parseXContent(parser, true, nf -> true));
assertEquals("[terminate_after] cannot be declared on multiple retrievers", iae.getMessage());
assertEquals("[terminate_after] cannot be used in children of compound retrievers", iae.getMessage());
}

try (
Expand All @@ -72,7 +72,7 @@ public void testRetrieverExtractionErrors() throws IOException {
) {
SearchSourceBuilder ssb = new SearchSourceBuilder();
IllegalArgumentException iae = expectThrows(IllegalArgumentException.class, () -> ssb.parseXContent(parser, true, nf -> true));
assertEquals("[sort] cannot be declared on multiple retrievers", iae.getMessage());
assertEquals("[sort] cannot be used in children of compound retrievers", iae.getMessage());
}

try (
Expand All @@ -83,7 +83,7 @@ public void testRetrieverExtractionErrors() throws IOException {
) {
SearchSourceBuilder ssb = new SearchSourceBuilder();
IllegalArgumentException iae = expectThrows(IllegalArgumentException.class, () -> ssb.parseXContent(parser, true, nf -> true));
assertEquals("[min_score] cannot be declared on multiple retrievers", iae.getMessage());
assertEquals("[min_score] cannot be used in children of compound retrievers", iae.getMessage());
}

try (
Expand All @@ -95,7 +95,7 @@ public void testRetrieverExtractionErrors() throws IOException {
) {
SearchSourceBuilder ssb = new SearchSourceBuilder();
IllegalArgumentException iae = expectThrows(IllegalArgumentException.class, () -> ssb.parseXContent(parser, true, nf -> true));
assertEquals("[collapse] cannot be declared on multiple retrievers", iae.getMessage());
assertEquals("[collapse] cannot be used in children of compound retrievers", iae.getMessage());
}

try (
Expand All @@ -106,7 +106,7 @@ public void testRetrieverExtractionErrors() throws IOException {
) {
SearchSourceBuilder ssb = new SearchSourceBuilder();
IllegalArgumentException iae = expectThrows(IllegalArgumentException.class, () -> ssb.parseXContent(parser, true, nf -> true));
assertEquals("[rank] cannot be declared on multiple retrievers", iae.getMessage());
assertEquals("[rank] cannot be used in children of compound retrievers", iae.getMessage());
}
}

Expand Down

0 comments on commit 4300470

Please sign in to comment.