Skip to content

Commit

Permalink
Feat(query): add enableReRanking query parameter (#774)
Browse files Browse the repository at this point in the history
* feat: add enabledReRanking parameter

* tests: add boolean in query tests
  • Loading branch information
TomKlotzPro committed Jun 8, 2021
1 parent 09b62e2 commit f2c10db
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Algolia.Search.Test/Serializer/SerializerTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ public void TestQueryWithUTF8()
[Parallelizable]
public void TestQueryWithBooleanParam()
{
Query query = new Query("") { AroundLatLngViaIP = true };
Assert.AreEqual(query.ToQueryString(), "query=&aroundLatLngViaIP=true");
Query query = new Query("") { AroundLatLngViaIP = true, EnableReRanking = false };
Assert.AreEqual(query.ToQueryString(), "query=&aroundLatLngViaIP=true&enableReRanking=false");
}

[Test]
Expand Down
8 changes: 8 additions & 0 deletions src/Algolia.Search/Models/Search/Query.cs
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,14 @@ public Query(string searchQuery = null)
/// </summary>
public int? RelevancyStrictness { get; set; }

/// <summary>
/// You need to turn on Dynamic Re-Ranking on your index
/// for it to have an effect on your search results.
/// You can do this through the Re-Ranking page on the dashboard.
/// This parameter is only used to turn off Dynamic Re-Ranking (with false) at search time.
/// </summary>
public bool? EnableReRanking { get; set; }

/// <summary>
/// Returns the Query as a query string
/// Example : "query= distinct=0"
Expand Down

0 comments on commit f2c10db

Please sign in to comment.