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

Function getTestCache

pindex_bleve_test.go:687–711  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

685}
686
687func getTestCache() *collMetaFieldCache {
688 cache := make(map[string]string)
689 cache["ftsIndexA$colA"] = "_$suid_$cuidA"
690 cache["ftsIndexB$colA"] = "_$suid_$cuidA"
691 cache["ftsIndexB$colB"] = "_$suid_$cuidB"
692 cache["ftsIndexB$colC"] = "_$suid_$cuidC"
693
694 indexCache := make(map[string]*sourceDetails)
695 sdm := &sourceDetails{scopeName: "test",
696 collUIDNameMap: make(map[uint32]string)}
697 sdm.collUIDNameMap[1] = "colA"
698 sdm.collUIDNameMap[2] = "colB"
699 indexCache["ftsIndexA"] = sdm
700 sdm = &sourceDetails{scopeName: "test",
701 collUIDNameMap: make(map[uint32]string)}
702 sdm.collUIDNameMap[1] = "colA"
703 sdm.collUIDNameMap[2] = "colB"
704 sdm.collUIDNameMap[3] = "colC"
705 indexCache["ftsIndexB"] = sdm
706
707 testCache := &collMetaFieldCache{}
708 testCache.cache = cache
709 testCache.sourceDetailsMap = indexCache
710 return testCache
711}
712
713func TestCollectionSearchRequest(t *testing.T) {
714 testCache := getTestCache()

Calls

no outgoing calls

Tested by

no test coverage detected