-
Notifications
You must be signed in to change notification settings - Fork 19
String column as keyword field #1444
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Adds a new stringColumnIsKeywordField flag that controls whether string columns are exposed as keyword (instead of text) in legacy configs and clickhouse type adapter.
- Introduce
StringColumnIsKeywordFieldin v2 config, translation, and legacy config - Wire the flag through
SchemaTypeAdapterto returnQuesmaTypeKeywordfor"String"when set - Add tests for default and enabled behaviors and a sample YAML config
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| platform/config/test_configs/string_column_is_keyword_field.yaml | New test config enabling the flag |
| platform/config/config_v2_test.go | Tests for default (false) and enabled (true) flag translation |
| platform/config/config_v2.go | Added StringColumnIsKeywordField to v2 struct and translation |
| platform/config/config.go | Added flag to legacy config struct and config print output |
| platform/clickhouse/type_adapter.go | New SchemaTypeAdapter that respects the flag when converting types |
| cmd/main.go | Pass flag into NewSchemaTypeAdapter |
| cmd/experimental/main.go | Same wiring in experimental main |
Comments suppressed due to low confidence (2)
platform/config/config_v2.go:52
- [nitpick] Add a comment above this field explaining its purpose, default value (false), and how it affects downstream behavior to keep configuration docs in sync.
StringColumnIsKeywordField bool `koanf:"stringColumnIsKeywordField"`
platform/clickhouse/type_adapter.go:33
- Add unit tests for
SchemaTypeAdapter.Convertcovering both flag conditions (true and false) so that the new keyword/text behavior is validated.
case "String":
|
/run-it |
jakozaur
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good, but please change configuration name.
platform/config/config_v2.go
Outdated
| Pipelines []Pipeline `koanf:"pipelines"` | ||
| DisableTelemetry bool `koanf:"disableTelemetry"` | ||
| MapFieldsDiscoveringEnabled bool `koanf:"mapFieldsDiscoveringEnabled"` | ||
| StringColumnIsKeywordField bool `koanf:"stringColumnIsKeywordField"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do not like this name.
For example better suggestion:
defaultStringToKeywordType
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed
|
/run-it |
|
Added an extra struct for aux flags. |
Quesma exposes
Stringcolumns as text type fields. This is the default behaviour. When a user performs a full-text search, quesma searches through all text fields. It can lead to massive queries.This PR adds a flag that changes the default type.