MCPcopy Index your code
hub / github.com/blevesearch/bleve / AddFieldMappingsAt

Method AddFieldMappingsAt

mapping/document.go:291–303  ·  view source on GitHub ↗

AddFieldMappingsAt adds one or more FieldMappings at the named sub-document. If the named sub-document doesn't yet exist it is created for you. This is a convenience function to make most common mappings more concise. Otherwise, you would: subMapping := NewDocumentMapping() subMapping.AddFieldMa

(property string, fms ...*FieldMapping)

Source from the content-addressed store, hash-verified

289// subMapping.AddFieldMapping(fieldMapping)
290// parentMapping.AddSubDocumentMapping(property, subMapping)
291func (dm *DocumentMapping) AddFieldMappingsAt(property string, fms ...*FieldMapping) {
292 if dm.Properties == nil {
293 dm.Properties = make(map[string]*DocumentMapping)
294 }
295 sdm, ok := dm.Properties[property]
296 if !ok {
297 sdm = NewDocumentMapping()
298 }
299 for _, fm := range fms {
300 sdm.AddFieldMapping(fm)
301 }
302 dm.Properties[property] = sdm
303}
304
305// AddFieldMapping adds the provided FieldMapping for this section
306// of the document.

Callers 15

createFTSIndexFunction · 0.95
BenchmarkQueryTermFunction · 0.95
BenchmarkQueryTermRangeFunction · 0.95
BenchmarkQueryWildcardFunction · 0.95
BenchmarkQueryDateRangeFunction · 0.95
TestSortedFacetedQueryFunction · 0.95
TestMatchAllScorerFunction · 0.95

Calls 2

AddFieldMappingMethod · 0.80
NewDocumentMappingFunction · 0.70

Tested by 15

createFTSIndexFunction · 0.76
BenchmarkQueryTermFunction · 0.76
BenchmarkQueryTermRangeFunction · 0.76
BenchmarkQueryWildcardFunction · 0.76
BenchmarkQueryDateRangeFunction · 0.76
TestSortedFacetedQueryFunction · 0.76
TestMatchAllScorerFunction · 0.76