| 117 | } |
| 118 | |
| 119 | func (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 | |
| 138 | func (b *BleveDocumentConfig) multiCollection() bool { |
| 139 | return len(b.CollPrefixLookup) > 1 |