Skip to content

Commit b5c4c75

Browse files
committed
refact(answers): make queryLanguages non-nullable
1 parent 01d99d4 commit b5c4c75

File tree

4 files changed

+10
-19
lines changed

4 files changed

+10
-19
lines changed

src/commonMain/kotlin/com/algolia/search/model/params/BaseParameters.kt

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -123,14 +123,6 @@ public interface BaseParameters {
123123
*/
124124
public var removeStopWords: RemoveStopWords?
125125

126-
/**
127-
* Sets the languages to be used by language-specific settings and functionalities such as [ignorePlurals],
128-
* [removeStopWords], and [CJK word-detection][https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/normalization/#using-a-language-specific-dictionary-for-cjk-words].
129-
* Engine default: []
130-
* [Documentation][https://www.algolia.com/doc/api-reference/api-parameters/queryLanguages/?language=kotlin]
131-
*/
132-
public var queryLanguages: List<Language>?
133-
134126
/**
135127
* Whether rules should be globally enabled.
136128
* Engine default: true

src/commonMain/kotlin/com/algolia/search/model/params/CommonParameters.kt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.algolia.search.model.params
22

3+
import com.algolia.search.model.search.Language
34
import com.algolia.search.model.search.Snippet
45

56
public interface CommonParameters : BaseParameters {
@@ -17,4 +18,12 @@ public interface CommonParameters : BaseParameters {
1718
* [Documentation][https://www.algolia.com/doc/api-reference/api-parameters/hitsPerPage/?language=kotlin]
1819
*/
1920
public var hitsPerPage: Int?
21+
22+
/**
23+
* Sets the languages to be used by language-specific settings and functionalities such as [ignorePlurals],
24+
* [removeStopWords], and [CJK word-detection][https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/normalization/#using-a-language-specific-dictionary-for-cjk-words].
25+
* Engine default: []
26+
* [Documentation][https://www.algolia.com/doc/api-reference/api-parameters/queryLanguages/?language=kotlin]
27+
*/
28+
public var queryLanguages: List<Language>?
2029
}

src/commonMain/kotlin/com/algolia/search/model/search/AnswersQuery.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public data class AnswersQuery(
2828
* The languages in the query.
2929
* Currently only supports `en`.
3030
*/
31-
@SerialName(KeyQueryLanguages) override var queryLanguages: List<Language>? = null,
31+
@SerialName(KeyQueryLanguages) var queryLanguages: List<Language>,
3232

3333
/**
3434
* Engine default: ["*"]

src/commonMain/kotlin/com/algolia/search/model/search/SearchParameters.kt

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ import com.algolia.search.serialize.KeyOptionalWords
5252
import com.algolia.search.serialize.KeyPage
5353
import com.algolia.search.serialize.KeyPercentileComputation
5454
import com.algolia.search.serialize.KeyPersonalizationImpact
55-
import com.algolia.search.serialize.KeyQueryLanguages
5655
import com.algolia.search.serialize.KeyQueryType
5756
import com.algolia.search.serialize.KeyRemoveStopWords
5857
import com.algolia.search.serialize.KeyRemoveWordsIfNoResults
@@ -305,15 +304,6 @@ public data class SearchParameters(
305304
*/
306305
@SerialName(KeyRemoveStopWords) override var removeStopWords: RemoveStopWords? = null,
307306

308-
/**
309-
* Sets the queryLanguage to be used by language-specific settings and functionalities such as
310-
* [ignorePlurals], [removeStopWords], and
311-
* [CJK word-detection][https://www.algolia.com/doc/guides/textual-relevance/queryLanguage/#using-a-language-specific-dictionary-for-cjk-words].
312-
* Engine default: []
313-
* [Documentation][https://www.algolia.com/doc/api-reference/api-parameters/queryLanguages/?language=kotlin]
314-
*/
315-
@SerialName(KeyQueryLanguages) override var queryLanguages: List<Language>? = null,
316-
317307
/**
318308
* Whether rules should be globally enabled.
319309
* Engine default: true

0 commit comments

Comments
 (0)