Skip to content

Commit

Permalink
add QueryLanguages to Query (#853)
Browse files Browse the repository at this point in the history
  • Loading branch information
morganleroi committed Feb 26, 2024
1 parent d84ef6e commit 067f774
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
8 changes: 8 additions & 0 deletions src/Algolia.Search.Test/Serializer/SerializerTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,14 @@ public void TestQueryWithList()
Assert.AreEqual(query2.ToQueryString(), "query=&restrictSearchableAttributes=attr1");
}

[Test]
[Parallelizable]
public void TestQueryWithQueryLanguages()
{
Query query = new Query("") { QueryLanguages = new List<string> { "ca", "en" } };
Assert.AreEqual(query.ToQueryString(), "query=&queryLanguages=ca%2Cen");
}

[Test]
[Parallelizable]
public void TestQueryWithMultipleObjects()
Expand Down
15 changes: 10 additions & 5 deletions src/Algolia.Search/Models/Search/Query.cs
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,11 @@ public Query(string searchQuery = null)
[JsonConverter(typeof(MultiTypeObjectConverter))]
public object IgnorePlurals { get; set; }

/// <summary>
/// Sets the languages to be used by language-specific settings and functionalities such as ignorePlurals, removeStopWords, and CJK word-detection.
/// </summary>
public List<string> QueryLanguages { get; set; }

/// <summary>
/// Removes stop (common) words from the query before executing it.
/// </summary>
Expand Down Expand Up @@ -415,16 +420,16 @@ public Query(string searchQuery = null)
public IDictionary<string, object> CustomParameters { get; set; }

/// <summary>
/// Relevancy score to apply to search in virtual index.
/// Bigger value means less, but more relevant results,
/// Relevancy score to apply to search in virtual index.
/// Bigger value means less, but more relevant results,
/// lesser value - more less relevant results
/// </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.
/// 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; }
Expand Down

0 comments on commit 067f774

Please sign in to comment.