GetIndexName returns names of the indexes that would be created for specific options.
(options InitializeIndexOptions, indexDefs map[SGIndexType]SGIndex)
| 500 | |
| 501 | // GetIndexName returns names of the indexes that would be created for specific options. |
| 502 | func GetIndexNames(options InitializeIndexOptions, indexDefs map[SGIndexType]SGIndex) []string { |
| 503 | indexNames := make([]string, 0) |
| 504 | |
| 505 | for _, sgIndex := range indexDefs { |
| 506 | if sgIndex.isXattrOnly() && !options.UseXattrs { |
| 507 | continue |
| 508 | } |
| 509 | if sgIndex.shouldCreate(options) { |
| 510 | indexNames = append(indexNames, sgIndex.fullIndexName(options.UseXattrs, options.NumPartitions)) |
| 511 | } |
| 512 | } |
| 513 | return indexNames |
| 514 | } |
| 515 | |
| 516 | // ShouldUseLegacySyncDocsIndex returns true if the syncDocs index should be used for queries of principal docs. Returns false if targeted users and roles indexes should be used. |
| 517 | func ShouldUseLegacySyncDocsIndex(ctx context.Context, collection base.N1QLStore, useXattrs bool) bool { |
no test coverage detected