Skip to content

Commit 49d8131

Browse files
authored
Correct map types (#4469)
* correct map types * pretty
1 parent 07b12a2 commit 49d8131

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

specification/_global/search/_types/highlighting.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
import { Field, Fields } from '@_types/common'
2121
import { integer } from '@_types/Numeric'
2222
import { QueryContainer } from '@_types/query_dsl/abstractions'
23-
import { Dictionary } from '@spec_utils/Dictionary'
23+
import { Dictionary, SingleKeyDictionary } from '@spec_utils/Dictionary'
2424
import { UserDefinedValue } from '@spec_utils/UserDefinedValue'
2525

2626
export enum BoundaryScanner {
@@ -151,7 +151,9 @@ export class HighlightBase {
151151

152152
export class Highlight extends HighlightBase {
153153
encoder?: HighlighterEncoder
154-
fields: Dictionary<Field, HighlightField>
154+
fields:
155+
| SingleKeyDictionary<Field, HighlightField>
156+
| SingleKeyDictionary<Field, HighlightField>[]
155157
}
156158

157159
export enum HighlighterEncoder {

specification/_types/query_dsl/WeightedTokensQuery.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
*/
1919

2020
import { float } from '@_types/Numeric'
21-
import { Dictionary } from '@spec_utils/Dictionary'
21+
import { SingleKeyDictionary } from '@spec_utils/Dictionary'
2222
import { QueryBase } from './abstractions'
2323
import { TokenPruningConfig } from './TokenPruningConfig'
2424

@@ -27,7 +27,7 @@ import { TokenPruningConfig } from './TokenPruningConfig'
2727
*/
2828
export class WeightedTokensQuery extends QueryBase {
2929
/** The tokens representing this query */
30-
tokens: Dictionary<string, float>
30+
tokens: SingleKeyDictionary<string, float>[]
3131
/** Token pruning configurations */
3232
pruning_config?: TokenPruningConfig
3333
}

0 commit comments

Comments
 (0)