()
| 46 | } |
| 47 | |
| 48 | func ExampleDocumentMapping_AddFieldMappingsAt() { |
| 49 | // you can only add field mapping to those properties which already have a document mapping |
| 50 | documentMapping := NewDocumentMapping() |
| 51 | subDocumentMapping := NewDocumentMapping() |
| 52 | documentMapping.AddSubDocumentMapping("NestedProperty", subDocumentMapping) |
| 53 | |
| 54 | fieldMapping := NewTextFieldMapping() |
| 55 | fieldMapping.Analyzer = "en" |
| 56 | documentMapping.AddFieldMappingsAt("NestedProperty", fieldMapping) |
| 57 | |
| 58 | fmt.Println(len(documentMapping.Properties["NestedProperty"].Fields)) |
| 59 | // Output: |
| 60 | // 1 |
| 61 | } |
nothing calls this directly
no test coverage detected
searching dependent graphs…