Skip to content

Commit 4924c02

Browse files
committed
Release 1.6.2
2 parents 6f421cc + 1b9aa4a commit 4924c02

File tree

19 files changed

+1442
-189
lines changed

19 files changed

+1442
-189
lines changed

CHANGELOG.md

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
# 1.6.2
2+
3+
### Added
4+
- Settings: `attributeCriteriaComputedByMinProximity` parameter
5+
6+
### Changed
7+
- Update Kotlin to 1.4.2
8+
9+
### Experimental
10+
- AnswersQuery: `queryLanguages` required (non-nullable)
11+
- AnswersQuery: implements `SearchParameters` for convenience (delegated to `params`)
12+
113
# 1.6.1
214

315
### Fixed
@@ -6,12 +18,12 @@
618

719
# 1.6.0
820

9-
### Added
10-
- _Experimental_: Algolia Answers API
11-
1221
### Changed
1322
- Update Ktor to `1.4.2`, transitively Kotlin serialization to `1.0.1`
1423

24+
### Experimental
25+
- _Experimental_: Algolia Answers API
26+
1527
# 1.5.2
1628

1729
### Fixed

build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ buildscript {
1313
}
1414

1515
plugins {
16-
kotlin("multiplatform") version "1.4.20"
17-
kotlin("plugin.serialization") version "1.4.20"
16+
kotlin("multiplatform") version "1.4.21"
17+
kotlin("plugin.serialization") version "1.4.21"
1818
id("maven-publish")
1919
}
2020

buildSrc/src/main/kotlin/Ktor.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ object Ktor : Dependency {
22

33
override val group = "io.ktor"
44
override val artifact = "ktor"
5-
override val version = "1.4.2"
5+
override val version = "1.5.0"
66
}

buildSrc/src/main/kotlin/Library.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ object Library : Dependency {
22

33
override val group = "com.algolia"
44
override val artifact = "algoliasearch-client-kotlin"
5-
override val version = "1.6.1"
5+
override val version = "1.6.2"
66
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
package com.algolia.search.model.params
2+
3+
public interface AnswersParameters : CommonSearchParameters {
4+
5+
/**
6+
* The query for which to retrieve results. Cannot be empty or spaces only.
7+
* [Documentation][https://www.algolia.com/doc/rest-api/answers/#method-param-params]
8+
*/
9+
public var query: String
10+
}
Lines changed: 221 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,221 @@
1+
package com.algolia.search.model.params
2+
3+
import com.algolia.search.model.Attribute
4+
import com.algolia.search.model.search.AlternativesAsExact
5+
import com.algolia.search.model.search.ExactOnSingleWordQuery
6+
import com.algolia.search.model.search.IgnorePlurals
7+
import com.algolia.search.model.search.Language
8+
import com.algolia.search.model.search.QueryType
9+
import com.algolia.search.model.search.RemoveStopWords
10+
import com.algolia.search.model.search.RemoveWordIfNoResults
11+
import com.algolia.search.model.search.ResponseFields
12+
import com.algolia.search.model.search.SortFacetsBy
13+
import com.algolia.search.model.search.TypoTolerance
14+
import com.algolia.search.model.settings.AdvancedSyntaxFeatures
15+
import com.algolia.search.model.settings.Distinct
16+
17+
public interface BaseParameters {
18+
19+
/**
20+
* Gives control over which attributes to retrieve and which not to retrieve.
21+
* Engine default: [*]
22+
* [Documentation][https://www.algolia.com/doc/api-reference/api-parameters/attributesToRetrieve/?language=kotlin]
23+
*/
24+
public var attributesToRetrieve: List<Attribute>?
25+
26+
/**
27+
* Maximum number of facet values to return for each facet during a regular search.
28+
* Engine default: 100
29+
* [Documentation][https://www.algolia.com/doc/api-reference/api-parameters/maxValuesPerFacet/?language=kotlin]
30+
*/
31+
public var maxValuesPerFacet: Int?
32+
33+
/**
34+
* Engine default: [SortFacetsBy.Count]
35+
* Controls how facet values are sorted.
36+
* [Documentation][https://www.algolia.com/doc/api-reference/api-parameters/sortFacetValuesBy/?language=kotlin]
37+
*/
38+
public var sortFacetsBy: SortFacetsBy?
39+
40+
/**
41+
* List of attributes to highlight.
42+
* Engine default: [*]
43+
* [Documentation][https://www.algolia.com/doc/api-reference/api-parameters/attributesToHighlight/?language=kotlin]
44+
*/
45+
public var attributesToHighlight: List<Attribute>?
46+
47+
/**
48+
* The HTML string to insert before the highlighted parts in all highlight and snippet results.
49+
* Needs to be used along [highlightPostTag].
50+
* Engine default: "<em>"
51+
* [Documentation][https://www.algolia.com/doc/api-reference/api-parameters/highlightPreTag/?language=kotlin]
52+
*/
53+
public var highlightPreTag: String?
54+
55+
/**
56+
* The HTML string to insert after the highlighted parts in all highlight and snippet results.
57+
* Needs to be used along [highlightPreTag].
58+
* Engine default: "</em>"
59+
* [Documentation][https://www.algolia.com/doc/api-reference/api-parameters/highlightPostTag/?language=kotlin]
60+
*/
61+
public var highlightPostTag: String?
62+
63+
/**
64+
* String used as an ellipsis indicator when a snippet is truncated.
65+
* Engine default: "…" (U+2026, HORIZONTAL ELLIPSIS)
66+
* [Documentation][https://www.algolia.com/doc/api-reference/api-parameters/snippetEllipsisText/?language=kotlin]
67+
*/
68+
public var snippetEllipsisText: String?
69+
70+
/**
71+
* Restrict highlighting and snippeting to items that matched the query.
72+
* Engine default: false
73+
* [Documentation][https://www.algolia.com/doc/api-reference/api-parameters/restrictHighlightAndSnippetArrays/?language=kotlin]
74+
*/
75+
public var restrictHighlightAndSnippetArrays: Boolean?
76+
77+
/**
78+
* Minimum number of characters a word in the query name must contain to accept matches with 1 typo.
79+
* Engine default: 4
80+
* [Documentation][https://www.algolia.com/doc/api-reference/api-parameters/minWordSizefor1Typo/?language=kotlin]
81+
*/
82+
public var minWordSizeFor1Typo: Int?
83+
84+
/**
85+
* Minimum number of characters a word in the query name must contain to accept matches with 2 typos.
86+
* Engine default: 8
87+
* [Documentation][https://www.algolia.com/doc/api-reference/api-parameters/minWordSizefor2Typos/?language=kotlin]
88+
*/
89+
public var minWordSizeFor2Typos: Int?
90+
91+
/**
92+
* Controls whether typo tolerance is enabled and how it is applied.
93+
* Engine defaults: true
94+
* [Documentation][https://www.algolia.com/doc/api-reference/api-parameters/typoTolerance/?language=kotlin]
95+
*/
96+
public var typoTolerance: TypoTolerance?
97+
98+
/**
99+
* Whether to allow typos on numbers (“numeric tokens”) in the query name.
100+
* Engine default: true
101+
* [Documentation][https://www.algolia.com/doc/api-reference/api-parameters/allowTyposOnNumericTokens/?language=kotlin]
102+
*/
103+
public var allowTyposOnNumericTokens: Boolean?
104+
105+
/**
106+
* List of attributes on which you want to disable typo tolerance.
107+
* Engine default: []
108+
* [Documentation][https://www.algolia.com/doc/api-reference/api-parameters/disabletypotoleranceonattributes/?language=kotlin]
109+
*/
110+
public var disableTypoToleranceOnAttributes: List<Attribute>?
111+
112+
/**
113+
* Treats singular, plurals, and other forms of declensions as matching terms.
114+
* Engine default: false
115+
* [Documentation][https://www.algolia.com/doc/api-reference/api-parameters/ignorePlurals/?language=kotlin]
116+
*/
117+
public var ignorePlurals: IgnorePlurals?
118+
119+
/**
120+
* Removes stop (task) words from the query before executing it.
121+
* Engine default: false
122+
* [Documentation][https://www.algolia.com/doc/api-reference/api-parameters/removeStopWords/?language=kotlin]
123+
*/
124+
public var removeStopWords: RemoveStopWords?
125+
126+
/**
127+
* Whether rules should be globally enabled.
128+
* Engine default: true
129+
* [Documentation][https://www.algolia.com/doc/api-reference/api-parameters/enableRules/?language=kotlin]
130+
*/
131+
public var enableRules: Boolean?
132+
133+
/**
134+
* Controls if and how query words are interpreted as [prefixes][https://www.algolia.com/doc/guides/textual-relevance/prefix-search/?language=kotlin].
135+
* Engine default: [QueryType.PrefixLast]
136+
* [Documentation][https://www.algolia.com/doc/api-reference/api-parameters/queryType/?language=kotlin]
137+
*/
138+
public var queryType: QueryType?
139+
140+
/**
141+
* Selects a strategy to remove words from the query when it doesn’t match any hits.
142+
* Engine default: [RemoveWordIfNoResults.None]
143+
* [Documentation][https://www.algolia.com/doc/api-reference/api-parameters/removeWordsIfNoResults/?language=kotlin]
144+
*/
145+
public var removeWordsIfNoResults: RemoveWordIfNoResults?
146+
147+
/**
148+
* Enables the advanced query syntax.
149+
* Engine default: false
150+
* [Documentation][https://www.algolia.com/doc/api-reference/api-parameters/advancedSyntax/?language=kotlin]
151+
*/
152+
public var advancedSyntax: Boolean?
153+
154+
/**
155+
* A list of words that should be considered as optional when found in the query.
156+
* Engine default: []
157+
* [Documentation][https://www.algolia.com/doc/api-reference/api-parameters/optionalWords/?language=kotlin]
158+
*/
159+
public var optionalWords: List<String>?
160+
161+
/**
162+
* List of [Attribute] on which you want to disable the exact ranking criterion.
163+
* Engine default: []
164+
* [Documentation][https://www.algolia.com/doc/api-reference/api-parameters/disableExactOnAttributes/?language=kotlin]
165+
*/
166+
public var disableExactOnAttributes: List<Attribute>?
167+
168+
/**
169+
* Controls how the exact ranking criterion is computed when the query contains only one word.
170+
* Engine default: [ExactOnSingleWordQuery.Attribute]
171+
* [Documentation][https://www.algolia.com/doc/api-reference/api-parameters/exactOnSingleWordQuery/?language=kotlin]
172+
*/
173+
public var exactOnSingleWordQuery: ExactOnSingleWordQuery?
174+
175+
/**
176+
* List of alternatives that should be considered an exact match by the exact ranking criterion.
177+
* Engine default: [[AlternativesAsExact.IgnorePlurals], [AlternativesAsExact.SingleWordSynonym]]
178+
* [Documentation][https://www.algolia.com/doc/api-reference/api-parameters/alternativesAsExact/?language=kotlin]
179+
*/
180+
public var alternativesAsExact: List<AlternativesAsExact>?
181+
182+
/**
183+
* [Documentation][https://www.algolia.com/doc/api-reference/api-parameters//?language=kotlin]
184+
*/
185+
public var advancedSyntaxFeatures: List<AdvancedSyntaxFeatures>?
186+
187+
/**
188+
* Enables de-duplication or grouping of results.
189+
* Engine default: 0
190+
* [Documentation][https://www.algolia.com/doc/api-reference/api-parameters/distinct/?language=kotlin]
191+
*/
192+
public var distinct: Distinct?
193+
194+
/**
195+
* Whether to highlight and snippet the original word that matches the synonym or the synonym itself.
196+
* Engine default: true
197+
* [Documentation][https://www.algolia.com/doc/api-reference/api-parameters//?language=kotlin]
198+
*/
199+
public var replaceSynonymsInHighlight: Boolean?
200+
201+
/**
202+
* Precision of the proximity ranking criterion.
203+
* Engine default: 1
204+
* [Documentation][https://www.algolia.com/doc/api-reference/api-parameters/minProximity/?language=kotlin]
205+
*/
206+
public var minProximity: Int?
207+
208+
/**
209+
* Choose which fields the response will contain. Applies to search and browse queries.
210+
* Engine default: [ResponseFields.All]
211+
* [Documentation][https://www.algolia.com/doc/api-reference/api-parameters/responseFields/?language=kotlin]
212+
*/
213+
public var responseFields: List<ResponseFields>?
214+
215+
/**
216+
* Maximum number of facet hits to return during a search for facet values.
217+
* Engine default: 10
218+
* [Documentation][https://www.algolia.com/doc/api-reference/api-parameters/maxFacetHits/?language=kotlin]
219+
*/
220+
public var maxFacetHits: Int?
221+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
package com.algolia.search.model.params
2+
3+
import com.algolia.search.model.search.Language
4+
import com.algolia.search.model.search.Snippet
5+
6+
public interface CommonParameters : BaseParameters {
7+
8+
/**
9+
* List of attributes to snippet.
10+
* Engine default: []
11+
* [Documentation][https://www.algolia.com/doc/api-reference/api-parameters/attributesToSnippet/?language=kotlin]
12+
*/
13+
public var attributesToSnippet: List<Snippet>?
14+
15+
/**
16+
* Set the number of hits per page.
17+
* Engine default: 20
18+
* [Documentation][https://www.algolia.com/doc/api-reference/api-parameters/hitsPerPage/?language=kotlin]
19+
*/
20+
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>?
29+
}

0 commit comments

Comments
 (0)