Skip to content
This repository was archived by the owner on Nov 7, 2025. It is now read-only.

Commit 623cc1f

Browse files
committed
WIP
1 parent 094f3a6 commit 623cc1f

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

platform/clickhouse/type_adapter.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ func (c SchemaTypeAdapter) Convert(s string) (schema.QuesmaType, bool) {
2222
}
2323

2424
switch s {
25-
case "String":
26-
return schema.QuesmaTypeText, true
25+
case "String": // This should be treated as a text type (full text search). But ingest do not distinguish between LowCardinality and String.
26+
return schema.QuesmaTypeKeyword, true
2727
case "LowCardinality(String)", "UUID", "FixedString":
2828
return schema.QuesmaTypeKeyword, true
2929
case "Int", "Int8", "Int16", "Int32", "Int64":

platform/schema/registry.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,12 @@ func (s *schemaRegistry) populateSchemaFromTableDefinition(definitions map[strin
326326
}
327327
if existing, exists := fields[propertyName]; !exists {
328328
if quesmaType, resolved := s.dataSourceTypeAdapter.Convert(column.Type); resolved {
329+
330+
// in most cases `message` field is a text field, it can be used for full-text search
331+
if quesmaType.Name == QuesmaTypeKeyword.Name && column.Name == "message" {
332+
quesmaType = QuesmaTypeText // special case for message field, we want it to be text
333+
}
334+
329335
fields[propertyName] = Field{PropertyName: propertyName, InternalPropertyName: FieldName(column.Name), InternalPropertyType: column.Type, Type: quesmaType, Origin: column.Origin}
330336
} else {
331337
logger.Debug().Msgf("type %s not supported, falling back to keyword", column.Type)

0 commit comments

Comments
 (0)