MCPcopy Create free account
hub / github.com/blevesearch/bleve / TestDisableDefaultMapping

Function TestDisableDefaultMapping

mapping/mapping_test.go:526–543  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

524}
525
526func TestDisableDefaultMapping(t *testing.T) {
527 indexMapping := NewIndexMapping()
528 indexMapping.DefaultMapping.Enabled = false
529
530 data := map[string]string{
531 "name": "bleve",
532 }
533
534 doc := document.NewDocument("x")
535 err := indexMapping.MapDocument(doc, data)
536 if err != nil {
537 t.Error(err)
538 }
539
540 if len(doc.Fields) > 0 {
541 t.Errorf("expected no fields, got %d", len(doc.Fields))
542 }
543}
544
545func TestInvalidFieldMappingStrict(t *testing.T) {
546 mappingBytes := []byte(`{"includeInAll":true,"name":"a parsed name"}`)

Callers

nothing calls this directly

Calls 4

MapDocumentMethod · 0.95
NewDocumentFunction · 0.92
NewIndexMappingFunction · 0.70
ErrorMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…