MCPcopy Create free account
hub / github.com/couchbase/sync_gateway / GetIndexNames

Function GetIndexNames

db/indexes.go:502–514  ·  view source on GitHub ↗

GetIndexName returns names of the indexes that would be created for specific options.

(options InitializeIndexOptions, indexDefs map[SGIndexType]SGIndex)

Source from the content-addressed store, hash-verified

500
501// GetIndexName returns names of the indexes that would be created for specific options.
502func 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.
517func ShouldUseLegacySyncDocsIndex(ctx context.Context, collection base.N1QLStore, useXattrs bool) bool {

Callers 1

Calls 3

isXattrOnlyMethod · 0.80
shouldCreateMethod · 0.80
fullIndexNameMethod · 0.80

Tested by

no test coverage detected