(params, sourceName string)
| 135 | } |
| 136 | |
| 137 | func scopeCollNames(params, sourceName string) (string, []string) { |
| 138 | tmp := struct { |
| 139 | Mapping mapping.IndexMapping `json:"mapping"` |
| 140 | }{Mapping: bleve.NewIndexMapping()} |
| 141 | |
| 142 | err := json.Unmarshal([]byte(params), &tmp) |
| 143 | if err != nil { |
| 144 | return "", nil |
| 145 | } |
| 146 | |
| 147 | if im, ok := tmp.Mapping.(*mapping.IndexMappingImpl); ok { |
| 148 | scope, err := validateScopeCollFromMappings(sourceName, |
| 149 | im, true) |
| 150 | if err != nil { |
| 151 | return "", nil |
| 152 | } |
| 153 | |
| 154 | if scope != nil && len(scope.Collections) > 0 { |
| 155 | rv := make([]string, len(scope.Collections)) |
| 156 | for i, coll := range scope.Collections { |
| 157 | rv[i] = coll.Name |
| 158 | } |
| 159 | return scope.Name, rv |
| 160 | } |
| 161 | } |
| 162 | |
| 163 | return "", nil |
| 164 | } |
| 165 | |
| 166 | func getNsIndexStatsKey(indexName, sourceName, params string) string { |
| 167 | var colNames string |
no test coverage detected