-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
enhancementNew feature or requestNew feature or request
Description
In an effort to move things along, I used interface{} for dynamic fields on the internal types used for (un)marshaling.
type completionField struct {
Analyzer string `json:"analyzer,omitempty"`
SearchAnalyzer string `json:"search_analyzer,omitempty"`
SearchQuoteAnalyzer string `json:"search_quote_analyzer,omitempty"`
PreserveSeperators interface{} `json:"preserve_separators,omitempty"`
PreservePositionIncrements interface{} `json:"preserve_position_increments,omitempty"`
MaxInputLength interface{} `json:"max_input_length,omitempty"`
Type FieldType `json:"type"`
}These need to be migrated to either primitive pointer types or dynamic types:
type completionField struct {
Analyzer string `json:"analyzer,omitempty"`
SearchAnalyzer string `json:"search_analyzer,omitempty"`
SearchQuoteAnalyzer string `json:"search_quote_analyzer,omitempty"`
PreserveSeperators *dynamic.Bool `json:"preserve_separators,omitempty"`
PreservePositionIncrements *bool `json:"preserve_position_increments,omitempty"`
MaxInputLength *int `json:"max_input_length,omitempty"`
Type FieldType `json:"type"`
}I'm just not sure which. Things I need to think through:
- If I use primitives, I'll need to add something to the effect of
Float64PtrandCoerceInt64Ptrto the types in the dynamic package. Should I be concerned about the usability of this for the dynamic package? It wont be a pointer to the actual value. - If I use dynamic, that'll be a lot cleaner but I won't be able to cleanly coerce. This is a problem as some accessors currently coerce int values.
Doing so should improve performance of enc/dec.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request