-
Notifications
You must be signed in to change notification settings - Fork 682
/
helpers.go
46 lines (39 loc) · 1.5 KB
/
helpers.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
// _ _
// __ _____ __ ___ ___ __ _| |_ ___
// \ \ /\ / / _ \/ _` \ \ / / |/ _` | __/ _ \
// \ V V / __/ (_| |\ V /| | (_| | || __/
// \_/\_/ \___|\__,_| \_/ |_|\__,_|\__\___|
//
// Copyright © 2016 - 2022 SeMI Technologies B.V. All rights reserved.
//
// CONTACT: hello@semi.technology
//
package helpers
import "fmt"
var (
ObjectsBucket = []byte("objects")
ObjectsBucketLSM = "objects"
DimensionsBucketLSM = "dimensions"
DocIDBucket = []byte("doc_ids")
)
// BucketFromPropName creates the byte-representation used as the bucket name
// for a partiular prop in the inverted index
func BucketFromPropName(propName string) []byte {
return []byte(fmt.Sprintf("property_%s", propName))
}
// MetaCountProp helps create an internally used propName for meta props that
// don't explicitly exist in the user schema, but are required for proper
// indexing, such as the count of arrays.
func MetaCountProp(propName string) string {
return fmt.Sprintf("%s__meta_count", propName)
}
// BucketFromPropName creates the byte-representation used as the bucket name
// for a partiular prop in the inverted index
func BucketFromPropNameLSM(propName string) string {
return fmt.Sprintf("property_%s", propName)
}
// HashBucketFromPropName creates the byte-representation used as the bucket name
// for the status information of a partiular prop in the inverted index
func HashBucketFromPropNameLSM(propName string) string {
return fmt.Sprintf("hash_property_%s", propName)
}