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

Commit a36fd5a

Browse files
committed
Use exact match for multifield eg. name.keyword
1 parent 1da1dbe commit a36fd5a

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

platform/parsers/elastic_query_dsl/query_parser.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1199,9 +1199,18 @@ func createSortColumn(fieldName, ordering string) (model.OrderByExpr, error) {
11991199
func ResolveField(ctx context.Context, fieldName string, schemaInstance schema.Schema) string {
12001200
// Alias resolution should occur *after* the query is parsed, not during the parsing
12011201

1202+
isKeyword := false
1203+
if strings.HasSuffix(fieldName, ".keyword") {
1204+
isKeyword = true
1205+
}
12021206
fieldName = strings.TrimSuffix(fieldName, ".keyword")
12031207
fieldName = strings.TrimSuffix(fieldName, ".text")
12041208

1209+
if isKeyword {
1210+
field := schemaInstance.Fields[schema.FieldName(fieldName)]
1211+
field.Type = schema.QuesmaTypeKeyword
1212+
schemaInstance.Fields[schema.FieldName(fieldName)] = field
1213+
}
12051214
if resolvedField, ok := schemaInstance.ResolveField(fieldName); ok {
12061215
return resolvedField.InternalPropertyName.AsString()
12071216
} else {

0 commit comments

Comments
 (0)