Ignore/Disable Sections of Documents

Sometimes documents contains sections of content you simply want to ignore. Let’s imagine we have the following structure:

  1. type Person struct {
  2. Name string
  3. Addr Address
  4. }

And, we’ve decided we don’t want to index or store any of the address data. We can accomplish this by using the following DocumentMapping.

  1. addressMapping := bleve.NewDocumentDisabledMapping()
  2. personMapping := bleve.NewDocumentMapping()
  3. personMapping.AddSubDocumentMapping("Addr", addressMapping)