MCPcopy Create free account
hub / github.com/couchbase/cbft / MarshalJSON

Method MarshalJSON

pindex_bleve_doc.go:119–136  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

117}
118
119func (b *BleveDocumentConfig) MarshalJSON() ([]byte, error) {
120 docIDRegexp := ""
121 if b.DocIDRegexp != nil {
122 docIDRegexp = b.DocIDRegexp.String()
123 }
124 tmp := struct {
125 Mode string `json:"mode"`
126 TypeField string `json:"type_field"`
127 DocIDPrefixDelim string `json:"docid_prefix_delim"`
128 DocIDRegexp string `json:"docid_regexp"`
129 }{
130 Mode: b.Mode,
131 TypeField: b.TypeField,
132 DocIDPrefixDelim: b.DocIDPrefixDelim,
133 DocIDRegexp: docIDRegexp,
134 }
135 return json.Marshal(&tmp)
136}
137
138func (b *BleveDocumentConfig) multiCollection() bool {
139 return len(b.CollPrefixLookup) > 1

Callers

nothing calls this directly

Calls 2

MarshalMethod · 0.80
StringMethod · 0.45

Tested by

no test coverage detected