diff --git a/algoliasearch-core/src/main/java/com/algolia/search/models/indexing/SearchParameters.java b/algoliasearch-core/src/main/java/com/algolia/search/models/indexing/SearchParameters.java index 66acdd87a..0821fa2ad 100644 --- a/algoliasearch-core/src/main/java/com/algolia/search/models/indexing/SearchParameters.java +++ b/algoliasearch-core/src/main/java/com/algolia/search/models/indexing/SearchParameters.java @@ -676,6 +676,15 @@ public T setRelevancyStrictness(Integer relevancyStrictness) { return getThis(); } + public Boolean getEnableReRanking() { + return enableReRanking; + } + + public T setEnableReRanking(Boolean enableReRanking) { + this.enableReRanking = enableReRanking; + return getThis(); + } + public String toParam() { return QueryStringUtils.buildQueryAsQueryParams(this); } @@ -709,6 +718,7 @@ public String toParam() { protected Boolean percentileComputation; protected List queryLanguages; protected Boolean decompoundQuery; + protected Boolean enableReRanking; /* attributes */ protected List attributesToRetrieve; diff --git a/algoliasearch-core/src/test/java/com/algolia/search/JacksonParserTest.java b/algoliasearch-core/src/test/java/com/algolia/search/JacksonParserTest.java index 3183998b0..683a90682 100644 --- a/algoliasearch-core/src/test/java/com/algolia/search/JacksonParserTest.java +++ b/algoliasearch-core/src/test/java/com/algolia/search/JacksonParserTest.java @@ -670,6 +670,12 @@ void queryWithDistinct() { assertThat(query.toParam()).isEqualTo("query=&distinct=0"); } + @Test + void queryWitEnabledReRanking() { + Query query = new Query("").setEnableReRanking(false); + assertThat(query.toParam()).isEqualTo("enableReRanking=false&query="); + } + @Test void queryWithMultipleParams() { Query query =