Skip to content

Commit 067f774

Browse files
authored
add QueryLanguages to Query (#853)
1 parent d84ef6e commit 067f774

File tree

2 files changed

+18
-5
lines changed

2 files changed

+18
-5
lines changed

src/Algolia.Search.Test/Serializer/SerializerTest.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,14 @@ public void TestQueryWithList()
9393
Assert.AreEqual(query2.ToQueryString(), "query=&restrictSearchableAttributes=attr1");
9494
}
9595

96+
[Test]
97+
[Parallelizable]
98+
public void TestQueryWithQueryLanguages()
99+
{
100+
Query query = new Query("") { QueryLanguages = new List<string> { "ca", "en" } };
101+
Assert.AreEqual(query.ToQueryString(), "query=&queryLanguages=ca%2Cen");
102+
}
103+
96104
[Test]
97105
[Parallelizable]
98106
public void TestQueryWithMultipleObjects()

src/Algolia.Search/Models/Search/Query.cs

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,11 @@ public Query(string searchQuery = null)
375375
[JsonConverter(typeof(MultiTypeObjectConverter))]
376376
public object IgnorePlurals { get; set; }
377377

378+
/// <summary>
379+
/// Sets the languages to be used by language-specific settings and functionalities such as ignorePlurals, removeStopWords, and CJK word-detection.
380+
/// </summary>
381+
public List<string> QueryLanguages { get; set; }
382+
378383
/// <summary>
379384
/// Removes stop (common) words from the query before executing it.
380385
/// </summary>
@@ -415,16 +420,16 @@ public Query(string searchQuery = null)
415420
public IDictionary<string, object> CustomParameters { get; set; }
416421

417422
/// <summary>
418-
/// Relevancy score to apply to search in virtual index.
419-
/// Bigger value means less, but more relevant results,
423+
/// Relevancy score to apply to search in virtual index.
424+
/// Bigger value means less, but more relevant results,
420425
/// lesser value - more less relevant results
421426
/// </summary>
422427
public int? RelevancyStrictness { get; set; }
423428

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

0 commit comments

Comments
 (0)