Skip to content

Correct map types #4469

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions specification/_global/search/_types/highlighting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import { Field, Fields } from '@_types/common'
import { integer } from '@_types/Numeric'
import { QueryContainer } from '@_types/query_dsl/abstractions'
import { Dictionary } from '@spec_utils/Dictionary'
import { Dictionary, SingleKeyDictionary } from '@spec_utils/Dictionary'
import { UserDefinedValue } from '@spec_utils/UserDefinedValue'

export enum BoundaryScanner {
Expand Down Expand Up @@ -151,7 +151,9 @@ export class HighlightBase {

export class Highlight extends HighlightBase {
encoder?: HighlighterEncoder
fields: Dictionary<Field, HighlightField>
fields:
| SingleKeyDictionary<Field, HighlightField>
| SingleKeyDictionary<Field, HighlightField>[]
}

export enum HighlighterEncoder {
Expand Down
4 changes: 2 additions & 2 deletions specification/_types/query_dsl/WeightedTokensQuery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/

import { float } from '@_types/Numeric'
import { Dictionary } from '@spec_utils/Dictionary'
import { SingleKeyDictionary } from '@spec_utils/Dictionary'
import { QueryBase } from './abstractions'
import { TokenPruningConfig } from './TokenPruningConfig'

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