Skip to content

Commit 205519c

Browse files
authored
fix(specs): highlight result map definition (#2312)
1 parent 1ee6846 commit 205519c

File tree

14 files changed

+114
-94
lines changed

14 files changed

+114
-94
lines changed

.github/.cache_version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.0.103
1+
0.0.104

config/clients.config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@
100100
"folder": "clients/algoliasearch-client-scala",
101101
"gitRepoId": "algoliasearch-client-scala",
102102
"packageVersion": "2.0.0-alpha.1",
103-
"modelFolder": "src/main/scala/algoliasearch/model",
103+
"modelFolder": "src/main/scala/algoliasearch",
104104
"apiFolder": "src/main/scala/algoliasearch/api",
105105
"customGenerator": "algolia-scala",
106106
"tests": {

generators/src/main/java/com/algolia/codegen/AlgoliaJavaGenerator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,6 @@ public String toEnumVarName(String value, String datatype) {
111111

112112
/** Convert a Seq type to a valid class name. */
113113
private String typeToName(String content) {
114-
return content.trim().replace("<", "Of").replace(">", "");
114+
return content.trim().replace("<", "Of").replace(">", "").replace(",", "").replace(" ", "");
115115
}
116116
}

generators/src/main/java/com/algolia/codegen/AlgoliaKotlinGenerator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ public void processOpts() {
124124

125125
/** Convert a Seq type to a valid class name. */
126126
private String typeToName(String content) {
127-
return content.trim().replace("<", "Of").replace(">", "");
127+
return content.trim().replace("<", "Of").replace(">", "").replace(", ", "").replace(".", "");
128128
}
129129

130130
private void hostForKotlin() {

generators/src/main/java/com/algolia/codegen/AlgoliaScalaGenerator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public void processOpts() {
6262

6363
/** Convert a Seq type to a valid class name. */
6464
private String typeToName(String content) {
65-
return content.trim().replace("[", "Of").replace("]", "");
65+
return content.trim().replace("[", "Of").replace("]", "").replace(".", "").replace(", ", "");
6666
}
6767

6868
@Override
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
highlightResultOption:
2+
type: object
3+
description: Show highlighted section and words matched on a query.
4+
additionalProperties: false
5+
x-discriminator-fields:
6+
- matchLevel
7+
- value
8+
- matchedWords
9+
properties:
10+
value:
11+
$ref: '#/highlightedValue'
12+
matchLevel:
13+
$ref: '#/matchLevel'
14+
matchedWords:
15+
type: array
16+
description: List of words from the query that matched the object.
17+
example: ['action']
18+
items:
19+
type: string
20+
fullyHighlighted:
21+
type: boolean
22+
description: Whether the entire attribute value is highlighted.
23+
required:
24+
- value
25+
- matchLevel
26+
- matchedWords
27+
28+
highlightedValue:
29+
type: string
30+
description: Markup text with `facetQuery` matches highlighted.
31+
example: '<em>George</em> <em>Clo</em>oney'
32+
33+
matchLevel:
34+
type: string
35+
description: Indicates how well the attribute matched the search query.
36+
enum: [none, partial, full]
37+
38+
highlightResultOptionMap:
39+
type: object
40+
description: Show highlighted section and words matched on a query.
41+
additionalProperties:
42+
$ref: '#/highlightResultOption'
43+
44+
highlightResult:
45+
oneOf:
46+
- $ref: '#/highlightResultOption'
47+
- $ref: '#/highlightResultOptionMap'
48+
49+
highlightResultMap:
50+
type: object
51+
description: Show highlighted section and words matched on a query.
52+
additionalProperties:
53+
$ref: '#/highlightResult'
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
snippetResultOption:
2+
type: object
3+
description: Snippeted attributes show parts of the matched attributes. Only returned when attributesToSnippet is non-empty.
4+
additionalProperties: false
5+
properties:
6+
value:
7+
$ref: './HighlightResult.yml#/highlightedValue'
8+
matchLevel:
9+
$ref: './HighlightResult.yml#/matchLevel'
10+
required:
11+
- value
12+
- matchLevel
13+
14+
snippetResultOptionMap:
15+
type: object
16+
description: Snippeted attributes show parts of the matched attributes. Only returned when attributesToSnippet is non-empty.
17+
additionalProperties:
18+
$ref: '#/snippetResultOption'
19+
20+
snippetResult:
21+
oneOf:
22+
- $ref: '#/snippetResultOption'
23+
- $ref: '#/snippetResultOptionMap'
24+
25+
snippetResultMap:
26+
type: object
27+
description: Snippeted attributes show parts of the matched attributes. Only returned when attributesToSnippet is non-empty.
28+
additionalProperties:
29+
$ref: '#/snippetResult'

specs/recommend/common/schemas/RecommendationsResponse.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ recommendHit:
3131
objectID:
3232
$ref: '../../../common/parameters.yml#/objectID'
3333
_highlightResult:
34-
$ref: '../../../search/common/schemas/Hit.yml#/highlightResultMap'
34+
$ref: '../../../common/schemas/HighlightResult.yml#/highlightResultMap'
3535
_snippetResult:
36-
$ref: '../../../search/common/schemas/Hit.yml#/snippetResultMap'
36+
$ref: '../../../common/schemas/SnippetResult.yml#/snippetResultMap'
3737
_rankingInfo:
3838
$ref: '../../../search/common/schemas/Hit.yml#/rankingInfo'
3939
_distinctSeqID:

specs/search/common/schemas/Hit.yml

Lines changed: 2 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ hit:
99
objectID:
1010
$ref: '../../../common/parameters.yml#/objectID'
1111
_highlightResult:
12-
$ref: '#/highlightResultMap'
12+
$ref: '../../../common/schemas/HighlightResult.yml#/highlightResultMap'
1313
_snippetResult:
14-
$ref: '#/snippetResultMap'
14+
$ref: '../../../common/schemas/SnippetResult.yml#/snippetResultMap'
1515
_rankingInfo:
1616
$ref: '#/rankingInfo'
1717
_distinctSeqID:
@@ -21,68 +21,6 @@ hit:
2121
_distinctSeqID:
2222
type: integer
2323

24-
highlightResultOption:
25-
type: object
26-
description: Show highlighted section and words matched on a query.
27-
additionalProperties: false
28-
properties:
29-
value:
30-
$ref: '#/highlightedValue'
31-
matchLevel:
32-
$ref: '#/matchLevel'
33-
matchedWords:
34-
type: array
35-
description: List of words from the query that matched the object.
36-
example: ['action']
37-
items:
38-
type: string
39-
fullyHighlighted:
40-
type: boolean
41-
description: Whether the entire attribute value is highlighted.
42-
required:
43-
- value
44-
- matchLevel
45-
- matchedWords
46-
47-
highlightResult:
48-
oneOf:
49-
- $ref: '#/highlightResultOption'
50-
- type: array
51-
items:
52-
$ref: '#/highlightResultOption'
53-
54-
highlightResultMap:
55-
type: object
56-
description: Show highlighted section and words matched on a query.
57-
additionalProperties:
58-
$ref: '#/highlightResult'
59-
60-
snippetResultOption:
61-
type: object
62-
description: Snippeted attributes show parts of the matched attributes. Only returned when attributesToSnippet is non-empty.
63-
additionalProperties: false
64-
properties:
65-
value:
66-
$ref: '#/highlightedValue'
67-
matchLevel:
68-
$ref: '#/matchLevel'
69-
required:
70-
- value
71-
- matchLevel
72-
73-
snippetResult:
74-
oneOf:
75-
- $ref: '#/snippetResultOption'
76-
- type: array
77-
items:
78-
$ref: '#/snippetResultOption'
79-
80-
snippetResultMap:
81-
type: object
82-
description: Snippeted attributes show parts of the matched attributes. Only returned when attributesToSnippet is non-empty.
83-
additionalProperties:
84-
$ref: '#/snippetResult'
85-
8624
rankingInfo:
8725
type: object
8826
additionalProperties: false
@@ -134,16 +72,6 @@ rankingInfo:
13472
- filters
13573
- userScore
13674

137-
highlightedValue:
138-
type: string
139-
description: Markup text with `facetQuery` matches highlighted.
140-
example: '<em>George</em> <em>Clo</em>oney'
141-
142-
matchLevel:
143-
type: string
144-
description: Indicates how well the attribute matched the search query.
145-
enum: [none, partial, full]
146-
14775
matchedGeoLocation:
14876
type: object
14977
properties:

specs/search/common/schemas/SearchForFacetValuesResponse.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ searchForFacetValuesResponse:
2222
example: 'Mobile phone'
2323
type: string
2424
highlighted:
25-
$ref: '../../common/schemas/Hit.yml#/highlightedValue'
25+
$ref: '../../../common/schemas/HighlightResult.yml#/highlightedValue'
2626
count:
2727
description: Number of records containing this facet value. This takes into account the extra search parameters specified in the query. Like for a regular search query, the [counts may not be exhaustive](https://support.algolia.com/hc/en-us/articles/4406975248145-Why-are-my-facet-and-hit-counts-not-accurate-).
2828
type: integer

0 commit comments

Comments
 (0)