Skip to content
Snippets Groups Projects
Commit 4b1a322d authored by Francé Wilke's avatar Francé Wilke
Browse files

Fix mapping (opensearch)

parent e4e4d43e
No related branches found
No related tags found
No related merge requests found
......@@ -221,6 +221,7 @@ func structMappingProperties(structType reflect.Type) (map[string]MappingPropert
}
// allow user to change that with a search tag on the field
skip := false
switch structField.Tag.Get("search") {
case "":
// no change
......@@ -235,13 +236,19 @@ func structMappingProperties(structType reflect.Type) (map[string]MappingPropert
case "object":
fieldMapping.Type = "object"
fieldMapping.Enabled = false
case "-":
// do not include in mapping
skip = true
default:
return nil, errors.Errorf("Unknown search:\"%s\" on field(%s)", structField.Tag.Get("search"), structField.Name)
}
// add to index spec
if !skip {
properties[fieldName] = fieldMapping
}
}
return properties, nil
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment