ADAPT-Chase commited on
Commit
59bb539
·
verified ·
1 Parent(s): 95d599c

Add files using upload-large-folder tool

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. platform/dbops/binaries/weaviate-src/entities/schema/config/vector_index_config.go +70 -0
  2. platform/dbops/binaries/weaviate-src/entities/schema/configvalidation/config_validation.go +44 -0
  3. platform/dbops/binaries/weaviate-src/entities/schema/configvalidation/config_validation_test.go +61 -0
  4. platform/dbops/binaries/weaviate-src/entities/schema/crossref/bulk_builder.go +107 -0
  5. platform/dbops/binaries/weaviate-src/entities/schema/crossref/bulk_builder_test.go +109 -0
  6. platform/dbops/binaries/weaviate-src/entities/schema/crossref/crossref.go +117 -0
  7. platform/dbops/binaries/weaviate-src/entities/schema/crossref/crossref_source.go +102 -0
  8. platform/dbops/binaries/weaviate-src/entities/schema/crossref/crossref_source_test.go +169 -0
  9. platform/dbops/binaries/weaviate-src/entities/schema/crossref/crossref_test.go +233 -0
  10. platform/dbops/binaries/weaviate-src/entities/schema/test_utils/nested_properties.go +45 -0
  11. platform/dbops/binaries/weaviate-src/entities/schema/test_utils/properties.go +45 -0
  12. platform/dbops/binaries/weaviate-src/entities/storobj/enrich_schema_datatypes.go +409 -0
  13. platform/dbops/binaries/weaviate-src/entities/storobj/errors.go +30 -0
  14. platform/dbops/binaries/weaviate-src/entities/storobj/parse_single_object.go +173 -0
  15. platform/dbops/binaries/weaviate-src/entities/storobj/storage_object.go +1643 -0
  16. platform/dbops/binaries/weaviate-src/entities/storobj/storage_object_test.go +1629 -0
  17. platform/dbops/binaries/weaviate-src/entities/sync/sync.go +112 -0
  18. platform/dbops/binaries/weaviate-src/entities/sync/sync_test.go +116 -0
  19. platform/dbops/binaries/weaviate-src/entities/tenantactivity/types.go +26 -0
  20. platform/dbops/binaries/weaviate-src/entities/tokenizer/tokenizer.go +452 -0
  21. platform/dbops/binaries/weaviate-src/entities/tokenizer/tokenizer_test.go +267 -0
  22. platform/dbops/binaries/weaviate-src/entities/vectorindex/common/config.go +110 -0
  23. platform/dbops/binaries/weaviate-src/entities/vectorindex/config.go +47 -0
  24. platform/dbops/binaries/weaviate-src/entities/vectorindex/dynamic/config.go +124 -0
  25. platform/dbops/binaries/weaviate-src/entities/vectorindex/dynamic/config_test.go +395 -0
  26. platform/dbops/binaries/weaviate-src/entities/vectorindex/flat/config.go +190 -0
  27. platform/dbops/binaries/weaviate-src/entities/vectorindex/flat/config_test.go +148 -0
  28. platform/dbops/binaries/weaviate-src/entities/vectorindex/hnsw/bq_config.go +42 -0
  29. platform/dbops/binaries/weaviate-src/entities/vectorindex/hnsw/config.go +331 -0
  30. platform/dbops/binaries/weaviate-src/entities/vectorindex/hnsw/config_test.go +1148 -0
  31. platform/dbops/binaries/weaviate-src/entities/vectorindex/hnsw/multivector_config.go +132 -0
  32. platform/dbops/binaries/weaviate-src/entities/vectorindex/hnsw/pq_config.go +196 -0
  33. platform/dbops/binaries/weaviate-src/entities/vectorindex/hnsw/rq_config.go +87 -0
  34. platform/dbops/binaries/weaviate-src/entities/vectorindex/hnsw/rq_config_test.go +75 -0
  35. platform/dbops/binaries/weaviate-src/entities/vectorindex/hnsw/sq_config.go +58 -0
  36. platform/dbops/binaries/weaviate-src/entities/verbosity/verbosity.go +34 -0
  37. platform/dbops/binaries/weaviate-src/entities/versioned/class.go +23 -0
  38. platform/dbops/binaries/weaviate-src/grpc/generated/protocol/v0/batch.pb.go +149 -0
  39. platform/dbops/binaries/weaviate-src/grpc/generated/protocol/v0/search_get.pb.go +149 -0
  40. platform/dbops/binaries/weaviate-src/grpc/generated/protocol/v0/weaviate.pb.go +71 -0
  41. platform/dbops/binaries/weaviate-src/grpc/generated/protocol/v0/weaviate_grpc.pb.go +156 -0
  42. platform/dbops/binaries/weaviate-src/grpc/generated/protocol/v1/aggregate.pb.go +2630 -0
  43. platform/dbops/binaries/weaviate-src/grpc/generated/protocol/v1/base.pb.go +1665 -0
  44. platform/dbops/binaries/weaviate-src/grpc/generated/protocol/v1/base_search.pb.go +1728 -0
  45. platform/dbops/binaries/weaviate-src/grpc/generated/protocol/v1/batch.pb.go +1682 -0
  46. platform/dbops/binaries/weaviate-src/grpc/generated/protocol/v1/batch_delete.pb.go +330 -0
  47. platform/dbops/binaries/weaviate-src/grpc/generated/protocol/v1/file_replication.pb.go +810 -0
  48. platform/dbops/binaries/weaviate-src/grpc/generated/protocol/v1/file_replication_grpc.pb.go +260 -0
  49. platform/dbops/binaries/weaviate-src/grpc/generated/protocol/v1/generative.pb.go +0 -0
  50. platform/dbops/binaries/weaviate-src/grpc/generated/protocol/v1/properties.pb.go +1105 -0
platform/dbops/binaries/weaviate-src/entities/schema/config/vector_index_config.go ADDED
@@ -0,0 +1,70 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // _ _
2
+ // __ _____ __ ___ ___ __ _| |_ ___
3
+ // \ \ /\ / / _ \/ _` \ \ / / |/ _` | __/ _ \
4
+ // \ V V / __/ (_| |\ V /| | (_| | || __/
5
+ // \_/\_/ \___|\__,_| \_/ |_|\__,_|\__\___|
6
+ //
7
+ // Copyright © 2016 - 2025 Weaviate B.V. All rights reserved.
8
+ //
9
+ // CONTACT: hello@weaviate.io
10
+ //
11
+
12
+ package config
13
+
14
+ import (
15
+ "fmt"
16
+
17
+ "github.com/pkg/errors"
18
+ "github.com/weaviate/weaviate/entities/models"
19
+ "github.com/weaviate/weaviate/entities/modelsext"
20
+ )
21
+
22
+ type VectorIndexConfig interface {
23
+ IndexType() string
24
+ DistanceName() string
25
+ IsMultiVector() bool
26
+ }
27
+
28
+ func TypeAssertVectorIndex(class *models.Class, targetVectors []string) ([]VectorIndexConfig, error) {
29
+ if len(class.VectorConfig) == 0 || (modelsext.ClassHasLegacyVectorIndex(class) && len(targetVectors) == 0) {
30
+ vectorIndexConfig, ok := class.VectorIndexConfig.(VectorIndexConfig)
31
+ if !ok {
32
+ return nil, fmt.Errorf("class '%s' vector index: config is not schema.VectorIndexConfig: %T",
33
+ class.Class, class.VectorIndexConfig)
34
+ }
35
+ return []VectorIndexConfig{vectorIndexConfig}, nil
36
+ }
37
+
38
+ if len(class.VectorConfig) == 1 {
39
+ var vectorConfig models.VectorConfig
40
+ for _, v := range class.VectorConfig {
41
+ vectorConfig = v
42
+ break
43
+ }
44
+ vectorIndexConfig, ok := vectorConfig.VectorIndexConfig.(VectorIndexConfig)
45
+ if !ok {
46
+ return nil, fmt.Errorf("class '%s' vector index: config is not schema.VectorIndexConfig: %T",
47
+ class.Class, class.VectorIndexConfig)
48
+ }
49
+ return []VectorIndexConfig{vectorIndexConfig}, nil
50
+ }
51
+
52
+ if len(targetVectors) == 0 {
53
+ return nil, errors.Errorf("multiple vector configs found for class '%s', but no target vector specified", class.Class)
54
+ }
55
+
56
+ configs := make([]VectorIndexConfig, 0, len(targetVectors))
57
+ for _, targetVector := range targetVectors {
58
+ vectorConfig, ok := modelsext.ClassGetVectorConfig(class, targetVector)
59
+ if !ok {
60
+ return nil, errors.Errorf("vector config not found for target vector: %s", targetVector)
61
+ }
62
+ vectorIndexConfig, ok := vectorConfig.VectorIndexConfig.(VectorIndexConfig)
63
+ if !ok {
64
+ return nil, fmt.Errorf("targetVector '%s' vector index: config is not schema.VectorIndexConfig: %T",
65
+ targetVector, class.VectorIndexConfig)
66
+ }
67
+ configs = append(configs, vectorIndexConfig)
68
+ }
69
+ return configs, nil
70
+ }
platform/dbops/binaries/weaviate-src/entities/schema/configvalidation/config_validation.go ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // _ _
2
+ // __ _____ __ ___ ___ __ _| |_ ___
3
+ // \ \ /\ / / _ \/ _` \ \ / / |/ _` | __/ _ \
4
+ // \ V V / __/ (_| |\ V /| | (_| | || __/
5
+ // \_/\_/ \___|\__,_| \_/ |_|\__,_|\__\___|
6
+ //
7
+ // Copyright © 2016 - 2025 Weaviate B.V. All rights reserved.
8
+ //
9
+ // CONTACT: hello@weaviate.io
10
+ //
11
+
12
+ package configvalidation
13
+
14
+ import (
15
+ "github.com/pkg/errors"
16
+ "github.com/weaviate/weaviate/entities/models"
17
+ "github.com/weaviate/weaviate/entities/schema/config"
18
+ "github.com/weaviate/weaviate/entities/vectorindex/common"
19
+ )
20
+
21
+ func CheckCertaintyCompatibility(class *models.Class, targetVectors []string) error {
22
+ if class == nil {
23
+ return errors.Errorf("no class provided to check certainty compatibility")
24
+ }
25
+ if len(targetVectors) > 1 {
26
+ return errors.Errorf("multiple target vectors are not supported with certainty")
27
+ }
28
+
29
+ vectorConfigs, err := config.TypeAssertVectorIndex(class, targetVectors)
30
+ if err != nil {
31
+ return err
32
+ }
33
+ if dn := vectorConfigs[0].DistanceName(); dn != common.DistanceCosine {
34
+ return certaintyUnsupportedError(dn)
35
+ }
36
+
37
+ return nil
38
+ }
39
+
40
+ func certaintyUnsupportedError(distType string) error {
41
+ return errors.Errorf(
42
+ "can't compute and return certainty when vector index is configured with %s distance",
43
+ distType)
44
+ }
platform/dbops/binaries/weaviate-src/entities/schema/configvalidation/config_validation_test.go ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // _ _
2
+ // __ _____ __ ___ ___ __ _| |_ ___
3
+ // \ \ /\ / / _ \/ _` \ \ / / |/ _` | __/ _ \
4
+ // \ V V / __/ (_| |\ V /| | (_| | || __/
5
+ // \_/\_/ \___|\__,_| \_/ |_|\__,_|\__\___|
6
+ //
7
+ // Copyright © 2016 - 2025 Weaviate B.V. All rights reserved.
8
+ //
9
+ // CONTACT: hello@weaviate.io
10
+ //
11
+
12
+ package configvalidation
13
+
14
+ import (
15
+ "testing"
16
+
17
+ "github.com/stretchr/testify/require"
18
+ "github.com/weaviate/weaviate/entities/models"
19
+ vectorIndex "github.com/weaviate/weaviate/entities/vectorindex/common"
20
+ "github.com/weaviate/weaviate/entities/vectorindex/hnsw"
21
+ )
22
+
23
+ func TestCertainty(t *testing.T) {
24
+ cases := []struct {
25
+ name string
26
+ targetVectors []string
27
+ class *models.Class
28
+ fail bool
29
+ }{
30
+ {name: "no vectorizer", targetVectors: nil, class: &models.Class{}, fail: true},
31
+ {name: "cosine", targetVectors: nil, class: &models.Class{VectorIndexConfig: hnsw.UserConfig{Distance: vectorIndex.DistanceCosine}}, fail: false},
32
+ {name: "dot", targetVectors: nil, class: &models.Class{VectorIndexConfig: hnsw.UserConfig{Distance: vectorIndex.DistanceDot}}, fail: true},
33
+ {name: "single target vector", targetVectors: []string{"named"}, class: &models.Class{VectorConfig: map[string]models.VectorConfig{
34
+ "named": {VectorIndexConfig: hnsw.UserConfig{Distance: vectorIndex.DistanceCosine}},
35
+ "named2": {VectorIndexConfig: hnsw.UserConfig{Distance: vectorIndex.DistanceCosine}},
36
+ }}, fail: false},
37
+ {name: "multi target vector", targetVectors: []string{"named", "named2"}, class: &models.Class{VectorConfig: map[string]models.VectorConfig{
38
+ "named": {VectorIndexConfig: hnsw.UserConfig{Distance: vectorIndex.DistanceCosine}},
39
+ "named2": {VectorIndexConfig: hnsw.UserConfig{Distance: vectorIndex.DistanceCosine}},
40
+ }}, fail: true},
41
+ {name: "single target vector and dot", targetVectors: []string{"named"}, class: &models.Class{VectorConfig: map[string]models.VectorConfig{
42
+ "named": {VectorIndexConfig: hnsw.UserConfig{Distance: vectorIndex.DistanceDot}},
43
+ "named2": {VectorIndexConfig: hnsw.UserConfig{Distance: vectorIndex.DistanceCosine}},
44
+ }}, fail: true},
45
+ {name: "single target vector and dot for non selected", targetVectors: []string{"named2"}, class: &models.Class{VectorConfig: map[string]models.VectorConfig{
46
+ "named": {VectorIndexConfig: hnsw.UserConfig{Distance: vectorIndex.DistanceDot}},
47
+ "named2": {VectorIndexConfig: hnsw.UserConfig{Distance: vectorIndex.DistanceCosine}},
48
+ }}, fail: false},
49
+ }
50
+
51
+ for _, tt := range cases {
52
+ t.Run(tt.name, func(t *testing.T) {
53
+ err := CheckCertaintyCompatibility(tt.class, tt.targetVectors)
54
+ if tt.fail {
55
+ require.NotNil(t, err)
56
+ } else {
57
+ require.Nil(t, err)
58
+ }
59
+ })
60
+ }
61
+ }
platform/dbops/binaries/weaviate-src/entities/schema/crossref/bulk_builder.go ADDED
@@ -0,0 +1,107 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // _ _
2
+ // __ _____ __ ___ ___ __ _| |_ ___
3
+ // \ \ /\ / / _ \/ _` \ \ / / |/ _` | __/ _ \
4
+ // \ V V / __/ (_| |\ V /| | (_| | || __/
5
+ // \_/\_/ \___|\__,_| \_/ |_|\__,_|\__\___|
6
+ //
7
+ // Copyright © 2016 - 2025 Weaviate B.V. All rights reserved.
8
+ //
9
+ // CONTACT: hello@weaviate.io
10
+ //
11
+
12
+ package crossref
13
+
14
+ import (
15
+ "fmt"
16
+
17
+ "github.com/go-openapi/strfmt"
18
+ "github.com/weaviate/weaviate/usecases/byteops"
19
+ )
20
+
21
+ // BulkBuilder is a low-alloc tool to build many beacon strings (as []byte). It
22
+ // is optimized to allocate just once as opposed to once per ID. This makes it
23
+ // considerably faster when generating 100s of thousand of beacons strings. The
24
+ // main intended use case for this is building propValuePairs in ref-filters.
25
+ //
26
+ // The BulkBuilder makes some estimations for how much memory will be necessary
27
+ // based on expected input params. If those requirements get exceeded, it will
28
+ // still be safe to use, but will fallback to allocating dynamically.
29
+ type BulkBuilder struct {
30
+ byteops.ReadWriter
31
+ prefix []byte
32
+ }
33
+
34
+ func NewBulkBuilderWithEstimates(expectedCount int, exampleClassName string,
35
+ overheadRatio float64,
36
+ ) *BulkBuilder {
37
+ prefix := []byte("weaviate://localhost/")
38
+
39
+ lenOfTypicalClassName := int(float64(len(exampleClassName)) * overheadRatio)
40
+ predictedSize := expectedCount * (len(prefix) + 1 + lenOfTypicalClassName + 36)
41
+
42
+ bb := &BulkBuilder{
43
+ prefix: prefix,
44
+ ReadWriter: byteops.NewReadWriter(make([]byte, predictedSize)),
45
+ }
46
+
47
+ return bb
48
+ }
49
+
50
+ func (bb *BulkBuilder) ClassAndID(className string,
51
+ id strfmt.UUID,
52
+ ) []byte {
53
+ requiredSpace := len(bb.prefix) + len(id)
54
+ if int(bb.Position)+requiredSpace >= len(bb.Buffer) {
55
+ return bb.fallbackWithClassName(className, id)
56
+ }
57
+
58
+ // copy the start pos, we will need this at the end to know what to return to
59
+ // the caller
60
+ start := bb.Position
61
+ bb.CopyBytesToBuffer(bb.prefix)
62
+
63
+ // This is a safe way, in case a class-name ever contains non-ASCII
64
+ // characters. If we could be 100% sure that a class is ASCII-only, we could
65
+ // remove this allocation and instead use the same copy-by-rune approach that
66
+ // we use later on for the ID.
67
+ bb.CopyBytesToBuffer([]byte(className))
68
+ bb.WriteByte('/') // The separating slash between class and ID
69
+ for _, runeValue := range id {
70
+ // We know that the UUID-string never contains non-ASCII characters. This
71
+ // means it safe to convert the uint32-rune into a uint8. This allows us to
72
+ // copy char by char without any additional allocs
73
+ bb.WriteByte(uint8(runeValue))
74
+ }
75
+
76
+ return bb.Buffer[start:bb.Position]
77
+ }
78
+
79
+ func (bb *BulkBuilder) LegacyIDOnly(id strfmt.UUID) []byte {
80
+ requiredSpace := len(bb.prefix) + len(id)
81
+ if int(bb.Position)+requiredSpace >= len(bb.Buffer) {
82
+ return bb.fallbackWithoutClassName(id)
83
+ }
84
+
85
+ // copy the start pos, we will need this at the end to know what to return to
86
+ // the caller
87
+ start := bb.Position
88
+ bb.CopyBytesToBuffer(bb.prefix)
89
+ for _, runeValue := range id {
90
+ // We know that the UUID-string never contains non-ASCII characters. This
91
+ // means it safe to convert the uint32-rune into a uint8. This allows us to
92
+ // copy char by char without any additional allocs
93
+ bb.WriteByte(uint8(runeValue))
94
+ }
95
+
96
+ return bb.Buffer[start:bb.Position]
97
+ }
98
+
99
+ func (bb *BulkBuilder) fallbackWithClassName(
100
+ className string, id strfmt.UUID,
101
+ ) []byte {
102
+ return []byte(fmt.Sprintf("%s%s/%s", bb.prefix, className, id))
103
+ }
104
+
105
+ func (bb *BulkBuilder) fallbackWithoutClassName(id strfmt.UUID) []byte {
106
+ return []byte(fmt.Sprintf("%s%s", bb.prefix, id))
107
+ }
platform/dbops/binaries/weaviate-src/entities/schema/crossref/bulk_builder_test.go ADDED
@@ -0,0 +1,109 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // _ _
2
+ // __ _____ __ ___ ___ __ _| |_ ___
3
+ // \ \ /\ / / _ \/ _` \ \ / / |/ _` | __/ _ \
4
+ // \ V V / __/ (_| |\ V /| | (_| | || __/
5
+ // \_/\_/ \___|\__,_| \_/ |_|\__,_|\__\___|
6
+ //
7
+ // Copyright © 2016 - 2025 Weaviate B.V. All rights reserved.
8
+ //
9
+ // CONTACT: hello@weaviate.io
10
+ //
11
+
12
+ package crossref
13
+
14
+ import (
15
+ "fmt"
16
+ "testing"
17
+
18
+ "github.com/go-openapi/strfmt"
19
+ "github.com/google/uuid"
20
+ "github.com/stretchr/testify/assert"
21
+ )
22
+
23
+ func TestBulkBuilder(t *testing.T) {
24
+ tests := []struct {
25
+ name string
26
+ expectedFn func(id string) string
27
+ estimatedSize int
28
+ iterations int
29
+ className string
30
+ withClassName bool
31
+ }{
32
+ {
33
+ name: "with class name - enough-prealloc",
34
+ withClassName: true,
35
+ className: "MyClass",
36
+ expectedFn: func(id string) string {
37
+ return fmt.Sprintf("weaviate://localhost/MyClass/%s", id)
38
+ },
39
+ estimatedSize: 25,
40
+ iterations: 25,
41
+ },
42
+ {
43
+ name: "with class name with non-ASCII- enough-prealloc",
44
+ withClassName: true,
45
+ className: "My國Class",
46
+ expectedFn: func(id string) string {
47
+ return fmt.Sprintf("weaviate://localhost/My國Class/%s", id)
48
+ },
49
+ estimatedSize: 25,
50
+ iterations: 25,
51
+ },
52
+ {
53
+ name: "with class name - not enough-prealloc",
54
+ withClassName: true,
55
+ className: "MyClass",
56
+ expectedFn: func(id string) string {
57
+ return fmt.Sprintf("weaviate://localhost/MyClass/%s", id)
58
+ },
59
+ estimatedSize: 10,
60
+ iterations: 25,
61
+ },
62
+ {
63
+ name: "with class name with non-ASCII - not enough-prealloc",
64
+ withClassName: true,
65
+ className: "My國Class",
66
+ expectedFn: func(id string) string {
67
+ return fmt.Sprintf("weaviate://localhost/My國Class/%s", id)
68
+ },
69
+ estimatedSize: 10,
70
+ iterations: 25,
71
+ },
72
+ {
73
+ name: "without class name - enough-prealloc",
74
+ withClassName: false,
75
+ className: "MyClass",
76
+ expectedFn: func(id string) string {
77
+ return fmt.Sprintf("weaviate://localhost/%s", id)
78
+ },
79
+ estimatedSize: 25,
80
+ iterations: 25,
81
+ },
82
+ {
83
+ name: "without class name - not enough-prealloc",
84
+ withClassName: false,
85
+ className: "MyClass",
86
+ expectedFn: func(id string) string {
87
+ return fmt.Sprintf("weaviate://localhost/%s", id)
88
+ },
89
+ estimatedSize: 10,
90
+ iterations: 25,
91
+ },
92
+ }
93
+
94
+ for _, tt := range tests {
95
+ t.Run(tt.name, func(t *testing.T) {
96
+ bb := NewBulkBuilderWithEstimates(tt.estimatedSize, tt.className, 1.00)
97
+ for i := 0; i < tt.iterations; i++ {
98
+ id := uuid.New().String()
99
+ if tt.withClassName {
100
+ res := bb.ClassAndID(tt.className, strfmt.UUID(id))
101
+ assert.Equal(t, tt.expectedFn(id), string(res))
102
+ } else {
103
+ res := bb.LegacyIDOnly(strfmt.UUID(id))
104
+ assert.Equal(t, tt.expectedFn(id), string(res))
105
+ }
106
+ }
107
+ })
108
+ }
109
+ }
platform/dbops/binaries/weaviate-src/entities/schema/crossref/crossref.go ADDED
@@ -0,0 +1,117 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // _ _
2
+ // __ _____ __ ___ ___ __ _| |_ ___
3
+ // \ \ /\ / / _ \/ _` \ \ / / |/ _` | __/ _ \
4
+ // \ V V / __/ (_| |\ V /| | (_| | || __/
5
+ // \_/\_/ \___|\__,_| \_/ |_|\__,_|\__\___|
6
+ //
7
+ // Copyright © 2016 - 2025 Weaviate B.V. All rights reserved.
8
+ //
9
+ // CONTACT: hello@weaviate.io
10
+ //
11
+
12
+ package crossref
13
+
14
+ import (
15
+ "fmt"
16
+ "net/url"
17
+ "strings"
18
+
19
+ "github.com/go-openapi/strfmt"
20
+ "github.com/weaviate/weaviate/entities/models"
21
+ )
22
+
23
+ const (
24
+ _LocalHost = "localhost"
25
+ _Schema = "weaviate"
26
+ )
27
+
28
+ // Ref is an abstraction of the cross-refs which are specified in a URI format
29
+ // in the API. When this type is used it is safe to assume that a Ref is
30
+ // semantically valid. This guarantee would not be possible on the URI format,
31
+ // as the URI can be well-formed, but not contain the data we expect in it.
32
+ // Do not use directly, such as crossref.Ref{}, as you won't have any
33
+ // guarantees in this case. Always use one of the parsing options or New()
34
+ type Ref struct {
35
+ Local bool `json:"local"`
36
+ PeerName string `json:"peerName"`
37
+ TargetID strfmt.UUID `json:"targetID"`
38
+ Class string `json:"className"`
39
+ }
40
+
41
+ // Parse is a safe way to generate a Ref, as it will error if any of the input
42
+ // parameters are not as expected.
43
+ func Parse(uriString string) (*Ref, error) {
44
+ uri, err := url.Parse(uriString)
45
+ if err != nil || uri.Path == "" {
46
+ return nil, fmt.Errorf("invalid cref URI: %w", err)
47
+ }
48
+
49
+ segments := strings.Split(uri.Path, "/")
50
+ class, id, idx := "", "", 1
51
+ switch len(segments) {
52
+ case 3:
53
+ class = segments[1]
54
+ id = segments[2]
55
+ idx = 2
56
+ case 2:
57
+ id = segments[1]
58
+ default:
59
+ return nil, fmt.Errorf(
60
+ "invalid cref URI: path must be of format '<class>/<uuid>', but got '%s'", uri.Path)
61
+ }
62
+ if ok := strfmt.IsUUID(id); !ok {
63
+ return nil, fmt.Errorf("invalid cref URI: %dnd path segment must be uuid, but got '%s'",
64
+ idx, id)
65
+ }
66
+
67
+ return &Ref{
68
+ Local: uri.Host == _LocalHost,
69
+ PeerName: uri.Host,
70
+ TargetID: strfmt.UUID(id),
71
+ Class: class,
72
+ }, nil
73
+ }
74
+
75
+ // ParseSingleRef is a safe way to generate a Ref from a models.SingleRef, a
76
+ // helper construct that represents the API structure. It will error if any of
77
+ // the input parameters are not as expected.
78
+ func ParseSingleRef(singleRef *models.SingleRef) (*Ref, error) {
79
+ return Parse(string(singleRef.Beacon))
80
+ }
81
+
82
+ // New is a safe way to generate a Reference, as all required arguments must be
83
+ // set in the constructor fn
84
+ func New(peerName string, class string, target strfmt.UUID) *Ref {
85
+ return &Ref{
86
+ Local: peerName == _LocalHost,
87
+ PeerName: peerName,
88
+ TargetID: target,
89
+ Class: class,
90
+ }
91
+ }
92
+
93
+ func NewLocalhost(class string, target strfmt.UUID) *Ref {
94
+ return New(_LocalHost, class, target)
95
+ }
96
+
97
+ func (r *Ref) String() string {
98
+ path := fmt.Sprintf("%s/%s", r.Class, r.TargetID)
99
+ if r.Class == "" {
100
+ path = fmt.Sprintf("/%s", r.TargetID)
101
+ }
102
+ uri := url.URL{
103
+ Host: r.PeerName,
104
+ Scheme: _Schema,
105
+ Path: path,
106
+ }
107
+
108
+ return uri.String()
109
+ }
110
+
111
+ // SingleRef converts the parsed Ref back into the API helper construct
112
+ // containing a stringified representation (URI format) of the Ref
113
+ func (r *Ref) SingleRef() *models.SingleRef {
114
+ return &models.SingleRef{
115
+ Beacon: strfmt.URI(r.String()),
116
+ }
117
+ }
platform/dbops/binaries/weaviate-src/entities/schema/crossref/crossref_source.go ADDED
@@ -0,0 +1,102 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // _ _
2
+ // __ _____ __ ___ ___ __ _| |_ ___
3
+ // \ \ /\ / / _ \/ _` \ \ / / |/ _` | __/ _ \
4
+ // \ V V / __/ (_| |\ V /| | (_| | || __/
5
+ // \_/\_/ \___|\__,_| \_/ |_|\__,_|\__\___|
6
+ //
7
+ // Copyright © 2016 - 2025 Weaviate B.V. All rights reserved.
8
+ //
9
+ // CONTACT: hello@weaviate.io
10
+ //
11
+
12
+ package crossref
13
+
14
+ import (
15
+ "fmt"
16
+ "net/url"
17
+ "strings"
18
+ "unicode"
19
+
20
+ "github.com/go-openapi/strfmt"
21
+ "github.com/weaviate/weaviate/entities/schema"
22
+ )
23
+
24
+ // RefSource is an abstraction of the source of a cross-ref. The opposite would
25
+ // be Ref which represents the target instead. A RefSource is specified in a URI
26
+ // format in the API. When this type is used it is safe to assume that a Ref is
27
+ // semantically valid. This guarantee would not be possible on the URI format,
28
+ // as the URI can be well-formed, but not contain the data we expect in it. Do
29
+ // not use directly, such as crossref.RefSource{}, as you won't have any
30
+ // guarantees in this case. Always use one of the parsing options or New()
31
+ type RefSource struct {
32
+ Local bool `json:"local"`
33
+ PeerName string `json:"peerName"`
34
+ Property schema.PropertyName `json:"property"`
35
+ Class schema.ClassName `json:"class"`
36
+ TargetID strfmt.UUID `json:"targetID"`
37
+ }
38
+
39
+ func NewSource(className schema.ClassName,
40
+ property schema.PropertyName, id strfmt.UUID,
41
+ ) *RefSource {
42
+ return &RefSource{
43
+ Local: true,
44
+ PeerName: "localhost",
45
+ Class: className,
46
+ TargetID: id,
47
+ Property: property,
48
+ }
49
+ }
50
+
51
+ // ParseSource is a safe way to generate a RefSource, as it will error if any
52
+ // of the input parameters are not as expected.
53
+ func ParseSource(uriString string) (*RefSource, error) {
54
+ uri, err := url.Parse(uriString)
55
+ if err != nil {
56
+ return nil, fmt.Errorf("invalid cref URI: %w", err)
57
+ }
58
+
59
+ pathSegments := strings.Split(uri.Path, "/")
60
+ if len(pathSegments) != 4 {
61
+ return nil, fmt.Errorf(
62
+ "invalid cref URI: must use long-form: path must be of format '/<className>/<uuid>/<propertyName>', but got '%s'",
63
+ uri.Path)
64
+ }
65
+
66
+ if ok := strfmt.IsUUID(pathSegments[2]); !ok {
67
+ return nil, fmt.Errorf("invalid cref URI: 2nd path segment must be uuid, but got '%s'",
68
+ pathSegments[3])
69
+ }
70
+
71
+ class := pathSegments[1]
72
+ if class == "" {
73
+ return nil, fmt.Errorf("className cannot be empty")
74
+ }
75
+
76
+ if unicode.IsLower(rune(class[0])) {
77
+ return nil, fmt.Errorf("className must start with an uppercase letter, but got %s", class)
78
+ }
79
+
80
+ property := pathSegments[3]
81
+ if property == "" {
82
+ return nil, fmt.Errorf("property cannot be empty")
83
+ }
84
+
85
+ return &RefSource{
86
+ Local: (uri.Host == "localhost"),
87
+ PeerName: uri.Host,
88
+ TargetID: strfmt.UUID(pathSegments[2]),
89
+ Class: schema.ClassName(class),
90
+ Property: schema.PropertyName(property),
91
+ }, nil
92
+ }
93
+
94
+ func (r *RefSource) String() string {
95
+ uri := url.URL{
96
+ Host: r.PeerName,
97
+ Scheme: "weaviate",
98
+ Path: fmt.Sprintf("/%s/%s/%s", r.Class, r.TargetID, r.Property),
99
+ }
100
+
101
+ return uri.String()
102
+ }
platform/dbops/binaries/weaviate-src/entities/schema/crossref/crossref_source_test.go ADDED
@@ -0,0 +1,169 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // _ _
2
+ // __ _____ __ ___ ___ __ _| |_ ___
3
+ // \ \ /\ / / _ \/ _` \ \ / / |/ _` | __/ _ \
4
+ // \ V V / __/ (_| |\ V /| | (_| | || __/
5
+ // \_/\_/ \___|\__,_| \_/ |_|\__,_|\__\___|
6
+ //
7
+ // Copyright © 2016 - 2025 Weaviate B.V. All rights reserved.
8
+ //
9
+ // CONTACT: hello@weaviate.io
10
+ //
11
+
12
+ package crossref
13
+
14
+ import (
15
+ "testing"
16
+
17
+ "github.com/go-openapi/strfmt"
18
+ "github.com/stretchr/testify/assert"
19
+ "github.com/stretchr/testify/require"
20
+ "github.com/weaviate/weaviate/entities/schema"
21
+ )
22
+
23
+ func Test_Source_ParsingFromString(t *testing.T) {
24
+ t.Run("from a local object ref that is well-formed", func(t *testing.T) {
25
+ uri := "weaviate://localhost/MyClassName/c2cd3f91-0160-477e-869a-8da8829e0a4d/myRefProp"
26
+ ref, err := ParseSource(uri)
27
+
28
+ require.Nil(t, err, "should not error")
29
+
30
+ t.Run("is a local ref", func(t *testing.T) {
31
+ assert.Equal(t, ref.Local, true)
32
+ })
33
+
34
+ t.Run("peerName points to localhost", func(t *testing.T) {
35
+ assert.Equal(t, ref.PeerName, "localhost")
36
+ })
37
+
38
+ t.Run("id points correctly", func(t *testing.T) {
39
+ assert.Equal(t, ref.TargetID, strfmt.UUID("c2cd3f91-0160-477e-869a-8da8829e0a4d"))
40
+ })
41
+
42
+ t.Run("the class name is correct", func(t *testing.T) {
43
+ assert.Equal(t, ref.Class, schema.ClassName("MyClassName"))
44
+ })
45
+
46
+ t.Run("the property name is correct", func(t *testing.T) {
47
+ assert.Equal(t, ref.Property, schema.PropertyName("myRefProp"))
48
+ })
49
+
50
+ t.Run("assembling a new source and comparing if the match", func(t *testing.T) {
51
+ alt := NewSource("MyClassName", "myRefProp",
52
+ "c2cd3f91-0160-477e-869a-8da8829e0a4d")
53
+ assert.Equal(t, ref, alt)
54
+ })
55
+ })
56
+
57
+ t.Run("from a local action ref that is well-formed", func(t *testing.T) {
58
+ uri := "weaviate://localhost/MyActionClass/c2cd3f91-0160-477e-869a-8da8829e0a4d/myRefProp"
59
+ ref, err := ParseSource(uri)
60
+
61
+ require.Nil(t, err, "should not error")
62
+
63
+ t.Run("is a local ref", func(t *testing.T) {
64
+ assert.Equal(t, ref.Local, true)
65
+ })
66
+
67
+ t.Run("peerName points to localhost", func(t *testing.T) {
68
+ assert.Equal(t, ref.PeerName, "localhost")
69
+ })
70
+
71
+ t.Run("id points correctly", func(t *testing.T) {
72
+ assert.Equal(t, ref.TargetID, strfmt.UUID("c2cd3f91-0160-477e-869a-8da8829e0a4d"))
73
+ })
74
+
75
+ t.Run("the class name is correct", func(t *testing.T) {
76
+ assert.Equal(t, ref.Class, schema.ClassName("MyActionClass"))
77
+ })
78
+
79
+ t.Run("the property name is correct", func(t *testing.T) {
80
+ assert.Equal(t, ref.Property, schema.PropertyName("myRefProp"))
81
+ })
82
+
83
+ t.Run("assembling a new source and comparing if the match", func(t *testing.T) {
84
+ alt := NewSource("MyActionClass", "myRefProp",
85
+ "c2cd3f91-0160-477e-869a-8da8829e0a4d")
86
+ assert.Equal(t, ref, alt)
87
+ })
88
+ })
89
+
90
+ t.Run("from a network action ref that is well-formed", func(t *testing.T) {
91
+ uri := "weaviate://another-weaviate/SomeActionClass/c2cd3f91-0160-477e-869a-8da8829e0a4d/myRefProp"
92
+ ref, err := ParseSource(uri)
93
+
94
+ require.Nil(t, err, "should not error")
95
+
96
+ t.Run("is a local ref", func(t *testing.T) {
97
+ assert.Equal(t, ref.Local, false)
98
+ })
99
+
100
+ t.Run("peerName points to localhost", func(t *testing.T) {
101
+ assert.Equal(t, ref.PeerName, "another-weaviate")
102
+ })
103
+
104
+ t.Run("id points correctly", func(t *testing.T) {
105
+ assert.Equal(t, ref.TargetID, strfmt.UUID("c2cd3f91-0160-477e-869a-8da8829e0a4d"))
106
+ })
107
+
108
+ t.Run("the class name is correct", func(t *testing.T) {
109
+ assert.Equal(t, ref.Class, schema.ClassName("SomeActionClass"))
110
+ })
111
+
112
+ t.Run("the property name is correct", func(t *testing.T) {
113
+ assert.Equal(t, ref.Property, schema.PropertyName("myRefProp"))
114
+ })
115
+ })
116
+
117
+ t.Run("with formatting errors", func(t *testing.T) {
118
+ type testCaseError struct {
119
+ name string
120
+ uri string
121
+ }
122
+
123
+ tests := []testCaseError{
124
+ {
125
+ name: "with an invalid URL",
126
+ uri: "i:am:not:a:url",
127
+ },
128
+ {
129
+ name: "with too few path segments",
130
+ uri: "weaviate://localhost/SomeClass",
131
+ },
132
+ {
133
+ name: "with too many path segments",
134
+ uri: "weaviate://localhost/SomeClass/c2cd3f91-0160-477e-869a-8da8829e0a4d/myRefProp/somethingElse",
135
+ },
136
+ {
137
+ name: "without a property",
138
+ uri: "weaviate://localhost/SomeClass/c2cd3f91-0160-477e-869a-8da8829e0a4d/",
139
+ },
140
+ {
141
+ name: "with an invalid uuid",
142
+ uri: "weaviate://localhost/SomeClass/c2cd3f91-iSneakedInHere-477e-869a-8da8829e0a4d",
143
+ },
144
+ {
145
+ name: "with an invalid kind", // was /humans/SomeClass
146
+ uri: "weaviate://localhost/SomeClass/c2cd3f91-0160-477e-869a-8da8829e0a4d",
147
+ },
148
+ {
149
+ name: "with a lowercased class name",
150
+ uri: "weaviate://localhost/someClass/c2cd3f91-0160-477e-869a-8da8829e0a4d/myRefProp",
151
+ },
152
+ }
153
+
154
+ for _, test := range tests {
155
+ t.Run(test.name, func(t *testing.T) {
156
+ _, err := ParseSource(test.uri)
157
+ assert.NotNil(t, err, test.name)
158
+ })
159
+ }
160
+ })
161
+ }
162
+
163
+ func Test_Source_GenerateString(t *testing.T) {
164
+ uri := "weaviate://localhost/MyClass/c2cd3f91-0160-477e-869a-8da8829e0a4d/myRefProp"
165
+ ref, err := ParseSource(uri)
166
+
167
+ require.Nil(t, err, "should not error")
168
+ assert.Equal(t, uri, ref.String(), "should be the same as the input string")
169
+ }
platform/dbops/binaries/weaviate-src/entities/schema/crossref/crossref_test.go ADDED
@@ -0,0 +1,233 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // _ _
2
+ // __ _____ __ ___ ___ __ _| |_ ___
3
+ // \ \ /\ / / _ \/ _` \ \ / / |/ _` | __/ _ \
4
+ // \ V V / __/ (_| |\ V /| | (_| | || __/
5
+ // \_/\_/ \___|\__,_| \_/ |_|\__,_|\__\___|
6
+ //
7
+ // Copyright © 2016 - 2025 Weaviate B.V. All rights reserved.
8
+ //
9
+ // CONTACT: hello@weaviate.io
10
+ //
11
+
12
+ package crossref
13
+
14
+ import (
15
+ "testing"
16
+
17
+ "github.com/go-openapi/strfmt"
18
+ "github.com/stretchr/testify/assert"
19
+ "github.com/stretchr/testify/require"
20
+ "github.com/weaviate/weaviate/entities/models"
21
+ )
22
+
23
+ func TestParseCrossReference(t *testing.T) {
24
+ ref := Ref{
25
+ Local: true,
26
+ PeerName: _LocalHost,
27
+ TargetID: "c2cd3f91-0160-477e-869a-8da8829e0a4d",
28
+ Class: "class",
29
+ }
30
+ tests := []struct {
31
+ beacon string
32
+ ref Ref
33
+ ok bool
34
+ }{
35
+ {
36
+ beacon: "weaviate://localhost/class/c2cd3f91-0160-477e-869a-8da8829e0a4d",
37
+ ref: ref,
38
+ ok: true,
39
+ },
40
+ {
41
+ beacon: "weaviate://remote/class/c2cd3f91-0160-477e-869a-8da8829e0a4d",
42
+ ref: Ref{false, "remote", ref.TargetID, "class"},
43
+ ok: true,
44
+ },
45
+ {
46
+ beacon: "weaviate://localhost/c2cd3f91-0160-477e-869a-8da8829e0a4d",
47
+ ref: Ref{true, _LocalHost, ref.TargetID, ""},
48
+ ok: true,
49
+ },
50
+ {
51
+ beacon: "weaviate://remote/c2cd3f91-0160-477e-869a-8da8829e0a4d",
52
+ ref: Ref{false, "remote", ref.TargetID, ""},
53
+ ok: true,
54
+ },
55
+ {
56
+ beacon: "weaviate://localhost/class/c2cd3f91-0160-477e-869a-8da8829e0a4d/i-shouldnt-be-here",
57
+ },
58
+ {
59
+ beacon: "weaviate://localhost/class/invalid-id",
60
+ },
61
+ {
62
+ beacon: "weaviate://localhost/class",
63
+ },
64
+ {
65
+ beacon: "weaviate://localhost",
66
+ },
67
+ {
68
+ beacon: "i:am:not:a:url",
69
+ },
70
+ }
71
+ for i, tc := range tests {
72
+ got, err := Parse(tc.beacon)
73
+ if (err == nil) != tc.ok {
74
+ t.Errorf("%d - Parse(%s) error %v error expected: %t", i, tc.beacon, err, tc.ok)
75
+ continue
76
+ }
77
+ if err != nil {
78
+ continue
79
+ }
80
+ if *got != tc.ref {
81
+ t.Errorf("%d - Parse(%s) got %v want %v", i, tc.beacon, *got, tc.ref)
82
+ }
83
+ if beacon := got.String(); beacon != tc.beacon {
84
+ t.Errorf("beacon expected: %v want %v", tc.beacon, beacon)
85
+ }
86
+ }
87
+ }
88
+
89
+ func TestSingleRef(t *testing.T) {
90
+ ref := NewLocalhost("class", "c2cd3f91-0160-477e-869a-8da8829e0a4d")
91
+ expected := &models.SingleRef{
92
+ Beacon: strfmt.URI("weaviate://localhost/class/c2cd3f91-0160-477e-869a-8da8829e0a4d"),
93
+ }
94
+ sref := ref.SingleRef()
95
+ assert.Equal(t, expected, sref, "should create a singleRef")
96
+ xref, _ := ParseSingleRef(sref)
97
+ assert.Equal(t, ref, xref)
98
+ }
99
+
100
+ func Test_ParsingFromStringDeprecated(t *testing.T) {
101
+ t.Run("from a local object ref that is well-formed", func(t *testing.T) {
102
+ uri := "weaviate://localhost/c2cd3f91-0160-477e-869a-8da8829e0a4d"
103
+ ref, err := Parse(uri)
104
+
105
+ require.Nil(t, err, "should not error")
106
+
107
+ t.Run("is a local ref", func(t *testing.T) {
108
+ assert.Equal(t, ref.Local, true)
109
+ })
110
+
111
+ t.Run("peerName points to localhost", func(t *testing.T) {
112
+ assert.Equal(t, ref.PeerName, "localhost")
113
+ })
114
+
115
+ t.Run("id points correctly", func(t *testing.T) {
116
+ assert.Equal(t, ref.TargetID, strfmt.UUID("c2cd3f91-0160-477e-869a-8da8829e0a4d"))
117
+ })
118
+ })
119
+
120
+ t.Run("from a local action ref that is well-formed", func(t *testing.T) {
121
+ uri := "weaviate://localhost/c2cd3f91-0160-477e-869a-8da8829e0a4d"
122
+ ref, err := Parse(uri)
123
+
124
+ require.Nil(t, err, "should not error")
125
+
126
+ t.Run("is a local ref", func(t *testing.T) {
127
+ assert.Equal(t, ref.Local, true)
128
+ })
129
+
130
+ t.Run("peerName points to localhost", func(t *testing.T) {
131
+ assert.Equal(t, ref.PeerName, "localhost")
132
+ })
133
+
134
+ t.Run("id points correctly", func(t *testing.T) {
135
+ assert.Equal(t, ref.TargetID, strfmt.UUID("c2cd3f91-0160-477e-869a-8da8829e0a4d"))
136
+ })
137
+ })
138
+
139
+ t.Run("from a network action ref that is well-formed", func(t *testing.T) {
140
+ uri := "weaviate://another-weaviate/c2cd3f91-0160-477e-869a-8da8829e0a4d"
141
+ ref, err := Parse(uri)
142
+
143
+ require.Nil(t, err, "should not error")
144
+
145
+ t.Run("is a local ref", func(t *testing.T) {
146
+ assert.Equal(t, ref.Local, false)
147
+ })
148
+
149
+ t.Run("peerName points to localhost", func(t *testing.T) {
150
+ assert.Equal(t, ref.PeerName, "another-weaviate")
151
+ })
152
+
153
+ t.Run("id points correctly", func(t *testing.T) {
154
+ assert.Equal(t, ref.TargetID, strfmt.UUID("c2cd3f91-0160-477e-869a-8da8829e0a4d"))
155
+ })
156
+ })
157
+
158
+ t.Run("with formatting errors", func(t *testing.T) {
159
+ type testCaseError struct {
160
+ name string
161
+ uri string
162
+ }
163
+
164
+ tests := []testCaseError{
165
+ {
166
+ name: "with an invalid URL",
167
+ uri: "i:am:not:a:url",
168
+ },
169
+ {
170
+ name: "with too few path segments",
171
+ uri: "weaviate://localhost",
172
+ },
173
+ {
174
+ name: "with too many path segments",
175
+ uri: "weaviate://localhost/c2cd3f91-0160-477e-869a-8da8829e0a4d/i-shouldnt-be-here",
176
+ },
177
+ {
178
+ name: "with an invalid uuid",
179
+ uri: "weaviate://localhost/c2cd3f91-iSneakedInHere-477e-869a-8da8829e0a4d",
180
+ },
181
+ }
182
+
183
+ for _, test := range tests {
184
+ t.Run(test.name, func(t *testing.T) {
185
+ _, err := Parse(test.uri)
186
+ assert.NotNil(t, err, test.name)
187
+ })
188
+ }
189
+ })
190
+ }
191
+
192
+ func Test_ParsingFromSingleRefDeprecated(t *testing.T) {
193
+ t.Run("from a local object ref that is well-formed", func(t *testing.T) {
194
+ uri := strfmt.URI("weaviate://localhost/c2cd3f91-0160-477e-869a-8da8829e0a4d")
195
+ singleRef := &models.SingleRef{
196
+ Beacon: uri,
197
+ }
198
+ ref, err := ParseSingleRef(singleRef)
199
+
200
+ require.Nil(t, err, "should not error")
201
+
202
+ t.Run("is a local ref", func(t *testing.T) {
203
+ assert.Equal(t, ref.Local, true)
204
+ })
205
+
206
+ t.Run("peerName points to localhost", func(t *testing.T) {
207
+ assert.Equal(t, ref.PeerName, "localhost")
208
+ })
209
+
210
+ t.Run("id points correctly", func(t *testing.T) {
211
+ assert.Equal(t, ref.TargetID, strfmt.UUID("c2cd3f91-0160-477e-869a-8da8829e0a4d"))
212
+ })
213
+ })
214
+ }
215
+
216
+ func Test_GenerateStringDeprecated(t *testing.T) {
217
+ uri := "weaviate://localhost/c2cd3f91-0160-477e-869a-8da8829e0a4d"
218
+ ref, err := Parse(uri)
219
+
220
+ require.Nil(t, err, "should not error")
221
+ assert.Equal(t, uri, ref.String(), "should be the same as the input string")
222
+ }
223
+
224
+ func Test_DeprecatedSingleRef(t *testing.T) {
225
+ uri := "weaviate://localhost/c2cd3f91-0160-477e-869a-8da8829e0a4d"
226
+ ref, err := Parse(uri)
227
+ expectedResult := &models.SingleRef{
228
+ Beacon: strfmt.URI(uri),
229
+ }
230
+
231
+ require.Nil(t, err, "should not error")
232
+ assert.Equal(t, expectedResult, ref.SingleRef(), "should create a singleRef (api construct)")
233
+ }
platform/dbops/binaries/weaviate-src/entities/schema/test_utils/nested_properties.go ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // _ _
2
+ // __ _____ __ ___ ___ __ _| |_ ___
3
+ // \ \ /\ / / _ \/ _` \ \ / / |/ _` | __/ _ \
4
+ // \ V V / __/ (_| |\ V /| | (_| | || __/
5
+ // \_/\_/ \___|\__,_| \_/ |_|\__,_|\__\___|
6
+ //
7
+ // Copyright © 2016 - 2025 Weaviate B.V. All rights reserved.
8
+ //
9
+ // CONTACT: hello@weaviate.io
10
+ //
11
+
12
+ package test_utils
13
+
14
+ import (
15
+ "testing"
16
+
17
+ "github.com/stretchr/testify/assert"
18
+ "github.com/stretchr/testify/require"
19
+ "github.com/weaviate/weaviate/entities/models"
20
+ "github.com/weaviate/weaviate/entities/schema"
21
+ )
22
+
23
+ func AssertNestedPropsMatch(t *testing.T, nestedPropsA, nestedPropsB []*models.NestedProperty) {
24
+ require.Len(t, nestedPropsB, len(nestedPropsA), "nestedProps: different length")
25
+
26
+ npMap := map[string]int{}
27
+ for index, np := range nestedPropsA {
28
+ npMap[np.Name] = index
29
+ }
30
+
31
+ for _, npB := range nestedPropsB {
32
+ require.Contains(t, npMap, npB.Name)
33
+ npA := nestedPropsA[npMap[npB.Name]]
34
+
35
+ assert.Equal(t, npA.DataType, npB.DataType)
36
+ assert.Equal(t, npA.IndexFilterable, npB.IndexFilterable)
37
+ assert.Equal(t, npA.IndexSearchable, npB.IndexSearchable)
38
+ assert.Equal(t, npA.IndexRangeFilters, npB.IndexRangeFilters)
39
+ assert.Equal(t, npA.Tokenization, npB.Tokenization)
40
+
41
+ if _, isNested := schema.AsNested(npA.DataType); isNested {
42
+ AssertNestedPropsMatch(t, npA.NestedProperties, npB.NestedProperties)
43
+ }
44
+ }
45
+ }
platform/dbops/binaries/weaviate-src/entities/schema/test_utils/properties.go ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // _ _
2
+ // __ _____ __ ___ ___ __ _| |_ ___
3
+ // \ \ /\ / / _ \/ _` \ \ / / |/ _` | __/ _ \
4
+ // \ V V / __/ (_| |\ V /| | (_| | || __/
5
+ // \_/\_/ \___|\__,_| \_/ |_|\__,_|\__\___|
6
+ //
7
+ // Copyright © 2016 - 2025 Weaviate B.V. All rights reserved.
8
+ //
9
+ // CONTACT: hello@weaviate.io
10
+ //
11
+
12
+ package test_utils
13
+
14
+ import (
15
+ "testing"
16
+
17
+ "github.com/stretchr/testify/assert"
18
+ "github.com/stretchr/testify/require"
19
+ "github.com/weaviate/weaviate/entities/models"
20
+ "github.com/weaviate/weaviate/entities/schema"
21
+ )
22
+
23
+ func AssertPropsMatch(t *testing.T, propsA, propsB []*models.Property) {
24
+ require.Len(t, propsB, len(propsA), "props: different length")
25
+
26
+ pMap := map[string]int{}
27
+ for idx, p := range propsA {
28
+ pMap[p.Name] = idx
29
+ }
30
+
31
+ for _, pB := range propsB {
32
+ require.Contains(t, pMap, pB.Name)
33
+ pA := propsA[pMap[pB.Name]]
34
+
35
+ assert.Equal(t, pA.DataType, pB.DataType)
36
+ assert.Equal(t, pA.IndexFilterable, pB.IndexFilterable)
37
+ assert.Equal(t, pA.IndexSearchable, pB.IndexSearchable)
38
+ assert.Equal(t, pA.IndexRangeFilters, pB.IndexRangeFilters)
39
+ assert.Equal(t, pA.Tokenization, pB.Tokenization)
40
+
41
+ if _, isNested := schema.AsNested(pA.DataType); isNested {
42
+ AssertNestedPropsMatch(t, pA.NestedProperties, pB.NestedProperties)
43
+ }
44
+ }
45
+ }
platform/dbops/binaries/weaviate-src/entities/storobj/enrich_schema_datatypes.go ADDED
@@ -0,0 +1,409 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // _ _
2
+ // __ _____ __ ___ ___ __ _| |_ ___
3
+ // \ \ /\ / / _ \/ _` \ \ / / |/ _` | __/ _ \
4
+ // \ V V / __/ (_| |\ V /| | (_| | || __/
5
+ // \_/\_/ \___|\__,_| \_/ |_|\__,_|\__\___|
6
+ //
7
+ // Copyright © 2016 - 2025 Weaviate B.V. All rights reserved.
8
+ //
9
+ // CONTACT: hello@weaviate.io
10
+ //
11
+
12
+ package storobj
13
+
14
+ import (
15
+ "fmt"
16
+
17
+ "github.com/go-openapi/strfmt"
18
+ "github.com/pkg/errors"
19
+ "github.com/weaviate/weaviate/entities/models"
20
+ )
21
+
22
+ func enrichSchemaTypes(schema map[string]interface{}, ofNestedProp bool) error {
23
+ if schema == nil {
24
+ return nil
25
+ }
26
+
27
+ for propName, value := range schema {
28
+ switch typed := value.(type) {
29
+ case []interface{}:
30
+ if isArrayValue(typed) {
31
+ switch typed[0].(type) {
32
+ case float64:
33
+ parsed, err := parseNumberArrayValue(typed)
34
+ if err != nil {
35
+ return errors.Wrapf(err, "property %q of type string array", propName)
36
+ }
37
+
38
+ schema[propName] = parsed
39
+ case bool:
40
+ parsed, err := parseBoolArrayValue(typed)
41
+ if err != nil {
42
+ return errors.Wrapf(err, "property %q of type boolean array", propName)
43
+ }
44
+
45
+ schema[propName] = parsed
46
+ default:
47
+ parsed, err := parseStringArrayValue(typed)
48
+ if err != nil {
49
+ return errors.Wrapf(err, "property %q of type string array", propName)
50
+ }
51
+
52
+ schema[propName] = parsed
53
+ }
54
+ } else if len(typed) == 0 {
55
+ // empty arrays. Here we use []interface{} as a placeholder
56
+ // type for an empty array, since we cannot determine its
57
+ // actual type. in the future, we should persist the schema
58
+ // property type information alongside the value to avoid
59
+ // this situation
60
+ schema[propName] = typed
61
+ } else {
62
+ // nested properties does not support refs
63
+ if !ofNestedProp {
64
+ parsed, err := parseCrossRef(typed)
65
+ if err == nil {
66
+ schema[propName] = parsed
67
+ continue
68
+ }
69
+ }
70
+ // apperently object[]
71
+ for i := range typed {
72
+ t2, ok := typed[i].(map[string]interface{})
73
+ if !ok {
74
+ return fmt.Errorf("expected element [%d] of '%s' to be map, %T found", i, propName, typed[i])
75
+ }
76
+ enrichSchemaTypes(t2, true)
77
+ }
78
+ schema[propName] = typed
79
+ }
80
+ case map[string]interface{}:
81
+ parsed, err := parseMapProp(typed, ofNestedProp)
82
+ if err != nil {
83
+ return errors.Wrapf(err, "property %q of type map", propName)
84
+ }
85
+
86
+ schema[propName] = parsed
87
+ default:
88
+ continue
89
+ }
90
+ }
91
+
92
+ return nil
93
+ }
94
+
95
+ // nested properties does not support phone or geo data types
96
+ func parseMapProp(input map[string]interface{}, ofNestedProp bool) (interface{}, error) {
97
+ if !ofNestedProp && isGeoProp(input) {
98
+ return parseGeoProp(input)
99
+ }
100
+ if !ofNestedProp && isPhoneProp(input) {
101
+ return parsePhoneNumber(input)
102
+ }
103
+ // apparently object
104
+ err := enrichSchemaTypes(input, true)
105
+ return input, err
106
+ }
107
+
108
+ func isGeoProp(input map[string]interface{}) bool {
109
+ expectedProps := []string{"latitude", "longitude"}
110
+
111
+ if len(input) != len(expectedProps) {
112
+ return false
113
+ }
114
+ for _, prop := range expectedProps {
115
+ if _, ok := input[prop]; !ok {
116
+ return false
117
+ }
118
+ }
119
+ return true
120
+ }
121
+
122
+ func isPhoneProp(input map[string]interface{}) bool {
123
+ validExpectedProps := [][]string{
124
+ {"input", "internationalFormatted", "nationalFormatted", "national", "countryCode", "valid"},
125
+ {"input", "internationalFormatted", "nationalFormatted", "national", "countryCode", "valid", "defaultCountry"},
126
+ {"input", "internationalFormatted", "nationalFormatted", "national", "countryCode"},
127
+ {"input", "internationalFormatted", "nationalFormatted", "national", "countryCode", "defaultCountry"},
128
+ }
129
+
130
+ for _, expectedProps := range validExpectedProps {
131
+ match := true
132
+ if len(expectedProps) != len(input) {
133
+ match = false
134
+ } else {
135
+ for _, prop := range expectedProps {
136
+ if _, ok := input[prop]; !ok {
137
+ match = false
138
+ break
139
+ }
140
+ }
141
+ }
142
+ if match {
143
+ return true
144
+ }
145
+ }
146
+ return false
147
+ }
148
+
149
+ func parseGeoProp(input map[string]interface{}) (*models.GeoCoordinates, error) {
150
+ latFloat, ok := input["latitude"].(float64)
151
+ if !ok {
152
+ return nil, fmt.Errorf("explected lat to be float64, but is %T", input["latitude"])
153
+ }
154
+
155
+ lonFloat, ok := input["longitude"].(float64)
156
+ if !ok {
157
+ return nil, fmt.Errorf("explected lon to be float64, but is %T", input["longitude"])
158
+ }
159
+
160
+ return &models.GeoCoordinates{
161
+ Latitude: ptFloat32(float32(latFloat)),
162
+ Longitude: ptFloat32(float32(lonFloat)),
163
+ }, nil
164
+ }
165
+
166
+ func ptFloat32(in float32) *float32 {
167
+ return &in
168
+ }
169
+
170
+ func parsePhoneNumber(input map[string]interface{}) (*models.PhoneNumber, error) {
171
+ out := &models.PhoneNumber{}
172
+
173
+ phoneInput, err := extractStringFromMap(input, "input")
174
+ if err != nil {
175
+ return nil, err
176
+ }
177
+ out.Input = phoneInput
178
+
179
+ international, err := extractStringFromMap(input, "internationalFormatted")
180
+ if err != nil {
181
+ return nil, err
182
+ }
183
+ out.InternationalFormatted = international
184
+
185
+ nationalFormatted, err := extractStringFromMap(input, "nationalFormatted")
186
+ if err != nil {
187
+ return nil, err
188
+ }
189
+ out.NationalFormatted = nationalFormatted
190
+
191
+ national, err := extractNumberFromMap(input, "national")
192
+ if err != nil {
193
+ return nil, err
194
+ }
195
+ out.National = uint64(national)
196
+
197
+ countryCode, err := extractNumberFromMap(input, "countryCode")
198
+ if err != nil {
199
+ return nil, err
200
+ }
201
+ out.CountryCode = uint64(countryCode)
202
+
203
+ defaultCountry, err := extractStringFromMap(input, "defaultCountry")
204
+ if err != nil {
205
+ return nil, err
206
+ }
207
+ out.DefaultCountry = defaultCountry
208
+
209
+ valid, err := extractBoolFromMap(input, "valid")
210
+ if err != nil {
211
+ return nil, err
212
+ }
213
+ out.Valid = valid
214
+
215
+ return out, nil
216
+ }
217
+
218
+ func extractNumberFromMap(input map[string]interface{}, key string) (float64, error) {
219
+ field, ok := input[key]
220
+ if ok {
221
+ asFloat, ok := field.(float64)
222
+ if !ok {
223
+ return 0, fmt.Errorf("expected '%s' to be float64, but is %T", key, field)
224
+ }
225
+
226
+ return asFloat, nil
227
+ }
228
+ return 0, nil
229
+ }
230
+
231
+ func extractStringFromMap(input map[string]interface{}, key string) (string, error) {
232
+ field, ok := input[key]
233
+ if ok {
234
+ asString, ok := field.(string)
235
+ if !ok {
236
+ return "", fmt.Errorf("expected '%s' to be string, but is %T", key, field)
237
+ }
238
+
239
+ return asString, nil
240
+ }
241
+ return "", nil
242
+ }
243
+
244
+ func extractBoolFromMap(input map[string]interface{}, key string) (bool, error) {
245
+ field, ok := input[key]
246
+ if ok {
247
+ asBool, ok := field.(bool)
248
+ if !ok {
249
+ return false, fmt.Errorf("expected '%s' to be bool, but is %T", key, field)
250
+ }
251
+
252
+ return asBool, nil
253
+ }
254
+ return false, nil
255
+ }
256
+
257
+ func isArrayValue(value []interface{}) bool {
258
+ if len(value) > 0 {
259
+ _, ok := value[0].(map[string]interface{})
260
+ return !ok
261
+ }
262
+ return false
263
+ }
264
+
265
+ func parseStringArrayValue(value []interface{}) ([]string, error) {
266
+ parsed := make([]string, len(value))
267
+ for i := range value {
268
+ asString, ok := value[i].(string)
269
+ if !ok {
270
+ return nil, fmt.Errorf("string array: expected element %d to be string - got %T", i, value[i])
271
+ }
272
+ parsed[i] = asString
273
+ }
274
+ return parsed, nil
275
+ }
276
+
277
+ func parseNumberArrayValue(value []interface{}) ([]float64, error) {
278
+ parsed := make([]float64, len(value))
279
+ for i := range value {
280
+ asFloat, ok := value[i].(float64)
281
+ if !ok {
282
+ return nil, fmt.Errorf("number array: expected element %d to be float - got %T", i, value[i])
283
+ }
284
+ parsed[i] = asFloat
285
+ }
286
+ return parsed, nil
287
+ }
288
+
289
+ func parseBoolArrayValue(value []interface{}) ([]bool, error) {
290
+ parsed := make([]bool, len(value))
291
+ for i := range value {
292
+ asBool, ok := value[i].(bool)
293
+ if !ok {
294
+ return nil, fmt.Errorf("boolean array: expected element %d to be bool - got %T", i, value[i])
295
+ }
296
+ parsed[i] = asBool
297
+ }
298
+ return parsed, nil
299
+ }
300
+
301
+ func parseCrossRef(value []interface{}) (models.MultipleRef, error) {
302
+ parsed := make(models.MultipleRef, len(value))
303
+ for i, elem := range value {
304
+ asMap, ok := elem.(map[string]interface{})
305
+ if !ok {
306
+ return nil, fmt.Errorf("crossref: expected element %d to be map - got %T", i, elem)
307
+ }
308
+
309
+ beacon, ok := asMap["beacon"]
310
+ if !ok {
311
+ return nil, fmt.Errorf("crossref: expected element %d to have key %q - got %v", i, "beacon", elem)
312
+ }
313
+
314
+ beaconStr, ok := beacon.(string)
315
+ if !ok {
316
+ return nil, fmt.Errorf("crossref: expected element %d.beacon to be string - got %T", i, beacon)
317
+ }
318
+
319
+ parsed[i] = &models.SingleRef{
320
+ Beacon: strfmt.URI(beaconStr),
321
+ }
322
+
323
+ c, ok := asMap["classification"]
324
+ if ok {
325
+ classification, err := parseRefClassificationMeta(c)
326
+ if err != nil {
327
+ return nil, errors.Wrap(err, "crossref: parse classifiation meta")
328
+ }
329
+
330
+ parsed[i].Classification = classification
331
+ }
332
+ }
333
+
334
+ return parsed, nil
335
+ }
336
+
337
+ func parseRefClassificationMeta(in interface{}) (*models.ReferenceMetaClassification, error) {
338
+ out := &models.ReferenceMetaClassification{}
339
+ asMap, ok := in.(map[string]interface{})
340
+ if !ok {
341
+ return nil, fmt.Errorf("expected classification to be map - got %T", in)
342
+ }
343
+
344
+ if cod, err := extractFloat64(asMap, "closestOverallDistance"); err != nil {
345
+ return nil, err
346
+ } else {
347
+ out.ClosestOverallDistance = cod
348
+ }
349
+
350
+ if mwd, err := extractFloat64(asMap, "meanWinningDistance"); err != nil {
351
+ return nil, err
352
+ } else {
353
+ out.WinningDistance = mwd // deprecated remove in 0.23.0
354
+ out.MeanWinningDistance = mwd
355
+ }
356
+
357
+ if cwd, err := extractFloat64(asMap, "closestWinningDistance"); err != nil {
358
+ return nil, err
359
+ } else {
360
+ out.ClosestWinningDistance = cwd
361
+ }
362
+
363
+ if mcd, err := extractFloat64(asMap, "meanLosingDistance"); err != nil {
364
+ return nil, err
365
+ } else {
366
+ out.LosingDistance = &mcd // deprecated remove in 0.23.0
367
+ out.MeanLosingDistance = &mcd
368
+ }
369
+
370
+ if ccd, err := extractFloat64(asMap, "closestLosingDistance"); err != nil {
371
+ return nil, err
372
+ } else {
373
+ out.ClosestLosingDistance = &ccd
374
+ }
375
+
376
+ if oc, err := extractFloat64(asMap, "overallCount"); err != nil {
377
+ return nil, err
378
+ } else {
379
+ out.OverallCount = int64(oc)
380
+ }
381
+
382
+ if wc, err := extractFloat64(asMap, "winningCount"); err != nil {
383
+ return nil, err
384
+ } else {
385
+ out.WinningCount = int64(wc)
386
+ }
387
+
388
+ if lc, err := extractFloat64(asMap, "losingCount"); err != nil {
389
+ return nil, err
390
+ } else {
391
+ out.LosingCount = int64(lc)
392
+ }
393
+
394
+ return out, nil
395
+ }
396
+
397
+ func extractFloat64(source map[string]interface{}, key string) (float64, error) {
398
+ value, ok := source[key]
399
+ if !ok {
400
+ return 0, nil
401
+ }
402
+
403
+ asFloat, ok := value.(float64)
404
+ if !ok {
405
+ return 0, fmt.Errorf("expected %s to be float64 - got %T", key, value)
406
+ }
407
+
408
+ return asFloat, nil
409
+ }
platform/dbops/binaries/weaviate-src/entities/storobj/errors.go ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // _ _
2
+ // __ _____ __ ___ ___ __ _| |_ ___
3
+ // \ \ /\ / / _ \/ _` \ \ / / |/ _` | __/ _ \
4
+ // \ V V / __/ (_| |\ V /| | (_| | || __/
5
+ // \_/\_/ \___|\__,_| \_/ |_|\__,_|\__\___|
6
+ //
7
+ // Copyright © 2016 - 2025 Weaviate B.V. All rights reserved.
8
+ //
9
+ // CONTACT: hello@weaviate.io
10
+ //
11
+
12
+ package storobj
13
+
14
+ import "fmt"
15
+
16
+ type ErrNotFound struct {
17
+ DocID uint64
18
+ OriginalMsg string
19
+ }
20
+
21
+ func NewErrNotFoundf(docID uint64, msg string, args ...interface{}) error {
22
+ return ErrNotFound{
23
+ DocID: docID,
24
+ OriginalMsg: fmt.Sprintf(msg, args...),
25
+ }
26
+ }
27
+
28
+ func (err ErrNotFound) Error() string {
29
+ return fmt.Sprintf("no object found for doc id %d: %s", err.DocID, err.OriginalMsg)
30
+ }
platform/dbops/binaries/weaviate-src/entities/storobj/parse_single_object.go ADDED
@@ -0,0 +1,173 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // _ _
2
+ // __ _____ __ ___ ___ __ _| |_ ___
3
+ // \ \ /\ / / _ \/ _` \ \ / / |/ _` | __/ _ \
4
+ // \ V V / __/ (_| |\ V /| | (_| | || __/
5
+ // \_/\_/ \___|\__,_| \_/ |_|\__,_|\__\___|
6
+ //
7
+ // Copyright © 2016 - 2025 Weaviate B.V. All rights reserved.
8
+ //
9
+ // CONTACT: hello@weaviate.io
10
+ //
11
+
12
+ package storobj
13
+
14
+ import (
15
+ "bytes"
16
+ "encoding/binary"
17
+ "strconv"
18
+
19
+ "github.com/buger/jsonparser"
20
+ "github.com/google/uuid"
21
+ "github.com/pkg/errors"
22
+ )
23
+
24
+ func ParseAndExtractProperty(data []byte, propName string) ([]string, bool, error) {
25
+ if propName == "id" || propName == "_id" {
26
+ return extractID(data)
27
+ }
28
+ if propName == "_creationTimeUnix" {
29
+ return extractCreationTimeUnix(data)
30
+ }
31
+ if propName == "_lastUpdateTimeUnix" {
32
+ return extractLastUpdateTimeUnix(data)
33
+ }
34
+ return ParseAndExtractTextProp(data, propName)
35
+ }
36
+
37
+ func ParseAndExtractTextProp(data []byte, propName string) ([]string, bool, error) {
38
+ vals := []string{}
39
+ err := parseAndExtractValueProp(data, propName, func(value []byte) {
40
+ vals = append(vals, string(value))
41
+ })
42
+ if err != nil {
43
+ return nil, false, err
44
+ }
45
+ return vals, true, nil
46
+ }
47
+
48
+ func ParseAndExtractNumberArrayProp(data []byte, propName string) ([]float64, bool, error) {
49
+ vals := []float64{}
50
+ err := parseAndExtractValueProp(data, propName, func(value []byte) {
51
+ vals = append(vals, mustExtractNumber(value))
52
+ })
53
+ if err != nil {
54
+ return nil, false, err
55
+ }
56
+ return vals, true, nil
57
+ }
58
+
59
+ func ParseAndExtractBoolArrayProp(data []byte, propName string) ([]bool, bool, error) {
60
+ vals := []bool{}
61
+ err := parseAndExtractValueProp(data, propName, func(value []byte) {
62
+ vals = append(vals, mustExtractBool(value))
63
+ })
64
+ if err != nil {
65
+ return nil, false, err
66
+ }
67
+ return vals, true, nil
68
+ }
69
+
70
+ func parseAndExtractValueProp(data []byte, propName string, valueFn func(value []byte)) error {
71
+ propsBytes, err := extractPropsBytes(data)
72
+ if err != nil {
73
+ return err
74
+ }
75
+
76
+ val, t, _, err := jsonparser.Get(propsBytes, propName)
77
+ // Some objects can have nil as value for the property, in this case skip the object
78
+ if err != nil {
79
+ if err.Error() == "Key path not found" {
80
+ return nil
81
+ }
82
+ return err
83
+ }
84
+
85
+ if t == jsonparser.Array {
86
+ jsonparser.ArrayEach(val, func(value []byte, dataType jsonparser.ValueType, offset int, err error) {
87
+ valueFn(value)
88
+ })
89
+ } else {
90
+ valueFn(val)
91
+ }
92
+
93
+ return nil
94
+ }
95
+
96
+ func mustExtractNumber(value []byte) float64 {
97
+ number, err := strconv.ParseFloat(string(value), 64)
98
+ if err != nil {
99
+ panic("not a float64")
100
+ }
101
+ return number
102
+ }
103
+
104
+ func mustExtractBool(value []byte) bool {
105
+ boolVal, err := strconv.ParseBool(string(value))
106
+ if err != nil {
107
+ panic("not a bool")
108
+ }
109
+ return boolVal
110
+ }
111
+
112
+ func extractID(data []byte) ([]string, bool, error) {
113
+ start := 1 + 8 + 1
114
+ end := start + 16
115
+ if len(data) > end {
116
+ uuidParsed, err := uuid.FromBytes(data[start:end])
117
+ if err != nil {
118
+ return nil, false, errors.New("cannot parse id property")
119
+ }
120
+ return []string{uuidParsed.String()}, true, nil
121
+ }
122
+ return nil, false, errors.New("id property not found")
123
+ }
124
+
125
+ func extractCreationTimeUnix(data []byte) ([]string, bool, error) {
126
+ start := 1 + 8 + 1 + 16
127
+ end := start + 8
128
+ if len(data) > end {
129
+ return extractTimeUnix(data[start:end], "_creationTimeUnix")
130
+ }
131
+ return nil, false, errors.New("_creationTimeUnix property not found")
132
+ }
133
+
134
+ func extractLastUpdateTimeUnix(data []byte) ([]string, bool, error) {
135
+ start := 1 + 8 + 1 + 16 + 8
136
+ end := start + 8
137
+ if len(data) > end {
138
+ return extractTimeUnix(data[start:end], "_lastUpdateTimeUnix")
139
+ }
140
+ return nil, false, errors.New("_lastUpdateTimeUnix property not found")
141
+ }
142
+
143
+ func extractTimeUnix(data []byte, propertyName string) ([]string, bool, error) {
144
+ var timeUnix int64
145
+ r := bytes.NewReader(data)
146
+ if err := binary.Read(r, binary.LittleEndian, &timeUnix); err != nil {
147
+ return nil, false, errors.Errorf("cannot parse %s property", propertyName)
148
+ }
149
+ return []string{strconv.FormatInt(timeUnix, 10)}, true, nil
150
+ }
151
+
152
+ func extractPropsBytes(data []byte) ([]byte, error) {
153
+ version := uint8(data[0])
154
+ if version != 1 {
155
+ return nil, errors.Errorf("unsupported binary marshaller version %d", version)
156
+ }
157
+
158
+ vecLen := binary.LittleEndian.Uint16(data[discardBytesPreVector : discardBytesPreVector+2])
159
+
160
+ classNameStart := int64(discardBytesPreVector) + 2 + int64(vecLen)*4
161
+
162
+ classNameLen := binary.LittleEndian.Uint16(data[classNameStart : classNameStart+2])
163
+
164
+ propsLenStart := classNameStart + 2 + int64(classNameLen)
165
+ propsLen := binary.LittleEndian.Uint32(data[propsLenStart : propsLenStart+4])
166
+
167
+ start := int64(propsLenStart + 4)
168
+ end := start + int64(propsLen)
169
+
170
+ return data[start:end], nil
171
+ }
172
+
173
+ const discardBytesPreVector = 1 + 8 + 1 + 16 + 8 + 8
platform/dbops/binaries/weaviate-src/entities/storobj/storage_object.go ADDED
@@ -0,0 +1,1643 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // _ _
2
+ // __ _____ __ ___ ___ __ _| |_ ___
3
+ // \ \ /\ / / _ \/ _` \ \ / / |/ _` | __/ _ \
4
+ // \ V V / __/ (_| |\ V /| | (_| | || __/
5
+ // \_/\_/ \___|\__,_| \_/ |_|\__,_|\__\___|
6
+ //
7
+ // Copyright © 2016 - 2025 Weaviate B.V. All rights reserved.
8
+ //
9
+ // CONTACT: hello@weaviate.io
10
+ //
11
+
12
+ package storobj
13
+
14
+ import (
15
+ "bytes"
16
+ "encoding/binary"
17
+ "encoding/json"
18
+ "fmt"
19
+ "io"
20
+ "math"
21
+ "runtime"
22
+
23
+ "github.com/buger/jsonparser"
24
+ "github.com/go-openapi/strfmt"
25
+ "github.com/google/uuid"
26
+ "github.com/pkg/errors"
27
+ "github.com/sirupsen/logrus"
28
+ "github.com/vmihailenco/msgpack/v5"
29
+ "github.com/weaviate/weaviate/entities/additional"
30
+ errwrap "github.com/weaviate/weaviate/entities/errors"
31
+ "github.com/weaviate/weaviate/entities/models"
32
+ "github.com/weaviate/weaviate/entities/schema"
33
+ "github.com/weaviate/weaviate/entities/search"
34
+ "github.com/weaviate/weaviate/usecases/byteops"
35
+ )
36
+
37
+ var bufPool *bufferPool
38
+
39
+ type Vectors map[string][]float32
40
+
41
+ func init() {
42
+ // a 10kB buffer should be large enough for typical cases, it can fit a
43
+ // 1536d uncompressed vector and about 3kB of object payload. If the
44
+ // initial size is not large enoug, the caller can always allocate a larger
45
+ // buffer and return that to the pool instead.
46
+ bufPool = newBufferPool(10 * 1024)
47
+ }
48
+
49
+ type Object struct {
50
+ MarshallerVersion uint8
51
+ Object models.Object `json:"object"`
52
+ Vector []float32 `json:"vector"`
53
+ VectorLen int `json:"-"`
54
+ BelongsToNode string `json:"-"`
55
+ BelongsToShard string `json:"-"`
56
+ IsConsistent bool `json:"-"`
57
+ DocID uint64
58
+ Vectors map[string][]float32 `json:"vectors"`
59
+ MultiVectors map[string][][]float32 `json:"multivectors"`
60
+ }
61
+
62
+ func New(docID uint64) *Object {
63
+ return &Object{
64
+ MarshallerVersion: 1,
65
+ DocID: docID,
66
+ }
67
+ }
68
+
69
+ // TODO: temporary solution
70
+ func FromObject(object *models.Object, vector []float32, vectors map[string][]float32, multivectors map[string][][]float32) *Object {
71
+ // clear out nil entries of properties to make sure leaving a property out and setting it nil is identical
72
+ properties, ok := object.Properties.(map[string]interface{})
73
+ if ok {
74
+ for key, prop := range properties {
75
+ if prop == nil {
76
+ delete(properties, key)
77
+ }
78
+ }
79
+ object.Properties = properties
80
+ }
81
+
82
+ var vecs map[string][]float32
83
+ if vectors != nil {
84
+ vecs = make(map[string][]float32)
85
+ for targetVector, vector := range vectors {
86
+ vecs[targetVector] = vector
87
+ }
88
+ }
89
+
90
+ var multiVectors map[string][][]float32
91
+ if multivectors != nil {
92
+
93
+ multiVectors = make(map[string][][]float32)
94
+ for targetVector, vectors := range multivectors {
95
+ multiVectors[targetVector] = vectors
96
+ }
97
+ }
98
+
99
+ return &Object{
100
+ Object: *object,
101
+ Vector: vector,
102
+ MarshallerVersion: 1,
103
+ VectorLen: len(vector),
104
+ Vectors: vecs,
105
+ MultiVectors: multiVectors,
106
+ }
107
+ }
108
+
109
+ func FromBinary(data []byte) (*Object, error) {
110
+ ko := &Object{}
111
+ if err := ko.UnmarshalBinary(data); err != nil {
112
+ return nil, err
113
+ }
114
+
115
+ return ko, nil
116
+ }
117
+
118
+ func FromBinaryUUIDOnly(data []byte) (*Object, error) {
119
+ ko := &Object{}
120
+
121
+ rw := byteops.NewReadWriter(data)
122
+ version := rw.ReadUint8()
123
+ if version != 1 {
124
+ return nil, errors.Errorf("unsupported binary marshaller version %d", version)
125
+ }
126
+
127
+ ko.MarshallerVersion = version
128
+
129
+ ko.DocID = rw.ReadUint64()
130
+ rw.MoveBufferPositionForward(1) // ignore kind-byte
131
+ uuidObj, err := uuid.FromBytes(rw.ReadBytesFromBuffer(16))
132
+ if err != nil {
133
+ return nil, fmt.Errorf("parse uuid: %w", err)
134
+ }
135
+ ko.Object.ID = strfmt.UUID(uuidObj.String())
136
+
137
+ ko.Object.CreationTimeUnix = int64(rw.ReadUint64())
138
+ ko.Object.LastUpdateTimeUnix = int64(rw.ReadUint64())
139
+
140
+ vecLen := rw.ReadUint16()
141
+ rw.MoveBufferPositionForward(uint64(vecLen * 4))
142
+ classNameLen := rw.ReadUint16()
143
+
144
+ ko.Object.Class = string(rw.ReadBytesFromBuffer(uint64(classNameLen)))
145
+
146
+ return ko, nil
147
+ }
148
+
149
+ func FromBinaryOptional(data []byte,
150
+ addProp additional.Properties, properties *PropertyExtraction,
151
+ ) (*Object, error) {
152
+ ko := &Object{}
153
+
154
+ rw := byteops.NewReadWriter(data)
155
+ ko.MarshallerVersion = rw.ReadUint8()
156
+ if ko.MarshallerVersion != 1 {
157
+ return nil, errors.Errorf("unsupported binary marshaller version %d", ko.MarshallerVersion)
158
+ }
159
+ ko.DocID = rw.ReadUint64()
160
+ rw.MoveBufferPositionForward(1) // ignore kind-byte
161
+ uuidObj, err := uuid.FromBytes(rw.ReadBytesFromBuffer(16))
162
+ if err != nil {
163
+ return nil, fmt.Errorf("parse uuid: %w", err)
164
+ }
165
+ uuidParsed := strfmt.UUID(uuidObj.String())
166
+
167
+ createTime := int64(rw.ReadUint64())
168
+ updateTime := int64(rw.ReadUint64())
169
+ vectorLength := rw.ReadUint16()
170
+ // The vector length should always be returned (for usage metrics purposes) even if the vector itself is skipped
171
+ ko.VectorLen = int(vectorLength)
172
+ if addProp.Vector {
173
+ ko.Object.Vector = make([]float32, vectorLength)
174
+ vectorBytes := rw.ReadBytesFromBuffer(uint64(vectorLength) * 4)
175
+ for i := 0; i < int(vectorLength); i++ {
176
+ bits := binary.LittleEndian.Uint32(vectorBytes[i*4 : (i+1)*4])
177
+ ko.Object.Vector[i] = math.Float32frombits(bits)
178
+ }
179
+ } else {
180
+ rw.MoveBufferPositionForward(uint64(vectorLength) * 4)
181
+ ko.Object.Vector = nil
182
+ }
183
+ ko.Vector = ko.Object.Vector
184
+
185
+ classNameLen := rw.ReadUint16()
186
+ className := string(rw.ReadBytesFromBuffer(uint64(classNameLen)))
187
+
188
+ propLength := rw.ReadUint32()
189
+ var props []byte
190
+ if addProp.NoProps {
191
+ rw.MoveBufferPositionForward(uint64(propLength))
192
+ } else {
193
+ props = rw.ReadBytesFromBuffer(uint64(propLength))
194
+ }
195
+
196
+ var meta []byte
197
+ metaLength := rw.ReadUint32()
198
+ if addProp.Classification || len(addProp.ModuleParams) > 0 {
199
+ meta = rw.ReadBytesFromBuffer(uint64(metaLength))
200
+ } else {
201
+ rw.MoveBufferPositionForward(uint64(metaLength))
202
+ }
203
+
204
+ vectorWeightsLength := rw.ReadUint32()
205
+ vectorWeights := rw.ReadBytesFromBuffer(uint64(vectorWeightsLength))
206
+
207
+ if len(addProp.Vectors) > 0 {
208
+ vectors, err := unmarshalTargetVectors(&rw)
209
+ if err != nil {
210
+ return nil, err
211
+ }
212
+ ko.Vectors = vectors
213
+
214
+ if vectors != nil {
215
+ // If parseObject is called, ko.Object will be overwritten making this effectively a
216
+ // no-op, but I'm leaving it here for now to avoid breaking anything.
217
+ ko.Object.Vectors = make(models.Vectors)
218
+ for vecName, vec := range vectors {
219
+ ko.Object.Vectors[vecName] = vec
220
+ }
221
+ }
222
+ } else {
223
+ if rw.Position < uint64(len(rw.Buffer)) {
224
+ _ = rw.ReadBytesFromBufferWithUint32LengthIndicator()
225
+ targetVectorsSegmentLength := rw.ReadUint32()
226
+ pos := rw.Position
227
+ rw.MoveBufferToAbsolutePosition(pos + uint64(targetVectorsSegmentLength))
228
+ }
229
+ }
230
+
231
+ if rw.Position < uint64(len(rw.Buffer)) && len(addProp.Vectors) > 0 {
232
+ vectorNamesToUnmarshal := map[string]interface{}{}
233
+ for _, name := range addProp.Vectors {
234
+ vectorNamesToUnmarshal[name] = nil
235
+ }
236
+ multiVectors, err := unmarshalMultiVectors(&rw, vectorNamesToUnmarshal)
237
+ if err != nil {
238
+ return nil, err
239
+ }
240
+ ko.MultiVectors = multiVectors
241
+
242
+ if multiVectors != nil {
243
+ // If parseObject is called, ko.Object will be overwritten making this effectively a
244
+ // no-op, but I'm leaving it here to match the target vector behavior.
245
+ if ko.Object.Vectors == nil {
246
+ ko.Object.Vectors = make(models.Vectors)
247
+ }
248
+ for vecName, vec := range multiVectors {
249
+ // assume at this level target vectors and multi vectors won't have the same name
250
+ ko.Object.Vectors[vecName] = vec
251
+ }
252
+ }
253
+ }
254
+
255
+ // some object members need additional "enrichment". Only do this if necessary, ie if they are actually present
256
+ if len(props) > 0 ||
257
+ len(meta) > 0 ||
258
+ vectorWeightsLength > 0 &&
259
+ !( // if the length is 4 and the encoded value is "null" (in ascii), vectorweights are not actually present
260
+ vectorWeightsLength == 4 &&
261
+ vectorWeights[0] == 110 && // n
262
+ vectorWeights[1] == 117 && // u
263
+ vectorWeights[2] == 108 && // l
264
+ vectorWeights[3] == 108) { // l
265
+
266
+ if err := ko.parseObject(
267
+ uuidParsed,
268
+ createTime,
269
+ updateTime,
270
+ className,
271
+ props,
272
+ meta,
273
+ vectorWeights,
274
+ properties,
275
+ propLength,
276
+ ); err != nil {
277
+ return nil, errors.Wrap(err, "parse")
278
+ }
279
+ } else {
280
+ ko.Object.ID = uuidParsed
281
+ ko.Object.CreationTimeUnix = createTime
282
+ ko.Object.LastUpdateTimeUnix = updateTime
283
+ ko.Object.Class = className
284
+ }
285
+
286
+ return ko, nil
287
+ }
288
+
289
+ type PropertyExtraction struct {
290
+ PropertyPaths [][]string
291
+ }
292
+
293
+ func NewPropExtraction() *PropertyExtraction {
294
+ return &PropertyExtraction{
295
+ PropertyPaths: [][]string{},
296
+ }
297
+ }
298
+
299
+ func (pe *PropertyExtraction) Add(props ...string) *PropertyExtraction {
300
+ for i := range props {
301
+ pe.PropertyPaths = append(pe.PropertyPaths, []string{props[i]})
302
+ }
303
+ return pe
304
+ }
305
+
306
+ type bucket interface {
307
+ GetBySecondary(int, []byte) ([]byte, error)
308
+ GetBySecondaryWithBuffer(int, []byte, []byte) ([]byte, []byte, error)
309
+ }
310
+
311
+ func ObjectsByDocID(bucket bucket, ids []uint64,
312
+ additional additional.Properties, properties []string, logger logrus.FieldLogger,
313
+ ) ([]*Object, error) {
314
+ if len(ids) == 1 { // no need to try to run concurrently if there is just one result anyway
315
+ return objectsByDocIDSequential(bucket, ids, additional, properties)
316
+ }
317
+
318
+ return objectsByDocIDParallel(bucket, ids, additional, properties, logger)
319
+ }
320
+
321
+ func objectsByDocIDParallel(bucket bucket, ids []uint64,
322
+ addProp additional.Properties, properties []string, logger logrus.FieldLogger,
323
+ ) ([]*Object, error) {
324
+ parallel := 2 * runtime.GOMAXPROCS(0)
325
+
326
+ out := make([]*Object, len(ids))
327
+
328
+ chunkSize := max(int(math.Ceil(float64(len(ids))/float64(parallel))), 1)
329
+
330
+ eg := errwrap.NewErrorGroupWrapper(logger)
331
+
332
+ // prevent unbounded concurrency on massive chunks
333
+ // it's fine to use a multiple of GOMAXPROCS here, as the goroutines are
334
+ // mostly IO-bound
335
+ eg.SetLimit(parallel)
336
+ for chunk := 0; chunk < parallel; chunk++ {
337
+ start := chunk * chunkSize
338
+ end := start + chunkSize
339
+ if end > len(ids) {
340
+ end = len(ids)
341
+ }
342
+
343
+ if start >= len(ids) {
344
+ break
345
+ }
346
+
347
+ eg.Go(func() error {
348
+ objs, err := objectsByDocIDSequential(bucket, ids[start:end], addProp, properties)
349
+ if err != nil {
350
+ return err
351
+ }
352
+ copy(out[start:start+len(objs)], objs)
353
+ return nil
354
+ })
355
+ }
356
+
357
+ if err := eg.Wait(); err != nil {
358
+ return nil, err
359
+ }
360
+
361
+ // fix gaps in the output array
362
+ j := 0
363
+ for i := range out {
364
+ if out[i] != nil {
365
+ out[j] = out[i]
366
+ j++
367
+ }
368
+ }
369
+
370
+ return out[:j], nil
371
+ }
372
+
373
+ func objectsByDocIDSequential(bucket bucket, ids []uint64,
374
+ additional additional.Properties, properties []string,
375
+ ) ([]*Object, error) {
376
+ if bucket == nil {
377
+ return nil, fmt.Errorf("objects bucket not found")
378
+ }
379
+
380
+ var (
381
+ docIDBuf = make([]byte, 8)
382
+ out = make([]*Object, len(ids))
383
+ i = 0
384
+ lsmBuf = bufPool.Get()
385
+ )
386
+
387
+ defer func() {
388
+ bufPool.Put(lsmBuf)
389
+ }()
390
+
391
+ var props *PropertyExtraction = nil
392
+ // not all code paths forward the list of properties that should be extracted - if nil is passed fall back
393
+ if properties != nil {
394
+ propertyPaths := make([][]string, len(properties))
395
+ for j := range properties {
396
+ propertyPaths[j] = []string{properties[j]}
397
+ }
398
+
399
+ props = &PropertyExtraction{
400
+ PropertyPaths: propertyPaths,
401
+ }
402
+ }
403
+
404
+ for _, id := range ids {
405
+ binary.LittleEndian.PutUint64(docIDBuf, id)
406
+ res, newBuf, err := bucket.GetBySecondaryWithBuffer(0, docIDBuf, lsmBuf)
407
+ if err != nil {
408
+ return nil, err
409
+ }
410
+
411
+ lsmBuf = newBuf // may have changed, e.g. because it was grown
412
+
413
+ // If there is a crash and WAL recovery, the inverted index may have objects that are not in the objects bucket.
414
+ // This is an issue that needs to be fixed, but for now we need to reduce the huge amount of log messages that
415
+ // are generated by this issue. Logging the first time we encounter a missing object in a query still resulted
416
+ // in a huge amount of log messages and it will happen on all queries, so we not log at all for now.
417
+ // The user has already been alerted about ppossible data loss when the WAL recovery happened.
418
+ // TODO: consider deleting these entries from the inverted index and alerting the user
419
+ if res == nil {
420
+ continue
421
+ }
422
+
423
+ unmarshalled, err := FromBinaryOptional(res, additional, props)
424
+ if err != nil {
425
+ return nil, errors.Wrapf(err, "unmarshal data object at position %d", i)
426
+ }
427
+
428
+ out[i] = unmarshalled
429
+ i++
430
+ }
431
+
432
+ return out[:i], nil
433
+ }
434
+
435
+ func (ko *Object) Class() schema.ClassName {
436
+ return schema.ClassName(ko.Object.Class)
437
+ }
438
+
439
+ func (ko *Object) SetDocID(id uint64) {
440
+ ko.DocID = id
441
+ }
442
+
443
+ func (ko *Object) GetDocID() uint64 {
444
+ return ko.DocID
445
+ }
446
+
447
+ func (ko *Object) CreationTimeUnix() int64 {
448
+ return ko.Object.CreationTimeUnix
449
+ }
450
+
451
+ func (ko *Object) ExplainScore() string {
452
+ props := ko.AdditionalProperties()
453
+ if props != nil {
454
+ iface := props["explainScore"]
455
+ if iface != nil {
456
+ return iface.(string)
457
+ }
458
+ }
459
+ return ""
460
+ }
461
+
462
+ func (ko *Object) ID() strfmt.UUID {
463
+ return ko.Object.ID
464
+ }
465
+
466
+ func (ko *Object) SetID(id strfmt.UUID) {
467
+ ko.Object.ID = id
468
+ }
469
+
470
+ func (ko *Object) SetClass(class string) {
471
+ ko.Object.Class = class
472
+ }
473
+
474
+ func (ko *Object) LastUpdateTimeUnix() int64 {
475
+ return ko.Object.LastUpdateTimeUnix
476
+ }
477
+
478
+ // AdditionalProperties groups all properties which are stored with the
479
+ // object and not generated at runtime
480
+ func (ko *Object) AdditionalProperties() models.AdditionalProperties {
481
+ return ko.Object.Additional
482
+ }
483
+
484
+ func (ko *Object) Properties() models.PropertySchema {
485
+ return ko.Object.Properties
486
+ }
487
+
488
+ func (ko *Object) PropertiesWithAdditional(
489
+ additional additional.Properties,
490
+ ) models.PropertySchema {
491
+ properties := ko.Properties()
492
+
493
+ if additional.RefMeta {
494
+ // nothing to remove
495
+ return properties
496
+ }
497
+
498
+ asMap, ok := properties.(map[string]interface{})
499
+ if !ok || asMap == nil {
500
+ return properties
501
+ }
502
+
503
+ for propName, value := range asMap {
504
+ asRefs, ok := value.(models.MultipleRef)
505
+ if !ok {
506
+ // not a ref, we can skip
507
+ continue
508
+ }
509
+
510
+ for i := range asRefs {
511
+ asRefs[i].Classification = nil
512
+ }
513
+
514
+ asMap[propName] = asRefs
515
+ }
516
+
517
+ return asMap
518
+ }
519
+
520
+ func (ko *Object) SetProperties(schema models.PropertySchema) {
521
+ ko.Object.Properties = schema
522
+ }
523
+
524
+ func (ko *Object) VectorWeights() models.VectorWeights {
525
+ return ko.Object.VectorWeights
526
+ }
527
+
528
+ func (ko *Object) SearchResult(additional additional.Properties, tenant string) *search.Result {
529
+ propertiesMap, ok := ko.PropertiesWithAdditional(additional).(map[string]interface{})
530
+ if !ok || propertiesMap == nil {
531
+ propertiesMap = map[string]interface{}{}
532
+ }
533
+ propertiesMap["id"] = ko.ID()
534
+ ko.SetProperties(propertiesMap)
535
+
536
+ additionalProperties := models.AdditionalProperties{}
537
+ if ko.AdditionalProperties() != nil {
538
+ if interpretation, ok := additional.ModuleParams["interpretation"]; ok {
539
+ if interpretationValue, ok := interpretation.(bool); ok && interpretationValue {
540
+ additionalProperties["interpretation"] = ko.AdditionalProperties()["interpretation"]
541
+ }
542
+ }
543
+ if additional.Classification {
544
+ additionalProperties["classification"] = ko.AdditionalProperties()["classification"]
545
+ }
546
+ if additional.Group {
547
+ additionalProperties["group"] = ko.AdditionalProperties()["group"]
548
+ }
549
+ }
550
+ if ko.ExplainScore() != "" {
551
+ additionalProperties["explainScore"] = ko.ExplainScore()
552
+ }
553
+
554
+ return &search.Result{
555
+ ID: ko.ID(),
556
+ DocID: &ko.DocID,
557
+ ClassName: ko.Class().String(),
558
+ Schema: ko.Properties(),
559
+ Vector: ko.Vector,
560
+ Vectors: ko.asVectors(ko.Vectors, ko.MultiVectors),
561
+ Dims: ko.VectorLen,
562
+ // VectorWeights: ko.VectorWeights(), // TODO: add vector weights
563
+ Created: ko.CreationTimeUnix(),
564
+ Updated: ko.LastUpdateTimeUnix(),
565
+ AdditionalProperties: additionalProperties,
566
+ // Score is filled in later
567
+ ExplainScore: ko.ExplainScore(),
568
+ IsConsistent: ko.IsConsistent,
569
+ Tenant: tenant, // not part of the binary
570
+ // TODO: Beacon?
571
+ }
572
+ }
573
+
574
+ func (ko *Object) asVectors(vectors map[string][]float32, multiVectors map[string][][]float32) models.Vectors {
575
+ if (len(vectors) + len(multiVectors)) > 0 {
576
+ out := make(models.Vectors)
577
+ for targetVector, vector := range vectors {
578
+ out[targetVector] = vector
579
+ }
580
+ for targetVector, vector := range multiVectors {
581
+ out[targetVector] = vector
582
+ }
583
+ return out
584
+ }
585
+ return nil
586
+ }
587
+
588
+ func (ko *Object) GetVectors() models.Vectors {
589
+ return ko.asVectors(ko.Vectors, ko.MultiVectors)
590
+ }
591
+
592
+ func (ko *Object) SearchResultWithDist(addl additional.Properties, dist float32) search.Result {
593
+ res := ko.SearchResult(addl, "")
594
+ res.Dist = dist
595
+ res.Certainty = float32(additional.DistToCertainty(float64(dist)))
596
+ return *res
597
+ }
598
+
599
+ func (ko *Object) SearchResultWithScore(addl additional.Properties, score float32) search.Result {
600
+ res := ko.SearchResult(addl, "")
601
+ res.Score = score
602
+ return *res
603
+ }
604
+
605
+ func (ko *Object) SearchResultWithScoreAndTenant(addl additional.Properties, score float32, tenant string) search.Result {
606
+ res := ko.SearchResult(addl, tenant)
607
+ res.Score = score
608
+ return *res
609
+ }
610
+
611
+ func (ko *Object) Valid() bool {
612
+ return ko.ID() != "" &&
613
+ ko.Class().String() != ""
614
+ }
615
+
616
+ // IterateThroughVectorDimensions iterates through all vectors present on the Object and invokes
617
+ // the callback with target name and dimensions of the vector.
618
+ func (ko *Object) IterateThroughVectorDimensions(f func(targetVector string, dims int) error) error {
619
+ if len(ko.Vector) > 0 {
620
+ if err := f("", len(ko.Vector)); err != nil {
621
+ return err
622
+ }
623
+ }
624
+
625
+ for targetVector, vector := range ko.Vectors {
626
+ if err := f(targetVector, len(vector)); err != nil {
627
+ return err
628
+ }
629
+ }
630
+
631
+ for targetVector, vectors := range ko.MultiVectors {
632
+ var dims int
633
+ for _, vector := range vectors {
634
+ dims += len(vector)
635
+ }
636
+ if err := f(targetVector, dims); err != nil {
637
+ return err
638
+ }
639
+ }
640
+ return nil
641
+ }
642
+
643
+ func SearchResults(in []*Object, additional additional.Properties, tenant string) search.Results {
644
+ out := make(search.Results, len(in))
645
+
646
+ for i, elem := range in {
647
+ out[i] = *(elem.SearchResult(additional, tenant))
648
+ }
649
+
650
+ return out
651
+ }
652
+
653
+ func SearchResultsWithScore(in []*Object, scores []float32, additional additional.Properties, tenant string) search.Results {
654
+ out := make(search.Results, len(in))
655
+
656
+ for i, elem := range in {
657
+ score := float32(0.0)
658
+ if len(scores) > i {
659
+ score = scores[i]
660
+ }
661
+ out[i] = elem.SearchResultWithScoreAndTenant(additional, score, tenant)
662
+ }
663
+
664
+ return out
665
+ }
666
+
667
+ func SearchResultsWithDists(in []*Object, addl additional.Properties,
668
+ dists []float32,
669
+ ) search.Results {
670
+ out := make(search.Results, len(in))
671
+
672
+ for i, elem := range in {
673
+ out[i] = elem.SearchResultWithDist(addl, dists[i])
674
+ }
675
+
676
+ return out
677
+ }
678
+
679
+ func DocIDFromBinary(in []byte) (uint64, error) {
680
+ if len(in) < 9 {
681
+ return 0, errors.Errorf("binary data too short")
682
+ }
683
+ // first by is kind, then 8 bytes for the docID
684
+ return binary.LittleEndian.Uint64(in[1:9]), nil
685
+ }
686
+
687
+ func DocIDAndTimeFromBinary(in []byte) (docID uint64, updateTime int64, err error) {
688
+ r := bytes.NewReader(in)
689
+
690
+ var version uint8
691
+
692
+ le := binary.LittleEndian
693
+
694
+ if err := binary.Read(r, le, &version); err != nil {
695
+ return 0, 0, err
696
+ }
697
+
698
+ if version != 1 {
699
+ return 0, 0, errors.Errorf("unsupported binary marshaller version %d", version)
700
+ }
701
+
702
+ err = binary.Read(r, le, &docID)
703
+ if err != nil {
704
+ return 0, 0, err
705
+ }
706
+
707
+ var buf [1 + 16 + 8 + 8]byte // kind uuid createtime updatetime
708
+
709
+ _, err = io.ReadFull(r, buf[:])
710
+ if err != nil {
711
+ return 0, 0, err
712
+ }
713
+
714
+ updateTime = int64(binary.LittleEndian.Uint64(buf[1+16+8:]))
715
+
716
+ return docID, updateTime, nil
717
+ }
718
+
719
+ // MarshalBinary creates the binary representation of a kind object. Regardless
720
+ // of the marshaller version the first byte is a uint8 indicating the version
721
+ // followed by the payload which depends on the specific version
722
+ //
723
+ // Version 1
724
+ // No. of B | Type | Content
725
+ // --------------------------------------------------------------
726
+ // 1 | uint8 | MarshallerVersion = 1
727
+ // 8 | uint64 | index id, keep early so id-only lookups are maximum efficient
728
+ // 1 | uint8 | kind, 0=action, 1=thing - deprecated
729
+ // 16 | uint128 | uuid
730
+ // 8 | int64 | create time
731
+ // 8 | int64 | update time
732
+ // 2 | uint16 | VectorLength
733
+ // n*4 | []float32 | vector of length n
734
+ // 2 | uint16 | length of class name
735
+ // n | []byte | className
736
+ // 4 | uint32 | length of schema json
737
+ // n | []byte | schema as json
738
+ // 4 | uint32 | length of meta json
739
+ // n | []byte | meta as json
740
+ // 4 | uint32 | length of vectorweights json
741
+ // n | []byte | vectorweights as json
742
+ // 4 | uint32 | length of packed target vectors offsets (in bytes)
743
+ // n | []byte | packed target vectors offsets map { name : offset_in_bytes }
744
+ // 4 | uint32 | length of target vectors segment (in bytes)
745
+ // n | uint16+[]byte | target vectors segment: sequence of vec_length + vec (uint16 + []byte), (uint16 + []byte) ...
746
+ // 4 | uint32 | length of packed multivector offsets (in bytes)
747
+ // n | []byte | packed multivector offsets map { name : offset_in_bytes }
748
+ // 4 | uint32 | length of multivectors segment (in bytes)
749
+ // 4 + (2 + n*4) | uint32 + (uint16+[]byte) | multivectors segment: num vecs + (vec length + vec floats), ...
750
+ // TODO vec lengths immediately following num vecs so you can jump straight to specific vec?
751
+
752
+ const (
753
+ maxVectorLength int = math.MaxUint16
754
+ maxClassNameLength int = math.MaxUint16
755
+ maxSchemaLength int = math.MaxUint32
756
+ maxMetaLength int = math.MaxUint32
757
+ maxVectorWeightsLength int = math.MaxUint32
758
+ maxTargetVectorsSegmentLength int = math.MaxUint32
759
+ maxTargetVectorsOffsetsLength int = math.MaxUint32
760
+ maxMultiVectorsSegmentLength int = math.MaxUint32
761
+ maxMultiVectorsOffsetsLength int = math.MaxUint32
762
+ )
763
+
764
+ func (ko *Object) MarshalBinary() ([]byte, error) {
765
+ if ko.MarshallerVersion != 1 {
766
+ return nil, errors.Errorf("unsupported marshaller version %d", ko.MarshallerVersion)
767
+ }
768
+
769
+ kindByte := uint8(0)
770
+ // Deprecated Kind field
771
+ kindByte = 1
772
+
773
+ idParsed, err := uuid.Parse(ko.ID().String())
774
+ if err != nil {
775
+ return nil, err
776
+ }
777
+ idBytes, err := idParsed.MarshalBinary()
778
+ if err != nil {
779
+ return nil, err
780
+ }
781
+
782
+ if len(ko.Vector) > maxVectorLength {
783
+ return nil, fmt.Errorf("could not marshal '%s' max length exceeded (%d/%d)", "vector", len(ko.Vector), maxVectorLength)
784
+ }
785
+ vectorLength := uint32(len(ko.Vector))
786
+
787
+ className := []byte(ko.Class())
788
+ if len(className) > maxClassNameLength {
789
+ return nil, fmt.Errorf("could not marshal '%s' max length exceeded (%d/%d)", "className", len(className), maxClassNameLength)
790
+ }
791
+ classNameLength := uint32(len(className))
792
+
793
+ schema, err := json.Marshal(ko.Properties())
794
+ if err != nil {
795
+ return nil, err
796
+ }
797
+ if len(schema) > maxSchemaLength {
798
+ return nil, fmt.Errorf("could not marshal '%s' max length exceeded (%d/%d)", "schema", len(schema), maxSchemaLength)
799
+ }
800
+ schemaLength := uint32(len(schema))
801
+
802
+ meta, err := json.Marshal(ko.AdditionalProperties())
803
+ if err != nil {
804
+ return nil, err
805
+ }
806
+ if len(meta) > maxMetaLength {
807
+ return nil, fmt.Errorf("could not marshal '%s' max length exceeded (%d/%d)", "meta", len(meta), maxMetaLength)
808
+ }
809
+ metaLength := uint32(len(meta))
810
+
811
+ vectorWeights, err := json.Marshal(ko.VectorWeights())
812
+ if err != nil {
813
+ return nil, err
814
+ }
815
+ if len(vectorWeights) > maxVectorWeightsLength {
816
+ return nil, fmt.Errorf("could not marshal '%s' max length exceeded (%d/%d)", "vectorWeights", len(vectorWeights), maxVectorWeightsLength)
817
+ }
818
+ vectorWeightsLength := uint32(len(vectorWeights))
819
+
820
+ var targetVectorsOffsets []byte
821
+ var targetVectorsOffsetsLength uint32
822
+ var targetVectorsSegmentLength int
823
+
824
+ targetVectorsOffsetOrder := make([]string, 0, len(ko.Vectors))
825
+ if len(ko.Vectors) > 0 {
826
+ offsetsMap := map[string]uint32{}
827
+ for name, vec := range ko.Vectors {
828
+ if len(vec) > maxVectorLength {
829
+ return nil, fmt.Errorf("could not marshal '%s' max length exceeded (%d/%d)", "vector", len(vec), maxVectorLength)
830
+ }
831
+
832
+ offsetsMap[name] = uint32(targetVectorsSegmentLength)
833
+ targetVectorsSegmentLength += 2 + 4*len(vec) // 2 for vec length + vec bytes
834
+
835
+ if targetVectorsSegmentLength > maxTargetVectorsSegmentLength {
836
+ return nil,
837
+ fmt.Errorf("could not marshal '%s' max length exceeded (%d/%d)",
838
+ "targetVectorsSegmentLength", targetVectorsSegmentLength, maxTargetVectorsSegmentLength)
839
+ }
840
+
841
+ targetVectorsOffsetOrder = append(targetVectorsOffsetOrder, name)
842
+ }
843
+
844
+ targetVectorsOffsets, err = msgpack.Marshal(offsetsMap)
845
+ if err != nil {
846
+ return nil, fmt.Errorf("could not marshal target vectors offsets: %w", err)
847
+ }
848
+ if len(targetVectorsOffsets) > maxTargetVectorsOffsetsLength {
849
+ return nil, fmt.Errorf("could not marshal '%s' max length exceeded (%d/%d)", "targetVectorsOffsets", len(targetVectorsOffsets), maxTargetVectorsOffsetsLength)
850
+ }
851
+ targetVectorsOffsetsLength = uint32(len(targetVectorsOffsets))
852
+ }
853
+
854
+ var multiVectorsOffsets []byte
855
+ var multiVectorsOffsetsLength uint32
856
+ var multiVectorsSegmentLength int
857
+
858
+ multiVectorsOffsetOrder := make([]string, 0, len(ko.MultiVectors))
859
+ if len(ko.MultiVectors) > 0 {
860
+ offsetsMap := map[string]uint32{}
861
+ for name, vecs := range ko.MultiVectors {
862
+ offsetsMap[name] = uint32(multiVectorsSegmentLength)
863
+ // 4 bytes for number of vectors
864
+ multiVectorsSegmentLength += 4
865
+ for _, vec := range vecs {
866
+ if len(vec) > maxVectorLength {
867
+ return nil, fmt.Errorf("could not marshal '%s' max length exceeded (%d/%d)", "vector", len(vec), maxVectorLength)
868
+ }
869
+ // 2 bytes for vec length and 4 bytes per float32
870
+ multiVectorsSegmentLength += 2 + 4*len(vec)
871
+
872
+ if multiVectorsSegmentLength > maxMultiVectorsSegmentLength {
873
+ return nil,
874
+ fmt.Errorf("could not marshal '%s' max length exceeded (%d/%d)",
875
+ "multiVectorsSegmentLength", multiVectorsSegmentLength, maxMultiVectorsSegmentLength)
876
+ }
877
+ }
878
+ multiVectorsOffsetOrder = append(multiVectorsOffsetOrder, name)
879
+ }
880
+
881
+ multiVectorsOffsets, err = msgpack.Marshal(offsetsMap)
882
+ if err != nil {
883
+ return nil, fmt.Errorf("could not marshal multi vectors offsets: %w", err)
884
+ }
885
+ if len(multiVectorsOffsets) > maxMultiVectorsOffsetsLength {
886
+ return nil, fmt.Errorf("could not marshal '%s' max length exceeded (%d/%d)", "multiVectorsOffsets", len(multiVectorsOffsets), maxMultiVectorsOffsetsLength)
887
+ }
888
+ multiVectorsOffsetsLength = uint32(len(multiVectorsOffsets))
889
+ }
890
+
891
+ totalBufferLength := 1 + 8 + 1 + 16 + 8 + 8 +
892
+ 2 + vectorLength*4 +
893
+ 2 + classNameLength +
894
+ 4 + schemaLength +
895
+ 4 + metaLength +
896
+ 4 + vectorWeightsLength +
897
+ 4 + targetVectorsOffsetsLength +
898
+ 4 + uint32(targetVectorsSegmentLength) +
899
+ 4 + multiVectorsOffsetsLength +
900
+ 4 + uint32(multiVectorsSegmentLength)
901
+
902
+ byteBuffer := make([]byte, totalBufferLength)
903
+ rw := byteops.NewReadWriter(byteBuffer)
904
+ rw.WriteByte(ko.MarshallerVersion)
905
+ rw.WriteUint64(ko.DocID)
906
+ rw.WriteByte(kindByte)
907
+
908
+ rw.CopyBytesToBuffer(idBytes)
909
+
910
+ rw.WriteUint64(uint64(ko.CreationTimeUnix()))
911
+ rw.WriteUint64(uint64(ko.LastUpdateTimeUnix()))
912
+ rw.WriteUint16(uint16(vectorLength))
913
+
914
+ for j := uint32(0); j < vectorLength; j++ {
915
+ rw.WriteUint32(math.Float32bits(ko.Vector[j]))
916
+ }
917
+
918
+ rw.WriteUint16(uint16(classNameLength))
919
+ err = rw.CopyBytesToBuffer(className)
920
+ if err != nil {
921
+ return byteBuffer, errors.Wrap(err, "Could not copy className")
922
+ }
923
+
924
+ rw.WriteUint32(schemaLength)
925
+ err = rw.CopyBytesToBuffer(schema)
926
+ if err != nil {
927
+ return byteBuffer, errors.Wrap(err, "Could not copy schema")
928
+ }
929
+
930
+ rw.WriteUint32(metaLength)
931
+ err = rw.CopyBytesToBuffer(meta)
932
+ if err != nil {
933
+ return byteBuffer, errors.Wrap(err, "Could not copy meta")
934
+ }
935
+
936
+ rw.WriteUint32(vectorWeightsLength)
937
+ err = rw.CopyBytesToBuffer(vectorWeights)
938
+ if err != nil {
939
+ return byteBuffer, errors.Wrap(err, "Could not copy vectorWeights")
940
+ }
941
+
942
+ rw.WriteUint32(targetVectorsOffsetsLength)
943
+ if targetVectorsOffsetsLength > 0 {
944
+ err = rw.CopyBytesToBuffer(targetVectorsOffsets)
945
+ if err != nil {
946
+ return byteBuffer, errors.Wrap(err, "Could not copy targetVectorsOffsets")
947
+ }
948
+ }
949
+
950
+ rw.WriteUint32(uint32(targetVectorsSegmentLength))
951
+ for _, name := range targetVectorsOffsetOrder {
952
+ vec := ko.Vectors[name]
953
+ vecLen := len(vec)
954
+
955
+ rw.WriteUint16(uint16(vecLen))
956
+ for j := 0; j < vecLen; j++ {
957
+ rw.WriteUint32(math.Float32bits(vec[j]))
958
+ }
959
+ }
960
+
961
+ rw.WriteUint32(multiVectorsOffsetsLength)
962
+ if multiVectorsOffsetsLength > 0 {
963
+ err = rw.CopyBytesToBuffer(multiVectorsOffsets)
964
+ if err != nil {
965
+ return byteBuffer, errors.Wrap(err, "Could not copy multiVectorsOffsets")
966
+ }
967
+ }
968
+
969
+ rw.WriteUint32(uint32(multiVectorsSegmentLength))
970
+ for _, name := range multiVectorsOffsetOrder {
971
+ vecs := ko.MultiVectors[name]
972
+ rw.WriteUint32(uint32(len(vecs)))
973
+ for _, vec := range vecs {
974
+ vecLen := len(vec)
975
+ rw.WriteUint16(uint16(vecLen))
976
+ for j := 0; j < vecLen; j++ {
977
+ rw.WriteUint32(math.Float32bits(vec[j]))
978
+ }
979
+ }
980
+ }
981
+
982
+ return byteBuffer, nil
983
+ }
984
+
985
+ // UnmarshalPropertiesFromObject accepts marshaled object as data and populates resultProperties map with the properties specified by propertyPaths.
986
+ //
987
+ // Check MarshalBinary for the order of elements in the input array
988
+ func UnmarshalPropertiesFromObject(data []byte, resultProperties map[string]interface{}, propertyPaths [][]string) error {
989
+ if data[0] != uint8(1) {
990
+ return errors.Errorf("unsupported binary marshaller version %d", data[0])
991
+ }
992
+
993
+ // clear out old values in case an object misses values. This should NOT shrink the capacity of the map, eg there
994
+ // are no allocations when adding the resultProperties of the next object again
995
+ clear(resultProperties)
996
+
997
+ startPos := uint64(1 + 8 + 1 + 16 + 8 + 8) // elements at the start
998
+ rw := byteops.NewReadWriterWithOps(data, byteops.WithPosition(startPos))
999
+ // get the length of the vector, each element is a float32 (4 bytes)
1000
+ vectorLength := uint64(rw.ReadUint16())
1001
+ rw.MoveBufferPositionForward(vectorLength * 4)
1002
+ classnameLength := uint64(rw.ReadUint16())
1003
+ rw.MoveBufferPositionForward(classnameLength)
1004
+ propertyLength := uint64(rw.ReadUint32())
1005
+
1006
+ return UnmarshalProperties(rw.Buffer[rw.Position:rw.Position+propertyLength], resultProperties, propertyPaths)
1007
+ }
1008
+
1009
+ // UnmarshalProperties accepts serialized properties as data and populates resultProperties map with the properties specified by propertyPaths.
1010
+ func UnmarshalProperties(data []byte, properties map[string]interface{}, propertyPaths [][]string) error {
1011
+ var returnError error
1012
+ jsonparser.EachKey(data, func(idx int, value []byte, dataType jsonparser.ValueType, err error) {
1013
+ propertyName := propertyPaths[idx][len(propertyPaths[idx])-1]
1014
+
1015
+ switch dataType {
1016
+ case jsonparser.Number, jsonparser.String, jsonparser.Boolean:
1017
+ val, err := parseValues(dataType, value)
1018
+ if err != nil {
1019
+ returnError = err
1020
+ }
1021
+ properties[propertyName] = val
1022
+ case jsonparser.Array: // can be a beacon or an actual array
1023
+ arrayEntries := value[1 : len(value)-1] // without leading and trailing []
1024
+ // this checks if refs are present - the return points to the underlying memory, dont use without copying
1025
+ _, errBeacon := jsonparser.GetUnsafeString(arrayEntries, "beacon")
1026
+ if errBeacon == nil {
1027
+ // there can be more than one
1028
+ var beacons []interface{}
1029
+ handler := func(beaconByte []byte, dataType jsonparser.ValueType, offset int, err error) {
1030
+ beaconVal, err2 := jsonparser.GetString(beaconByte, "beacon") // this points to the underlying memory
1031
+ returnError = err2
1032
+ beacons = append(beacons, map[string]interface{}{"beacon": beaconVal})
1033
+ }
1034
+ _, returnError = jsonparser.ArrayEach(value, handler)
1035
+ properties[propertyName] = beacons
1036
+ } else {
1037
+ // check how many entries there are in the array by counting the ",". This allows us to allocate an
1038
+ // array with the right size without extending it with every append.
1039
+ // The size can be too large for string arrays, when they contain "," as part of their content.
1040
+ entryCount := 0
1041
+ for _, b := range arrayEntries {
1042
+ if b == uint8(44) { // ',' as byte
1043
+ entryCount++
1044
+ }
1045
+ }
1046
+
1047
+ array := make([]interface{}, 0, entryCount)
1048
+ _, err = jsonparser.ArrayEach(value, func(innerValue []byte, innerDataType jsonparser.ValueType, offset int, innerErr error) {
1049
+ var val interface{}
1050
+
1051
+ switch innerDataType {
1052
+ case jsonparser.Number, jsonparser.String, jsonparser.Boolean:
1053
+ val, err = parseValues(innerDataType, innerValue)
1054
+ if err != nil {
1055
+ returnError = err
1056
+ return
1057
+ }
1058
+ case jsonparser.Object:
1059
+ nestedProps := map[string]interface{}{}
1060
+ err := json.Unmarshal(innerValue, &nestedProps)
1061
+ if err != nil {
1062
+ returnError = err
1063
+ return
1064
+ }
1065
+ val = nestedProps
1066
+ default:
1067
+ returnError = fmt.Errorf("unknown data type ArrayEach %v", innerDataType)
1068
+ return
1069
+ }
1070
+ array = append(array, val)
1071
+ })
1072
+ if err != nil {
1073
+ returnError = err
1074
+ }
1075
+ properties[propertyName] = array
1076
+
1077
+ }
1078
+ case jsonparser.Object:
1079
+ // nested objects and geo-props and phonenumbers.
1080
+ //
1081
+ // we do not have the schema for nested object and cannot use the efficient jsonparser for them
1082
+ // (we could for phonenumbers and geo-props but they are not worth the effort)
1083
+ // however this part is only called if
1084
+ // - one of the datatypes is present
1085
+ // - AND the user requests them
1086
+ // => the performance impact is minimal
1087
+ nestedProps := map[string]interface{}{}
1088
+ err := json.Unmarshal(value, &nestedProps)
1089
+ if err != nil {
1090
+ returnError = err
1091
+ }
1092
+ properties[propertyName] = nestedProps
1093
+ default:
1094
+ returnError = fmt.Errorf("unknown data type %v", dataType)
1095
+ }
1096
+ }, propertyPaths...)
1097
+
1098
+ return returnError
1099
+ }
1100
+
1101
+ func parseValues(dt jsonparser.ValueType, value []byte) (interface{}, error) {
1102
+ switch dt {
1103
+ case jsonparser.Number:
1104
+ return jsonparser.ParseFloat(value)
1105
+ case jsonparser.String:
1106
+ return jsonparser.ParseString(value)
1107
+ case jsonparser.Boolean:
1108
+ return jsonparser.ParseBoolean(value)
1109
+ default:
1110
+ panic("Unknown data type") // returning an error would be better
1111
+ }
1112
+ }
1113
+
1114
+ // UnmarshalBinary is the versioned way to unmarshal a kind object from binary,
1115
+ // see MarshalBinary for the exact contents of each version
1116
+ func (ko *Object) UnmarshalBinary(data []byte) error {
1117
+ version := data[0]
1118
+ if version != 1 {
1119
+ return errors.Errorf("unsupported binary marshaller version %d", version)
1120
+ }
1121
+ ko.MarshallerVersion = version
1122
+
1123
+ rw := byteops.NewReadWriterWithOps(data, byteops.WithPosition(1))
1124
+ ko.DocID = rw.ReadUint64()
1125
+ rw.MoveBufferPositionForward(1) // kind-byte
1126
+
1127
+ uuidParsed, err := uuid.FromBytes(data[rw.Position : rw.Position+16])
1128
+ if err != nil {
1129
+ return err
1130
+ }
1131
+ rw.MoveBufferPositionForward(16)
1132
+
1133
+ createTime := int64(rw.ReadUint64())
1134
+ updateTime := int64(rw.ReadUint64())
1135
+
1136
+ vectorLength := rw.ReadUint16()
1137
+ ko.VectorLen = int(vectorLength)
1138
+ ko.Vector = make([]float32, vectorLength)
1139
+ for j := 0; j < int(vectorLength); j++ {
1140
+ ko.Vector[j] = math.Float32frombits(rw.ReadUint32())
1141
+ }
1142
+
1143
+ classNameLength := uint64(rw.ReadUint16())
1144
+ className, err := rw.CopyBytesFromBuffer(classNameLength, nil)
1145
+ if err != nil {
1146
+ return errors.Wrap(err, "Could not copy class name")
1147
+ }
1148
+
1149
+ schemaLength := uint64(rw.ReadUint32())
1150
+ schema, err := rw.CopyBytesFromBuffer(schemaLength, nil)
1151
+ if err != nil {
1152
+ return errors.Wrap(err, "Could not copy schema")
1153
+ }
1154
+
1155
+ metaLength := uint64(rw.ReadUint32())
1156
+ meta, err := rw.CopyBytesFromBuffer(metaLength, nil)
1157
+ if err != nil {
1158
+ return errors.Wrap(err, "Could not copy meta")
1159
+ }
1160
+
1161
+ vectorWeightsLength := uint64(rw.ReadUint32())
1162
+ vectorWeights, err := rw.CopyBytesFromBuffer(vectorWeightsLength, nil)
1163
+ if err != nil {
1164
+ return errors.Wrap(err, "Could not copy vectorWeights")
1165
+ }
1166
+
1167
+ vectors, err := unmarshalTargetVectors(&rw)
1168
+ if err != nil {
1169
+ return err
1170
+ }
1171
+ ko.Vectors = vectors
1172
+
1173
+ multiVectors, err := unmarshalMultiVectors(&rw, nil)
1174
+ if err != nil {
1175
+ return err
1176
+ }
1177
+ ko.MultiVectors = multiVectors
1178
+
1179
+ return ko.parseObject(
1180
+ strfmt.UUID(uuidParsed.String()),
1181
+ createTime,
1182
+ updateTime,
1183
+ string(className),
1184
+ schema,
1185
+ meta,
1186
+ vectorWeights, nil, 0,
1187
+ )
1188
+ }
1189
+
1190
+ func unmarshalTargetVectors(rw *byteops.ReadWriter) (map[string][]float32, error) {
1191
+ // This check prevents from panic when somebody is upgrading from version that
1192
+ // didn't have multiple target vector support. This check is needed bc with named vectors
1193
+ // feature storage object can have vectors data appended at the end of the file
1194
+ if rw.Position < uint64(len(rw.Buffer)) {
1195
+ targetVectorsOffsets := rw.ReadBytesFromBufferWithUint32LengthIndicator()
1196
+ targetVectorsSegmentLength := rw.ReadUint32()
1197
+ pos := rw.Position
1198
+
1199
+ if len(targetVectorsOffsets) > 0 {
1200
+ var tvOffsets map[string]uint32
1201
+ if err := msgpack.Unmarshal(targetVectorsOffsets, &tvOffsets); err != nil {
1202
+ return nil, fmt.Errorf("could not unmarshal target vectors offset: %w", err)
1203
+ }
1204
+
1205
+ targetVectors := map[string][]float32{}
1206
+ for name, offset := range tvOffsets {
1207
+ rw.MoveBufferToAbsolutePosition(pos + uint64(offset))
1208
+ vecLen := rw.ReadUint16()
1209
+ vec := make([]float32, vecLen)
1210
+ for j := uint16(0); j < vecLen; j++ {
1211
+ vec[j] = math.Float32frombits(rw.ReadUint32())
1212
+ }
1213
+ targetVectors[name] = vec
1214
+ }
1215
+
1216
+ rw.MoveBufferToAbsolutePosition(pos + uint64(targetVectorsSegmentLength))
1217
+ return targetVectors, nil
1218
+ }
1219
+ }
1220
+ return nil, nil
1221
+ }
1222
+
1223
+ // unmarshalMultiVectors unmarshals the multi vectors from the buffer. If onlyUnmarshalNames is set and non-empty,
1224
+ // then only the multivectors which names specified as the map's keys will be unmarshaled.
1225
+ func unmarshalMultiVectors(
1226
+ rw *byteops.ReadWriter,
1227
+ onlyUnmarshalNames map[string]interface{},
1228
+ ) (map[string][][]float32, error) {
1229
+ // This check prevents from panic when somebody is upgrading from version that
1230
+ // didn't have multi vector support. This check is needed bc with the multi vectors
1231
+ // feature the storage object can have vectors data appended at the end of the file
1232
+ if rw.Position < uint64(len(rw.Buffer)) {
1233
+ multiVectorsOffsets := rw.ReadBytesFromBufferWithUint32LengthIndicator()
1234
+ multiVectorsSegmentLength := rw.ReadUint32()
1235
+ pos := rw.Position
1236
+
1237
+ if len(multiVectorsOffsets) > 0 {
1238
+ var mvOffsets map[string]uint32
1239
+ if err := msgpack.Unmarshal(multiVectorsOffsets, &mvOffsets); err != nil {
1240
+ return nil, fmt.Errorf("could not unmarshal multi vectors offset: %w", err)
1241
+ }
1242
+
1243
+ // NOTE if you sort mvOffsets by offset, you may be able to speed this up via
1244
+ // sequential reads, haven't tried this yet
1245
+ multiVectors := map[string][][]float32{}
1246
+ for name, offset := range mvOffsets {
1247
+ // if onlyUnmarshalNames is not nil and non-empty, only unmarshal the vectors
1248
+ // for the names in the map
1249
+ if len(onlyUnmarshalNames) > 0 {
1250
+ if _, ok := onlyUnmarshalNames[name]; !ok {
1251
+ continue
1252
+ }
1253
+ }
1254
+ rw.MoveBufferToAbsolutePosition(pos + uint64(offset))
1255
+ numVecs := rw.ReadUint32()
1256
+ vecs := make([][]float32, 0)
1257
+ for i := 0; i < int(numVecs); i++ {
1258
+ vecLen := rw.ReadUint16()
1259
+ vec := make([]float32, vecLen)
1260
+ for j := uint16(0); j < vecLen; j++ {
1261
+ vec[j] = math.Float32frombits(rw.ReadUint32())
1262
+ }
1263
+ vecs = append(vecs, vec)
1264
+ }
1265
+ multiVectors[name] = vecs
1266
+ }
1267
+
1268
+ rw.MoveBufferToAbsolutePosition(pos + uint64(multiVectorsSegmentLength))
1269
+ return multiVectors, nil
1270
+ }
1271
+ }
1272
+ return nil, nil
1273
+ }
1274
+
1275
+ func VectorFromBinary(in []byte, buffer []float32, targetVector string) ([]float32, error) {
1276
+ if len(in) == 0 {
1277
+ return nil, nil
1278
+ }
1279
+
1280
+ version := in[0]
1281
+ if version != 1 {
1282
+ return nil, errors.Errorf("unsupported marshaller version %d", version)
1283
+ }
1284
+
1285
+ if targetVector != "" {
1286
+ startPos := uint64(1 + 8 + 1 + 16 + 8 + 8) // elements at the start
1287
+ rw := byteops.NewReadWriterWithOps(in, byteops.WithPosition(startPos))
1288
+
1289
+ vectorLength := uint64(rw.ReadUint16())
1290
+ rw.MoveBufferPositionForward(vectorLength * 4)
1291
+
1292
+ classnameLength := uint64(rw.ReadUint16())
1293
+ rw.MoveBufferPositionForward(classnameLength)
1294
+
1295
+ schemaLength := uint64(rw.ReadUint32())
1296
+ rw.MoveBufferPositionForward(schemaLength)
1297
+
1298
+ metaLength := uint64(rw.ReadUint32())
1299
+ rw.MoveBufferPositionForward(metaLength)
1300
+
1301
+ vectorWeightsLength := uint64(rw.ReadUint32())
1302
+ rw.MoveBufferPositionForward(vectorWeightsLength)
1303
+
1304
+ targetVectors, err := unmarshalTargetVectors(&rw)
1305
+ if err != nil {
1306
+ return nil, errors.Errorf("unable to unmarshal vector for target vector: %s", targetVector)
1307
+ }
1308
+ vector, ok := targetVectors[targetVector]
1309
+ if !ok {
1310
+ return nil, errors.Errorf("vector not found for target vector: %s", targetVector)
1311
+ }
1312
+ return vector, nil
1313
+ }
1314
+
1315
+ // since we know the version and know that the blob is not len(0), we can
1316
+ // assume that we can directly access the vector length field. The only
1317
+ // situation where this is not accessible would be on corrupted data - where
1318
+ // it would be acceptable to panic
1319
+ vecLen := binary.LittleEndian.Uint16(in[42:44])
1320
+
1321
+ var out []float32
1322
+ if cap(buffer) >= int(vecLen) {
1323
+ out = buffer[:vecLen]
1324
+ } else {
1325
+ out = make([]float32, vecLen)
1326
+ }
1327
+ vecStart := 44
1328
+ vecEnd := vecStart + int(vecLen*4)
1329
+
1330
+ i := 0
1331
+ for start := vecStart; start < vecEnd; start += 4 {
1332
+ asUint := binary.LittleEndian.Uint32(in[start : start+4])
1333
+ out[i] = math.Float32frombits(asUint)
1334
+ i++
1335
+ }
1336
+
1337
+ return out, nil
1338
+ }
1339
+
1340
+ func incrementPos(in []byte, pos int, size int) int {
1341
+ b := in[pos : pos+size]
1342
+ if size == 2 {
1343
+ length := binary.LittleEndian.Uint16(b)
1344
+ pos += size + int(length)
1345
+ } else if size == 4 {
1346
+ length := binary.LittleEndian.Uint32(b)
1347
+ pos += size + int(length)
1348
+ return pos
1349
+ } else if size == 8 {
1350
+ length := binary.LittleEndian.Uint64(b)
1351
+ pos += size + int(length)
1352
+ }
1353
+ return pos
1354
+ }
1355
+
1356
+ func MultiVectorFromBinary(in []byte, buffer []float32, targetVector string) ([][]float32, error) {
1357
+ if len(in) == 0 {
1358
+ return nil, nil
1359
+ }
1360
+
1361
+ version := in[0]
1362
+ if version != 1 {
1363
+ return nil, errors.Errorf("unsupported marshaller version %d", version)
1364
+ }
1365
+
1366
+ // since we know the version and know that the blob is not len(0), we can
1367
+ // assume that we can directly access the vector length field. The only
1368
+ // situation where this is not accessible would be on corrupted data - where
1369
+ // it would be acceptable to panic
1370
+ vecLen := binary.LittleEndian.Uint16(in[42:44])
1371
+
1372
+ var out []float32
1373
+ if cap(buffer) >= int(vecLen) {
1374
+ out = buffer[:vecLen]
1375
+ } else {
1376
+ out = make([]float32, vecLen)
1377
+ }
1378
+ vecStart := 44
1379
+ vecEnd := vecStart + int(vecLen*4)
1380
+
1381
+ i := 0
1382
+ for start := vecStart; start < vecEnd; start += 4 {
1383
+ asUint := binary.LittleEndian.Uint32(in[start : start+4])
1384
+ out[i] = math.Float32frombits(asUint)
1385
+ i++
1386
+ }
1387
+
1388
+ pos := vecEnd
1389
+
1390
+ pos = incrementPos(in, pos, 2) // classNameLength
1391
+ pos = incrementPos(in, pos, 4) // schemaLength
1392
+ pos = incrementPos(in, pos, 4) // metaLength
1393
+ pos = incrementPos(in, pos, 4) // vectorWeightsLength
1394
+ pos = incrementPos(in, pos, 4) // bufLen
1395
+ pos = incrementPos(in, pos, 4) // targetVectorsSegmentLength
1396
+
1397
+ // multivector
1398
+ var multiVectors map[string][][]float32
1399
+
1400
+ if len(in) > pos {
1401
+ rw := byteops.NewReadWriterWithOps(in, byteops.WithPosition(uint64(pos)))
1402
+ mv, err := unmarshalMultiVectors(&rw, map[string]interface{}{targetVector: nil})
1403
+ if err != nil {
1404
+ return nil, errors.Errorf("unable to unmarshal multivector for target vector: %s", targetVector)
1405
+ }
1406
+ multiVectors = mv
1407
+ }
1408
+
1409
+ mvout, ok := multiVectors[targetVector]
1410
+ if !ok {
1411
+ return nil, errors.Errorf("vector not found for target vector: %s", targetVector)
1412
+ }
1413
+ return mvout, nil
1414
+ }
1415
+
1416
+ func (ko *Object) parseObject(uuid strfmt.UUID, create, update int64, className string,
1417
+ propsB []byte, additionalB []byte, vectorWeightsB []byte, properties *PropertyExtraction, propLength uint32,
1418
+ ) error {
1419
+ var returnProps map[string]interface{}
1420
+ if properties == nil || propLength == 0 {
1421
+ if err := json.Unmarshal(propsB, &returnProps); err != nil {
1422
+ return err
1423
+ }
1424
+ } else if len(propsB) >= int(propLength) {
1425
+ // the properties are not read in all cases, skip if not needed
1426
+ returnProps = make(map[string]interface{}, len(properties.PropertyPaths))
1427
+ if err := UnmarshalProperties(propsB[:propLength], returnProps, properties.PropertyPaths); err != nil {
1428
+ return err
1429
+ }
1430
+ }
1431
+
1432
+ if err := enrichSchemaTypes(returnProps, false); err != nil {
1433
+ return errors.Wrap(err, "enrich schema datatypes")
1434
+ }
1435
+
1436
+ var additionalProperties models.AdditionalProperties
1437
+ if len(additionalB) > 0 {
1438
+ if err := json.Unmarshal(additionalB, &additionalProperties); err != nil {
1439
+ return err
1440
+ }
1441
+
1442
+ if prop, ok := additionalProperties["classification"]; ok {
1443
+ if classificationMap, ok := prop.(map[string]interface{}); ok {
1444
+ marshalled, err := json.Marshal(classificationMap)
1445
+ if err != nil {
1446
+ return err
1447
+ }
1448
+ var classification additional.Classification
1449
+ err = json.Unmarshal(marshalled, &classification)
1450
+ if err != nil {
1451
+ return err
1452
+ }
1453
+ additionalProperties["classification"] = &classification
1454
+ }
1455
+ }
1456
+
1457
+ if prop, ok := additionalProperties["group"]; ok {
1458
+ if groupMap, ok := prop.(map[string]interface{}); ok {
1459
+ marshalled, err := json.Marshal(groupMap)
1460
+ if err != nil {
1461
+ return err
1462
+ }
1463
+ var group additional.Group
1464
+ err = json.Unmarshal(marshalled, &group)
1465
+ if err != nil {
1466
+ return err
1467
+ }
1468
+
1469
+ for i, hit := range group.Hits {
1470
+ if groupHitAdditionalMap, ok := hit["_additional"].(map[string]interface{}); ok {
1471
+ marshalled, err := json.Marshal(groupHitAdditionalMap)
1472
+ if err != nil {
1473
+ return err
1474
+ }
1475
+ var groupHitsAdditional additional.GroupHitAdditional
1476
+ err = json.Unmarshal(marshalled, &groupHitsAdditional)
1477
+ if err != nil {
1478
+ return err
1479
+ }
1480
+ group.Hits[i]["_additional"] = &groupHitsAdditional
1481
+ }
1482
+ }
1483
+
1484
+ additionalProperties["group"] = &group
1485
+ }
1486
+ }
1487
+ }
1488
+
1489
+ var vectorWeights interface{}
1490
+ if err := json.Unmarshal(vectorWeightsB, &vectorWeights); err != nil {
1491
+ return err
1492
+ }
1493
+
1494
+ ko.Object = models.Object{
1495
+ Class: className,
1496
+ CreationTimeUnix: create,
1497
+ LastUpdateTimeUnix: update,
1498
+ ID: uuid,
1499
+ Properties: returnProps,
1500
+ VectorWeights: vectorWeights,
1501
+ Additional: additionalProperties,
1502
+ }
1503
+
1504
+ return nil
1505
+ }
1506
+
1507
+ // DeepCopyDangerous creates a deep copy of the underlying Object
1508
+ // WARNING: This was purpose built for the batch ref usecase and only covers
1509
+ // the situations that are required there. This means that cases which aren't
1510
+ // reflected in that usecase may still contain references. Thus the suffix
1511
+ // "Dangerous". If needed, make sure everything is copied and remove the
1512
+ // suffix.
1513
+ func (ko *Object) DeepCopyDangerous() *Object {
1514
+ o := &Object{
1515
+ MarshallerVersion: ko.MarshallerVersion,
1516
+ DocID: ko.DocID,
1517
+ Object: deepCopyObject(ko.Object),
1518
+ Vector: deepCopyVector(ko.Vector),
1519
+ Vectors: deepCopyVectorsMap(ko.Vectors),
1520
+ MultiVectors: deepCopyMultiVectorsMap(ko.MultiVectors),
1521
+ }
1522
+
1523
+ return o
1524
+ }
1525
+
1526
+ func AddOwnership(objs []*Object, node, shard string) {
1527
+ for i := range objs {
1528
+ objs[i].BelongsToNode = node
1529
+ objs[i].BelongsToShard = shard
1530
+ }
1531
+ }
1532
+
1533
+ func deepCopyVector(orig []float32) []float32 {
1534
+ out := make([]float32, len(orig))
1535
+ copy(out, orig)
1536
+ return out
1537
+ }
1538
+
1539
+ func deepCopyMultiVector(orig [][]float32) [][]float32 {
1540
+ out := make([][]float32, len(orig))
1541
+ copy(out, orig)
1542
+ return out
1543
+ }
1544
+
1545
+ func deepCopyVectors(orig models.Vectors) models.Vectors {
1546
+ out := make(models.Vectors, len(orig))
1547
+ for key, vec := range orig {
1548
+ switch v := any(vec).(type) {
1549
+ case []float32:
1550
+ out[key] = deepCopyVector(v)
1551
+ case [][]float32:
1552
+ out[key] = deepCopyMultiVector(v)
1553
+ default:
1554
+ // do nothing
1555
+ }
1556
+ }
1557
+ return out
1558
+ }
1559
+
1560
+ func deepCopyVectorsMap(orig map[string][]float32) map[string][]float32 {
1561
+ out := make(map[string][]float32, len(orig))
1562
+ for key, vec := range orig {
1563
+ switch v := any(vec).(type) {
1564
+ case []float32:
1565
+ out[key] = deepCopyVector(v)
1566
+ default:
1567
+ // do nothing
1568
+ }
1569
+ }
1570
+ return out
1571
+ }
1572
+
1573
+ func deepCopyMultiVectorsMap(orig map[string][][]float32) map[string][][]float32 {
1574
+ out := make(map[string][][]float32, len(orig))
1575
+ for key, vec := range orig {
1576
+ switch v := any(vec).(type) {
1577
+ case [][]float32:
1578
+ out[key] = deepCopyMultiVector(v)
1579
+ default:
1580
+ // do nothing
1581
+ }
1582
+ }
1583
+ return out
1584
+ }
1585
+
1586
+ func deepCopyObject(orig models.Object) models.Object {
1587
+ return models.Object{
1588
+ Class: orig.Class,
1589
+ ID: orig.ID,
1590
+ CreationTimeUnix: orig.CreationTimeUnix,
1591
+ LastUpdateTimeUnix: orig.LastUpdateTimeUnix,
1592
+ Vector: deepCopyVector(orig.Vector),
1593
+ VectorWeights: orig.VectorWeights,
1594
+ Additional: orig.Additional, // WARNING: not a deep copy!!
1595
+ Properties: deepCopyProperties(orig.Properties),
1596
+ Vectors: deepCopyVectors(orig.Vectors),
1597
+ }
1598
+ }
1599
+
1600
+ func deepCopyProperties(orig models.PropertySchema) models.PropertySchema {
1601
+ if orig == nil {
1602
+ return nil
1603
+ }
1604
+
1605
+ asMap, ok := orig.(map[string]interface{})
1606
+ if !ok {
1607
+ // not a map, don't know what to do with this
1608
+ return nil
1609
+ }
1610
+
1611
+ out := map[string]interface{}{}
1612
+
1613
+ for key, value := range asMap {
1614
+ if mref, ok := value.(models.MultipleRef); ok {
1615
+ out[key] = deepCopyMRef(mref)
1616
+ continue
1617
+ }
1618
+
1619
+ // Note: This is not a true deep copy, value could still be a pointer type,
1620
+ // such as *models.GeoCoordinates, thus leading to passing a reference
1621
+ // instead of actually making a copy. However, for the purposes we need
1622
+ // this method for this is acceptable based on our current knowledge
1623
+ out[key] = value
1624
+ }
1625
+
1626
+ return out
1627
+ }
1628
+
1629
+ func deepCopyMRef(orig models.MultipleRef) models.MultipleRef {
1630
+ if orig == nil {
1631
+ return nil
1632
+ }
1633
+
1634
+ out := make(models.MultipleRef, len(orig))
1635
+ for i, ref := range orig {
1636
+ // models.SingleRef contains only pass-by-value props, so a simple deref as
1637
+ // the struct creates a copy
1638
+ copiedRef := *ref
1639
+ out[i] = &copiedRef
1640
+ }
1641
+
1642
+ return out
1643
+ }
platform/dbops/binaries/weaviate-src/entities/storobj/storage_object_test.go ADDED
@@ -0,0 +1,1629 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // _ _
2
+ // __ _____ __ ___ ___ __ _| |_ ___
3
+ // \ \ /\ / / _ \/ _` \ \ / / |/ _` | __/ _ \
4
+ // \ V V / __/ (_| |\ V /| | (_| | || __/
5
+ // \_/\_/ \___|\__,_| \_/ |_|\__,_|\__\___|
6
+ //
7
+ // Copyright © 2016 - 2025 Weaviate B.V. All rights reserved.
8
+ //
9
+ // CONTACT: hello@weaviate.io
10
+ //
11
+
12
+ package storobj
13
+
14
+ import (
15
+ cryptorand "crypto/rand"
16
+ "encoding/binary"
17
+ "fmt"
18
+ "math/rand"
19
+ "strings"
20
+ "testing"
21
+ "time"
22
+
23
+ "github.com/weaviate/weaviate/usecases/byteops"
24
+
25
+ "github.com/go-openapi/strfmt"
26
+ "github.com/sirupsen/logrus/hooks/test"
27
+ "github.com/stretchr/testify/assert"
28
+ "github.com/stretchr/testify/require"
29
+ "github.com/weaviate/weaviate/entities/additional"
30
+ "github.com/weaviate/weaviate/entities/models"
31
+ "github.com/weaviate/weaviate/entities/schema"
32
+ )
33
+
34
+ func TestStorageObjectMarshalling(t *testing.T) {
35
+ before := FromObject(
36
+ &models.Object{
37
+ Class: "MyFavoriteClass",
38
+ CreationTimeUnix: 123456,
39
+ LastUpdateTimeUnix: 56789,
40
+ ID: strfmt.UUID("73f2eb5f-5abf-447a-81ca-74b1dd168247"),
41
+ Additional: models.AdditionalProperties{
42
+ "classification": &additional.Classification{
43
+ BasedOn: []string{"some", "fields"},
44
+ },
45
+ "interpretation": map[string]interface{}{
46
+ "Source": []interface{}{
47
+ map[string]interface{}{
48
+ "concept": "foo",
49
+ "occurrence": float64(7),
50
+ "weight": float64(3),
51
+ },
52
+ },
53
+ },
54
+ },
55
+ Properties: map[string]interface{}{
56
+ "name": "MyName",
57
+ "foo": float64(17),
58
+ },
59
+ },
60
+ []float32{1, 2, 0.7},
61
+ map[string][]float32{
62
+ "vector1": {1, 2, 3},
63
+ "vector2": {4, 5, 6},
64
+ },
65
+ nil,
66
+ )
67
+ before.DocID = 7
68
+
69
+ asBinary, err := before.MarshalBinary()
70
+ require.Nil(t, err)
71
+
72
+ after, err := FromBinary(asBinary)
73
+ require.Nil(t, err)
74
+
75
+ t.Run("compare", func(t *testing.T) {
76
+ assert.Equal(t, before, after)
77
+ })
78
+
79
+ t.Run("extract only doc id and compare", func(t *testing.T) {
80
+ id, updateTime, err := DocIDAndTimeFromBinary(asBinary)
81
+ require.Nil(t, err)
82
+ assert.Equal(t, uint64(7), id)
83
+ assert.Equal(t, before.LastUpdateTimeUnix(), updateTime)
84
+ })
85
+
86
+ t.Run("extract single text prop", func(t *testing.T) {
87
+ prop, ok, err := ParseAndExtractTextProp(asBinary, "name")
88
+ require.Nil(t, err)
89
+ require.True(t, ok)
90
+ require.NotEmpty(t, prop)
91
+ assert.Equal(t, "MyName", prop[0])
92
+ })
93
+
94
+ t.Run("extract non-existing text prop", func(t *testing.T) {
95
+ prop, ok, err := ParseAndExtractTextProp(asBinary, "IDoNotExist")
96
+ require.Nil(t, err)
97
+ require.True(t, ok)
98
+ require.Empty(t, prop)
99
+ })
100
+ }
101
+
102
+ func TestStorageObjectMarshallingMultiVector(t *testing.T) {
103
+ before := FromObject(
104
+ &models.Object{
105
+ Class: "MyFavoriteClass",
106
+ CreationTimeUnix: 123456,
107
+ LastUpdateTimeUnix: 56789,
108
+ ID: strfmt.UUID("73f2eb5f-5abf-447a-81ca-74b1dd168247"),
109
+ Additional: models.AdditionalProperties{
110
+ "classification": &additional.Classification{
111
+ BasedOn: []string{"some", "fields"},
112
+ },
113
+ "interpretation": map[string]interface{}{
114
+ "Source": []interface{}{
115
+ map[string]interface{}{
116
+ "concept": "foo",
117
+ "occurrence": float64(7),
118
+ "weight": float64(3),
119
+ },
120
+ },
121
+ },
122
+ },
123
+ Properties: map[string]interface{}{
124
+ "name": "MyName",
125
+ "foo": float64(17),
126
+ },
127
+ },
128
+ []float32{1, 2, 0.7},
129
+ map[string][]float32{
130
+ "vector1": {1, 2, 3},
131
+ "vector2": {4, 5, 6},
132
+ },
133
+ map[string][][]float32{
134
+ "vector3": {{7, 8, 9}, {10, 11, 12}},
135
+ "vector4": {{13, 14, 15}, {16, 17, 18}, {16, 1}, {1}},
136
+ "vector5": {{19, 20, 21}, {22, 23, 24}},
137
+ },
138
+ )
139
+ before.DocID = 7
140
+
141
+ asBinary, err := before.MarshalBinary()
142
+ require.Nil(t, err)
143
+
144
+ after, err := FromBinary(asBinary)
145
+ require.Nil(t, err)
146
+
147
+ t.Run("compare", func(t *testing.T) {
148
+ assert.Equal(t, before, after)
149
+ })
150
+
151
+ t.Run("extract only doc id and compare", func(t *testing.T) {
152
+ id, updateTime, err := DocIDAndTimeFromBinary(asBinary)
153
+ require.Nil(t, err)
154
+ assert.Equal(t, uint64(7), id)
155
+ assert.Equal(t, before.LastUpdateTimeUnix(), updateTime)
156
+ })
157
+
158
+ t.Run("extract single text prop", func(t *testing.T) {
159
+ prop, ok, err := ParseAndExtractTextProp(asBinary, "name")
160
+ require.Nil(t, err)
161
+ require.True(t, ok)
162
+ require.NotEmpty(t, prop)
163
+ assert.Equal(t, "MyName", prop[0])
164
+ })
165
+
166
+ t.Run("extract non-existing text prop", func(t *testing.T) {
167
+ prop, ok, err := ParseAndExtractTextProp(asBinary, "IDoNotExist")
168
+ require.Nil(t, err)
169
+ require.True(t, ok)
170
+ require.Empty(t, prop)
171
+ })
172
+ }
173
+
174
+ func TestStorageObjectUnMarshallingMultiVector(t *testing.T) {
175
+ t.Run("all vectors stored", func(t *testing.T) {
176
+ before := FromObject(
177
+ &models.Object{
178
+ Class: "MyFavoriteClass",
179
+ CreationTimeUnix: 123456,
180
+ LastUpdateTimeUnix: 56789,
181
+ ID: strfmt.UUID("73f2eb5f-5abf-447a-81ca-74b1dd168247"),
182
+ Additional: models.AdditionalProperties{
183
+ "classification": &additional.Classification{
184
+ BasedOn: []string{"some", "fields"},
185
+ },
186
+ "interpretation": map[string]interface{}{
187
+ "Source": []interface{}{
188
+ map[string]interface{}{
189
+ "concept": "foo",
190
+ "occurrence": float64(7),
191
+ "weight": float64(3),
192
+ },
193
+ },
194
+ },
195
+ },
196
+ Properties: map[string]interface{}{
197
+ "name": "MyName",
198
+ "foo": float64(17),
199
+ },
200
+ },
201
+ []float32{1, 2, 0.7},
202
+ map[string][]float32{
203
+ "vector1": {1, 2, 3},
204
+ "vector2": {4, 5, 6},
205
+ },
206
+ map[string][][]float32{
207
+ "vector3": {{7, 8, 9}, {10, 11, 12}},
208
+ "vector4": {{13, 14, 15}, {16, 17, 18}, {16, 1}, {1}},
209
+ "vector5": {{19, 20, 21}, {22, 23, 24}, {22, 23, 24}, {22, 23, 24}, {22, 23, 24}},
210
+ },
211
+ )
212
+ before.DocID = 7
213
+
214
+ asBinary, err := before.MarshalBinary()
215
+ require.Nil(t, err)
216
+
217
+ after := &Object{}
218
+ after.UnmarshalBinary(asBinary)
219
+ require.Nil(t, err)
220
+
221
+ t.Run("compare", func(t *testing.T) {
222
+ assert.Equal(t, before, after)
223
+ })
224
+
225
+ t.Run("check vector", func(t *testing.T) {
226
+ require.NotEmpty(t, after.Vector)
227
+ assert.ElementsMatch(t, after.Vector, before.Vector)
228
+ })
229
+
230
+ t.Run("check vectors", func(t *testing.T) {
231
+ require.NotEmpty(t, after.Vectors)
232
+ assert.ElementsMatch(t, after.Vectors["vector1"], before.Vectors["vector1"])
233
+ assert.ElementsMatch(t, after.Vectors["vector2"], before.Vectors["vector2"])
234
+ })
235
+
236
+ t.Run("check multi vectors", func(t *testing.T) {
237
+ require.NotEmpty(t, after.MultiVectors)
238
+ assert.ElementsMatch(t, after.MultiVectors["vector3"], before.MultiVectors["vector3"])
239
+ assert.ElementsMatch(t, after.MultiVectors["vector4"], before.MultiVectors["vector4"])
240
+ assert.ElementsMatch(t, after.MultiVectors["vector5"], before.MultiVectors["vector5"])
241
+ })
242
+
243
+ t.Run("check multi vectors optional", func(t *testing.T) {
244
+ t.Run("FromBinaryOptional: empty additional", func(t *testing.T) {
245
+ afterMultiVectorsOptional, err := FromBinaryOptional(asBinary, additional.Properties{}, nil)
246
+ require.Nil(t, err)
247
+ require.Nil(t, afterMultiVectorsOptional.MultiVectors)
248
+ })
249
+
250
+ t.Run("FromBinaryOptional: multi vector in additional", func(t *testing.T) {
251
+ afterMultiVectorsOptional, err := FromBinaryOptional(asBinary, additional.Properties{
252
+ Vectors: []string{"vector4"},
253
+ }, nil)
254
+ require.Nil(t, err)
255
+ require.NotEmpty(t, afterMultiVectorsOptional.MultiVectors)
256
+ require.Len(t, afterMultiVectorsOptional.MultiVectors, 1)
257
+ require.Equal(t, before.MultiVectors["vector4"], afterMultiVectorsOptional.MultiVectors["vector4"])
258
+ })
259
+
260
+ t.Run("FromBinaryOptional: named vector and multi vector in additional", func(t *testing.T) {
261
+ afterMultiVectorsOptional, err := FromBinaryOptional(asBinary, additional.Properties{
262
+ Vectors: []string{"vector2", "vector4"},
263
+ }, nil)
264
+ require.Nil(t, err)
265
+ require.NotEmpty(t, afterMultiVectorsOptional.Vectors)
266
+ require.NotEmpty(t, afterMultiVectorsOptional.MultiVectors)
267
+ require.Len(t, afterMultiVectorsOptional.Vectors, 2)
268
+ require.Len(t, afterMultiVectorsOptional.MultiVectors, 1)
269
+ require.Equal(t, before.Vectors["vector1"], afterMultiVectorsOptional.Vectors["vector1"])
270
+ require.Equal(t, before.Vectors["vector2"], afterMultiVectorsOptional.Vectors["vector2"])
271
+ require.Equal(t, before.MultiVectors["vector4"], afterMultiVectorsOptional.MultiVectors["vector4"])
272
+ })
273
+ })
274
+ })
275
+
276
+ t.Run("only vectors and multivectors", func(t *testing.T) {
277
+ before := FromObject(
278
+ &models.Object{
279
+ Class: "MyFavoriteClass",
280
+ CreationTimeUnix: 123456,
281
+ LastUpdateTimeUnix: 56789,
282
+ ID: strfmt.UUID("73f2eb5f-5abf-447a-81ca-74b1dd168247"),
283
+ Additional: models.AdditionalProperties{
284
+ "classification": &additional.Classification{
285
+ BasedOn: []string{"some", "fields"},
286
+ },
287
+ "interpretation": map[string]interface{}{
288
+ "Source": []interface{}{
289
+ map[string]interface{}{
290
+ "concept": "foo",
291
+ "occurrence": float64(7),
292
+ "weight": float64(3),
293
+ },
294
+ },
295
+ },
296
+ },
297
+ Properties: map[string]interface{}{
298
+ "name": "MyName",
299
+ "foo": float64(17),
300
+ },
301
+ },
302
+ nil,
303
+ map[string][]float32{
304
+ "vector1": {1, 2, 3},
305
+ "vector2": {4, 5, 6},
306
+ },
307
+ map[string][][]float32{
308
+ "vector3": {{7, 8, 9}, {10, 11, 12}},
309
+ "vector4": {{13, 14, 15}, {16, 17, 18}, {16, 1}, {1}},
310
+ "vector5": {{19, 20, 21}, {22, 23, 24}, {22, 23, 24}, {22, 23, 24}, {22, 23, 24}},
311
+ },
312
+ )
313
+ before.DocID = 7
314
+
315
+ asBinary, err := before.MarshalBinary()
316
+ require.Nil(t, err)
317
+
318
+ after := &Object{}
319
+ after.UnmarshalBinary(asBinary)
320
+ require.Nil(t, err)
321
+
322
+ t.Run("check vector", func(t *testing.T) {
323
+ require.Empty(t, after.Vector)
324
+ })
325
+
326
+ t.Run("check vectors", func(t *testing.T) {
327
+ require.NotEmpty(t, after.Vectors)
328
+ assert.ElementsMatch(t, after.Vectors["vector1"], before.Vectors["vector1"])
329
+ assert.ElementsMatch(t, after.Vectors["vector2"], before.Vectors["vector2"])
330
+ })
331
+
332
+ t.Run("check multivectors", func(t *testing.T) {
333
+ require.NotEmpty(t, after.MultiVectors)
334
+ assert.ElementsMatch(t, after.MultiVectors["vector3"], before.MultiVectors["vector3"])
335
+ assert.ElementsMatch(t, after.MultiVectors["vector4"], before.MultiVectors["vector4"])
336
+ assert.ElementsMatch(t, after.MultiVectors["vector5"], before.MultiVectors["vector5"])
337
+ })
338
+ })
339
+
340
+ t.Run("only multi vectors", func(t *testing.T) {
341
+ before := FromObject(
342
+ &models.Object{
343
+ Class: "MyFavoriteClass",
344
+ CreationTimeUnix: 123456,
345
+ LastUpdateTimeUnix: 56789,
346
+ ID: strfmt.UUID("73f2eb5f-5abf-447a-81ca-74b1dd168247"),
347
+ Additional: models.AdditionalProperties{
348
+ "classification": &additional.Classification{
349
+ BasedOn: []string{"some", "fields"},
350
+ },
351
+ "interpretation": map[string]interface{}{
352
+ "Source": []interface{}{
353
+ map[string]interface{}{
354
+ "concept": "foo",
355
+ "occurrence": float64(7),
356
+ "weight": float64(3),
357
+ },
358
+ },
359
+ },
360
+ },
361
+ Properties: map[string]interface{}{
362
+ "name": "MyName",
363
+ "foo": float64(17),
364
+ },
365
+ },
366
+ nil,
367
+ nil,
368
+ map[string][][]float32{
369
+ "vector3": {{7, 8, 9}, {10, 11, 12}},
370
+ "vector4": {{13, 14, 15}, {16, 17, 18}, {16, 1}, {1}},
371
+ "vector5": {{19, 20, 21}, {22, 23, 24}, {22, 23, 24}, {22, 23, 24}, {22, 23, 24}},
372
+ },
373
+ )
374
+ before.DocID = 7
375
+
376
+ asBinary, err := before.MarshalBinary()
377
+ require.Nil(t, err)
378
+
379
+ after := &Object{}
380
+ after.UnmarshalBinary(asBinary)
381
+ require.Nil(t, err)
382
+
383
+ t.Run("check vector", func(t *testing.T) {
384
+ require.Empty(t, after.Vector)
385
+ })
386
+
387
+ t.Run("check vectors", func(t *testing.T) {
388
+ require.Nil(t, after.Vectors)
389
+ })
390
+
391
+ t.Run("check multi vectors", func(t *testing.T) {
392
+ require.NotEmpty(t, after.MultiVectors)
393
+ assert.ElementsMatch(t, after.MultiVectors["vector3"], before.MultiVectors["vector3"])
394
+ assert.ElementsMatch(t, after.MultiVectors["vector4"], before.MultiVectors["vector4"])
395
+ assert.ElementsMatch(t, after.MultiVectors["vector5"], before.MultiVectors["vector5"])
396
+ })
397
+ })
398
+ }
399
+
400
+ func TestFilteringNilProperty(t *testing.T) {
401
+ object := FromObject(
402
+ &models.Object{
403
+ Class: "MyFavoriteClass",
404
+ ID: "73f2eb5f-5abf-447a-81ca-74b1dd168247",
405
+ Properties: map[string]interface{}{
406
+ "IWillBeRemoved": nil,
407
+ "IWillStay": float64(17),
408
+ },
409
+ },
410
+ []float32{1, 2, 0.7},
411
+ nil,
412
+ nil,
413
+ )
414
+ props := object.Properties()
415
+ propsTyped, ok := props.(map[string]interface{})
416
+ require.True(t, ok)
417
+ assert.Equal(t, propsTyped["IWillStay"], float64(17))
418
+
419
+ elem, ok := propsTyped["IWillBeRemoved"]
420
+ require.False(t, ok)
421
+ require.Nil(t, elem)
422
+ }
423
+
424
+ func TestStorageObjectUnmarshallingSpecificProps(t *testing.T) {
425
+ before := FromObject(
426
+ &models.Object{
427
+ Class: "MyFavoriteClass",
428
+ CreationTimeUnix: 123456,
429
+ LastUpdateTimeUnix: 56789,
430
+ ID: strfmt.UUID("73f2eb5f-5abf-447a-81ca-74b1dd168247"),
431
+ Additional: models.AdditionalProperties{
432
+ "classification": &additional.Classification{
433
+ BasedOn: []string{"some", "fields"},
434
+ },
435
+ "interpretation": map[string]interface{}{
436
+ "Source": []interface{}{
437
+ map[string]interface{}{
438
+ "concept": "foo",
439
+ "occurrence": float64(7),
440
+ "weight": float64(3),
441
+ },
442
+ },
443
+ },
444
+ },
445
+ Properties: map[string]interface{}{
446
+ "name": "MyName",
447
+ "foo": float64(17),
448
+ },
449
+ },
450
+ []float32{1, 2, 0.7},
451
+ map[string][]float32{
452
+ "vector1": {1, 2, 3},
453
+ "vector2": {4, 5, 6},
454
+ "vector3": {7, 8, 9},
455
+ },
456
+ nil,
457
+ )
458
+ before.DocID = 7
459
+
460
+ asBinary, err := before.MarshalBinary()
461
+ require.Nil(t, err)
462
+
463
+ t.Run("without any optional", func(t *testing.T) {
464
+ after, err := FromBinaryOptional(asBinary, additional.Properties{}, nil)
465
+ require.Nil(t, err)
466
+
467
+ t.Run("compare", func(t *testing.T) {
468
+ // modify before to match expectations of after
469
+ before.Object.Additional = nil
470
+ before.Vector = nil
471
+ before.VectorLen = 3
472
+ before.Vectors = nil
473
+ assert.Equal(t, before, after)
474
+
475
+ assert.Equal(t, before.DocID, after.DocID)
476
+
477
+ // The vector length should always be returned (for usage metrics
478
+ // purposes) even if the vector itself is skipped
479
+ assert.Equal(t, after.VectorLen, 3)
480
+ })
481
+ })
482
+ }
483
+
484
+ func TestNewStorageObject(t *testing.T) {
485
+ t.Run("objects", func(t *testing.T) {
486
+ so := New(12)
487
+
488
+ t.Run("check index id", func(t *testing.T) {
489
+ assert.Equal(t, uint64(12), so.DocID)
490
+ })
491
+
492
+ t.Run("is invalid without required params", func(t *testing.T) {
493
+ assert.False(t, so.Valid())
494
+ })
495
+
496
+ t.Run("reassign index id", func(t *testing.T) {
497
+ so.DocID = 13
498
+ assert.Equal(t, uint64(13), so.DocID)
499
+ })
500
+
501
+ t.Run("assign class", func(t *testing.T) {
502
+ so.SetClass("MyClass")
503
+ assert.Equal(t, schema.ClassName("MyClass"), so.Class())
504
+ })
505
+
506
+ t.Run("assign uuid", func(t *testing.T) {
507
+ id := strfmt.UUID("bf706904-8618-463f-899c-4a2aafd48d56")
508
+ so.SetID(id)
509
+ assert.Equal(t, id, so.ID())
510
+ })
511
+
512
+ t.Run("assign uuid", func(t *testing.T) {
513
+ schema := map[string]interface{}{
514
+ "foo": "bar",
515
+ }
516
+ so.SetProperties(schema)
517
+ assert.Equal(t, schema, so.Properties())
518
+ })
519
+
520
+ t.Run("must now be valid", func(t *testing.T) {
521
+ assert.True(t, so.Valid())
522
+ })
523
+
524
+ t.Run("make sure it's identical with an object created from an existing object",
525
+ func(t *testing.T) {
526
+ alt := FromObject(&models.Object{
527
+ Class: "MyClass",
528
+ ID: "bf706904-8618-463f-899c-4a2aafd48d56",
529
+ Properties: map[string]interface{}{
530
+ "foo": "bar",
531
+ },
532
+ }, nil, nil, nil)
533
+ alt.DocID = 13
534
+
535
+ assert.Equal(t, so, alt)
536
+ })
537
+ })
538
+
539
+ t.Run("objects", func(t *testing.T) {
540
+ so := New(12)
541
+
542
+ t.Run("check index id", func(t *testing.T) {
543
+ assert.Equal(t, uint64(12), so.DocID)
544
+ })
545
+
546
+ t.Run("is invalid without required params", func(t *testing.T) {
547
+ assert.False(t, so.Valid())
548
+ })
549
+
550
+ t.Run("reassign index id", func(t *testing.T) {
551
+ so.DocID = 13
552
+ assert.Equal(t, uint64(13), so.DocID)
553
+ })
554
+
555
+ t.Run("assign class", func(t *testing.T) {
556
+ so.SetClass("MyClass")
557
+ assert.Equal(t, schema.ClassName("MyClass"), so.Class())
558
+ })
559
+
560
+ t.Run("assign uuid", func(t *testing.T) {
561
+ id := strfmt.UUID("bf706904-8618-463f-899c-4a2aafd48d56")
562
+ so.SetID(id)
563
+ assert.Equal(t, id, so.ID())
564
+ })
565
+
566
+ t.Run("assign uuid", func(t *testing.T) {
567
+ schema := map[string]interface{}{
568
+ "foo": "bar",
569
+ }
570
+ so.SetProperties(schema)
571
+ assert.Equal(t, schema, so.Properties())
572
+ })
573
+
574
+ t.Run("must now be valid", func(t *testing.T) {
575
+ assert.True(t, so.Valid())
576
+ })
577
+
578
+ t.Run("make sure it's identical with an object created from an existing action",
579
+ func(t *testing.T) {
580
+ alt := FromObject(&models.Object{
581
+ Class: "MyClass",
582
+ ID: "bf706904-8618-463f-899c-4a2aafd48d56",
583
+ Properties: map[string]interface{}{
584
+ "foo": "bar",
585
+ },
586
+ }, nil, nil, nil)
587
+ alt.DocID = 13
588
+
589
+ assert.Equal(t, so, alt)
590
+ })
591
+ })
592
+ }
593
+
594
+ func TestStorageArrayObjectMarshalling(t *testing.T) {
595
+ before := FromObject(
596
+ &models.Object{
597
+ Class: "MyFavoriteClass",
598
+ CreationTimeUnix: 123456,
599
+ LastUpdateTimeUnix: 56789,
600
+ ID: strfmt.UUID("73f2eb5f-5abf-447a-81ca-74b1dd168247"),
601
+ Additional: models.AdditionalProperties{
602
+ "classification": &additional.Classification{
603
+ BasedOn: []string{"some", "fields"},
604
+ },
605
+ "interpretation": map[string]interface{}{
606
+ "Source": []interface{}{
607
+ map[string]interface{}{
608
+ "concept": "foo",
609
+ "occurrence": float64(7),
610
+ "weight": float64(3),
611
+ },
612
+ },
613
+ },
614
+ },
615
+ Properties: map[string]interface{}{
616
+ "textArray": []string{"c", "d"},
617
+ "numberArray": []float64{1.1, 2.1},
618
+ "foo": float64(17),
619
+ },
620
+ },
621
+ []float32{1, 2, 0.7},
622
+ map[string][]float32{
623
+ "vector1": {1, 2, 3},
624
+ "vector2": {4, 5, 6},
625
+ "vector3": {7, 8, 9},
626
+ },
627
+ nil,
628
+ )
629
+ before.DocID = 7
630
+
631
+ asBinary, err := before.MarshalBinary()
632
+ require.Nil(t, err)
633
+
634
+ after, err := FromBinary(asBinary)
635
+ require.Nil(t, err)
636
+
637
+ t.Run("compare", func(t *testing.T) {
638
+ assert.Equal(t, before, after)
639
+ })
640
+
641
+ t.Run("extract only doc id and compare", func(t *testing.T) {
642
+ id, updateTime, err := DocIDAndTimeFromBinary(asBinary)
643
+ require.Nil(t, err)
644
+ assert.Equal(t, uint64(7), id)
645
+ assert.Equal(t, before.LastUpdateTimeUnix(), updateTime)
646
+ })
647
+
648
+ t.Run("extract text array prop", func(t *testing.T) {
649
+ prop, ok, err := ParseAndExtractTextProp(asBinary, "textArray")
650
+ require.Nil(t, err)
651
+ require.True(t, ok)
652
+ assert.Equal(t, []string{"c", "d"}, prop)
653
+ })
654
+
655
+ t.Run("extract number array prop", func(t *testing.T) {
656
+ prop, ok, err := ParseAndExtractNumberArrayProp(asBinary, "numberArray")
657
+ require.Nil(t, err)
658
+ require.True(t, ok)
659
+ assert.Equal(t, []float64{1.1, 2.1}, prop)
660
+ })
661
+ }
662
+
663
+ func TestExtractionOfSingleProperties(t *testing.T) {
664
+ expected := map[string]interface{}{
665
+ "numberArray": []interface{}{1.1, 2.1},
666
+ "intArray": []interface{}{1., 2., 5000.},
667
+ "textArrayUTF": []interface{}{"語", "b"},
668
+ "textArray": []interface{}{"hello", ",", "I", "am", "a", "veeery", "long", "Array", "with some text."},
669
+ "foo": float64(17),
670
+ "text": "single string",
671
+ "bool": true,
672
+ "time": "2011-11-23T01:52:23.000004234Z",
673
+ "boolArray": []interface{}{true, false, true},
674
+ "beacon": []interface{}{map[string]interface{}{"beacon": "weaviate://localhost/SomeClass/3453/73f4eb5f-5abf-447a-81ca-74b1dd168247"}},
675
+ "ref": []interface{}{
676
+ map[string]interface{}{"beacon": "weaviate://localhost/SomeClass/3453/73f4eb5f-5abf-447a-81ca-74b1dd168247"},
677
+ map[string]interface{}{"beacon": "weaviate://localhost/SomeClass/3453/73f4eb5f-5abf-447a-81ca-74b1dd168248"},
678
+ },
679
+ "nested": map[string]interface{}{"test": map[string]interface{}{"innerInt": float64(3), "innerStr": "avc"}},
680
+ "nestedArray": []interface{}{map[string]interface{}{"test": map[string]interface{}{"innerArray": float64(3), "innerStr": "avc"}}},
681
+ }
682
+ properties := map[string]interface{}{
683
+ "numberArray": []float64{1.1, 2.1},
684
+ "intArray": []int32{1, 2, 5000},
685
+ "textArrayUTF": []string{"語", "b"},
686
+ "textArray": []string{"hello", ",", "I", "am", "a", "veeery", "long", "Array", "with some text."},
687
+ "foo": float64(17),
688
+ "text": "single string",
689
+ "bool": true,
690
+ "time": time.Date(2011, 11, 23, 1, 52, 23, 4234, time.UTC),
691
+ "boolArray": []bool{true, false, true},
692
+ "beacon": []map[string]interface{}{{"beacon": "weaviate://localhost/SomeClass/3453/73f4eb5f-5abf-447a-81ca-74b1dd168247"}},
693
+ "ref": []models.SingleRef{
694
+ {Beacon: "weaviate://localhost/SomeClass/3453/73f4eb5f-5abf-447a-81ca-74b1dd168247", Class: "OtherClass", Href: "/v1/f81bfe5e-16ba-4615-a516-46c2ae2e5a80"},
695
+ {Beacon: "weaviate://localhost/SomeClass/3453/73f4eb5f-5abf-447a-81ca-74b1dd168248", Class: "OtherClass", Href: "/v1/f81bfe5e-16ba-4615-a516-46c2ae2e5a81"},
696
+ },
697
+ "nested": map[string]interface{}{"test": map[string]interface{}{"innerInt": 3, "innerStr": "avc"}},
698
+ "nestedArray": []interface{}{map[string]interface{}{"test": map[string]interface{}{"innerArray": float64(3), "innerStr": "avc"}}},
699
+ }
700
+ before := FromObject(
701
+ &models.Object{
702
+ Class: "MyFavoriteClass",
703
+ CreationTimeUnix: 123456,
704
+ LastUpdateTimeUnix: 56789,
705
+ ID: "73f2eb5f-5abf-447a-81ca-74b1dd168247",
706
+ Properties: properties,
707
+ },
708
+ []float32{1, 2, 0.7},
709
+ nil,
710
+ nil,
711
+ )
712
+
713
+ before.DocID = 7
714
+ byteObject, err := before.MarshalBinary()
715
+ require.Nil(t, err)
716
+
717
+ var propStrings [][]string
718
+ for key := range properties {
719
+ propStrings = append(propStrings, []string{key})
720
+ }
721
+
722
+ extractedProperties := map[string]interface{}{}
723
+
724
+ // test with reused property map
725
+ for i := 0; i < 2; i++ {
726
+ require.Nil(t, UnmarshalPropertiesFromObject(byteObject, extractedProperties, propStrings))
727
+ for key := range expected {
728
+ require.Equal(t, expected[key], extractedProperties[key])
729
+ }
730
+ }
731
+ }
732
+
733
+ func TestStorageObjectMarshallingWithGroup(t *testing.T) {
734
+ before := FromObject(
735
+ &models.Object{
736
+ Class: "MyFavoriteClass",
737
+ CreationTimeUnix: 123456,
738
+ LastUpdateTimeUnix: 56789,
739
+ ID: strfmt.UUID("73f2eb5f-5abf-447a-81ca-74b1dd168247"),
740
+ Additional: models.AdditionalProperties{
741
+ "classification": &additional.Classification{
742
+ BasedOn: []string{"some", "fields"},
743
+ },
744
+ "interpretation": map[string]interface{}{
745
+ "Source": []interface{}{
746
+ map[string]interface{}{
747
+ "concept": "foo",
748
+ "occurrence": float64(7),
749
+ "weight": float64(3),
750
+ },
751
+ },
752
+ },
753
+ "group": &additional.Group{
754
+ ID: 100,
755
+ GroupedBy: &additional.GroupedBy{
756
+ Value: "group-by-some-property",
757
+ Path: []string{"property-path"},
758
+ },
759
+ MaxDistance: 0.1,
760
+ MinDistance: 0.2,
761
+ Count: 200,
762
+ Hits: []map[string]interface{}{
763
+ {
764
+ "property1": "value1",
765
+ "_additional": &additional.GroupHitAdditional{
766
+ ID: "2c76ca18-2073-4c48-aa52-7f444d2f5b80",
767
+ Distance: 0.24,
768
+ },
769
+ },
770
+ {
771
+ "property1": "value2",
772
+ },
773
+ },
774
+ },
775
+ },
776
+ Properties: map[string]interface{}{
777
+ "name": "MyName",
778
+ "foo": float64(17),
779
+ },
780
+ },
781
+ []float32{1, 2, 0.7},
782
+ map[string][]float32{
783
+ "vector1": {1, 2, 3},
784
+ "vector2": {4, 5, 6},
785
+ "vector3": {7, 8, 9},
786
+ },
787
+ nil,
788
+ )
789
+ before.DocID = 7
790
+
791
+ asBinary, err := before.MarshalBinary()
792
+ require.Nil(t, err)
793
+
794
+ after, err := FromBinary(asBinary)
795
+ require.Nil(t, err)
796
+
797
+ t.Run("compare", func(t *testing.T) {
798
+ assert.Equal(t, before, after)
799
+ })
800
+
801
+ t.Run("extract only doc id and compare", func(t *testing.T) {
802
+ id, updateTime, err := DocIDAndTimeFromBinary(asBinary)
803
+ require.Nil(t, err)
804
+ assert.Equal(t, uint64(7), id)
805
+ assert.Equal(t, before.LastUpdateTimeUnix(), updateTime)
806
+ })
807
+
808
+ t.Run("extract single text prop", func(t *testing.T) {
809
+ prop, ok, err := ParseAndExtractTextProp(asBinary, "name")
810
+ require.Nil(t, err)
811
+ require.True(t, ok)
812
+ require.NotEmpty(t, prop)
813
+ assert.Equal(t, "MyName", prop[0])
814
+ })
815
+
816
+ t.Run("extract non-existing text prop", func(t *testing.T) {
817
+ prop, ok, err := ParseAndExtractTextProp(asBinary, "IDoNotExist")
818
+ require.Nil(t, err)
819
+ require.True(t, ok)
820
+ require.Empty(t, prop)
821
+ })
822
+
823
+ t.Run("extract group additional property", func(t *testing.T) {
824
+ require.NotNil(t, after.AdditionalProperties())
825
+ require.NotNil(t, after.AdditionalProperties()["group"])
826
+ group, ok := after.AdditionalProperties()["group"].(*additional.Group)
827
+ require.True(t, ok)
828
+ assert.Equal(t, 100, group.ID)
829
+ assert.NotNil(t, group.GroupedBy)
830
+ assert.Equal(t, "group-by-some-property", group.GroupedBy.Value)
831
+ assert.Equal(t, []string{"property-path"}, group.GroupedBy.Path)
832
+ assert.Equal(t, 200, group.Count)
833
+ assert.Equal(t, float32(0.1), group.MaxDistance)
834
+ assert.Equal(t, float32(0.2), group.MinDistance)
835
+ require.Len(t, group.Hits, 2)
836
+ require.NotNil(t, group.Hits[0]["_additional"])
837
+ groupHitAdditional, ok := group.Hits[0]["_additional"].(*additional.GroupHitAdditional)
838
+ require.True(t, ok)
839
+ assert.Equal(t, strfmt.UUID("2c76ca18-2073-4c48-aa52-7f444d2f5b80"), groupHitAdditional.ID)
840
+ assert.Equal(t, float32(0.24), groupHitAdditional.Distance)
841
+ assert.Equal(t, "value1", group.Hits[0]["property1"])
842
+ require.Nil(t, group.Hits[1]["_additional"])
843
+ assert.Equal(t, "value2", group.Hits[1]["property1"])
844
+ })
845
+ }
846
+
847
+ func TestStorageMaxVectorDimensionsObjectMarshalling(t *testing.T) {
848
+ generateVector := func(dims uint16) []float32 {
849
+ vector := make([]float32, dims)
850
+ for i := range vector {
851
+ vector[i] = 0.1
852
+ }
853
+ return vector
854
+ }
855
+ // 65535 is max uint16 number
856
+ edgeVectorLengths := []uint16{0, 1, 768, 50000, 65535}
857
+ for _, vectorLength := range edgeVectorLengths {
858
+ t.Run(fmt.Sprintf("%v vector dimensions", vectorLength), func(t *testing.T) {
859
+ t.Run("marshal binary", func(t *testing.T) {
860
+ vector := generateVector(vectorLength)
861
+ before := FromObject(
862
+ &models.Object{
863
+ Class: "MyFavoriteClass",
864
+ CreationTimeUnix: 123456,
865
+ ID: strfmt.UUID("73f2eb5f-5abf-447a-81ca-74b1dd168247"),
866
+ Properties: map[string]interface{}{
867
+ "name": "myName",
868
+ },
869
+ },
870
+ vector,
871
+ nil,
872
+ nil,
873
+ )
874
+ before.DocID = 7
875
+
876
+ asBinary, err := before.MarshalBinary()
877
+ require.Nil(t, err)
878
+
879
+ after, err := FromBinary(asBinary)
880
+ require.Nil(t, err)
881
+
882
+ t.Run("compare", func(t *testing.T) {
883
+ assert.Equal(t, before, after)
884
+ })
885
+
886
+ t.Run("try to extract a property", func(t *testing.T) {
887
+ prop, ok, err := ParseAndExtractTextProp(asBinary, "name")
888
+ require.Nil(t, err)
889
+ require.True(t, ok)
890
+ assert.Equal(t, []string{"myName"}, prop)
891
+ })
892
+ })
893
+
894
+ t.Run("marshal optional binary", func(t *testing.T) {
895
+ vector := generateVector(vectorLength)
896
+ before := FromObject(
897
+ &models.Object{
898
+ Class: "MyFavoriteClass",
899
+ CreationTimeUnix: 123456,
900
+ ID: strfmt.UUID("73f2eb5f-5abf-447a-81ca-74b1dd168247"),
901
+ Properties: map[string]interface{}{
902
+ "name": "myName",
903
+ "second": "entry",
904
+ },
905
+ },
906
+ vector,
907
+ nil,
908
+ nil,
909
+ )
910
+ before.DocID = 7
911
+
912
+ asBinary, err := before.MarshalBinary()
913
+ require.Nil(t, err)
914
+
915
+ t.Run("get without additional properties", func(t *testing.T) {
916
+ after, err := FromBinaryOptional(asBinary, additional.Properties{}, nil)
917
+ require.Nil(t, err)
918
+ // modify before to match expectations of after
919
+ before.Object.Additional = nil
920
+ before.Vector = nil
921
+ before.VectorLen = int(vectorLength)
922
+ assert.Equal(t, before, after)
923
+
924
+ assert.Equal(t, before.DocID, after.DocID)
925
+
926
+ // The vector length should always be returned (for usage metrics
927
+ // purposes) even if the vector itself is skipped
928
+ assert.Equal(t, after.VectorLen, int(vectorLength))
929
+ })
930
+
931
+ t.Run("get with additional property vector", func(t *testing.T) {
932
+ after, err := FromBinaryOptional(asBinary, additional.Properties{Vector: true}, nil)
933
+ require.Nil(t, err)
934
+ // modify before to match expectations of after
935
+ before.Object.Additional = nil
936
+ before.Vector = vector
937
+ before.VectorLen = int(vectorLength)
938
+
939
+ assert.Equal(t, before, after)
940
+
941
+ assert.Equal(t, before.DocID, after.DocID)
942
+
943
+ // The vector length should always be returned (for usage metrics
944
+ // purposes) even if the vector itself is skipped
945
+ assert.Equal(t, after.VectorLen, int(vectorLength))
946
+ assert.Equal(t, vector, after.Vector)
947
+ })
948
+
949
+ t.Run("with explicit properties", func(t *testing.T) {
950
+ after, err := FromBinaryOptional(asBinary, additional.Properties{},
951
+ &PropertyExtraction{PropertyPaths: [][]string{{"name"}}},
952
+ )
953
+ require.Nil(t, err)
954
+
955
+ assert.Equal(t, before.DocID, after.DocID)
956
+ // second property is not included
957
+ assert.Equal(t, map[string]interface{}{"name": "myName"}, after.Properties())
958
+ })
959
+
960
+ t.Run("test no props and moduleparams", func(t *testing.T) {
961
+ after, err := FromBinaryOptional(asBinary, additional.Properties{
962
+ NoProps: true,
963
+ ModuleParams: map[string]interface{}{"foo": "bar"}, // this causes the property extraction code to run
964
+ },
965
+ &PropertyExtraction{PropertyPaths: nil},
966
+ )
967
+ require.Nil(t, err)
968
+
969
+ assert.Equal(t, before.DocID, after.DocID)
970
+ var emptyProps map[string]interface{}
971
+ assert.Equal(t, emptyProps, after.Properties())
972
+ })
973
+ })
974
+ })
975
+ }
976
+ }
977
+
978
+ func TestVectorFromBinary(t *testing.T) {
979
+ vector1 := []float32{1, 2, 3}
980
+ vector2 := []float32{4, 5, 6}
981
+ vector3 := []float32{7, 8, 9}
982
+ before := FromObject(
983
+ &models.Object{
984
+ Class: "MyFavoriteClass",
985
+ CreationTimeUnix: 123456,
986
+ LastUpdateTimeUnix: 56789,
987
+ ID: strfmt.UUID("73f2eb5f-5abf-447a-81ca-74b1dd168247"),
988
+ Additional: models.AdditionalProperties{
989
+ "classification": &additional.Classification{
990
+ BasedOn: []string{"some", "fields"},
991
+ },
992
+ "interpretation": map[string]interface{}{
993
+ "Source": []interface{}{
994
+ map[string]interface{}{
995
+ "concept": "foo",
996
+ "occurrence": float64(7),
997
+ "weight": float64(3),
998
+ },
999
+ },
1000
+ },
1001
+ "group": &additional.Group{
1002
+ ID: 100,
1003
+ GroupedBy: &additional.GroupedBy{
1004
+ Value: "group-by-some-property",
1005
+ Path: []string{"property-path"},
1006
+ },
1007
+ MaxDistance: 0.1,
1008
+ MinDistance: 0.2,
1009
+ Count: 200,
1010
+ Hits: []map[string]interface{}{
1011
+ {
1012
+ "property1": "value1",
1013
+ "_additional": &additional.GroupHitAdditional{
1014
+ ID: "2c76ca18-2073-4c48-aa52-7f444d2f5b80",
1015
+ Distance: 0.24,
1016
+ },
1017
+ },
1018
+ {
1019
+ "property1": "value2",
1020
+ },
1021
+ },
1022
+ },
1023
+ },
1024
+ Properties: map[string]interface{}{
1025
+ "name": "MyName",
1026
+ "foo": float64(17),
1027
+ },
1028
+ },
1029
+ []float32{1, 2, 0.7},
1030
+ map[string][]float32{
1031
+ "vector1": vector1,
1032
+ "vector2": vector2,
1033
+ "vector3": vector3,
1034
+ },
1035
+ nil,
1036
+ )
1037
+ before.DocID = 7
1038
+
1039
+ asBinary, err := before.MarshalBinary()
1040
+ require.Nil(t, err)
1041
+
1042
+ outVector1, err := VectorFromBinary(asBinary, nil, "vector1")
1043
+ require.Nil(t, err)
1044
+ assert.Equal(t, vector1, outVector1)
1045
+
1046
+ outVector2, err := VectorFromBinary(asBinary, nil, "vector2")
1047
+ require.Nil(t, err)
1048
+ assert.Equal(t, vector2, outVector2)
1049
+
1050
+ outVector3, err := VectorFromBinary(asBinary, nil, "vector3")
1051
+ require.Nil(t, err)
1052
+ assert.Equal(t, vector3, outVector3)
1053
+ }
1054
+
1055
+ func TestMultiVectorFromBinary(t *testing.T) {
1056
+ vector1 := [][]float32{{1, 2, 3}, {4, 5, 6}}
1057
+ vector2 := [][]float32{{4, 5, 6}, {7, 8, 9}}
1058
+ vector3 := [][]float32{{7, 8, 9}, {10, 11, 12}, {13, 14, 15}}
1059
+ vector4 := []float32{1, 2, 3}
1060
+ before := FromObject(
1061
+ &models.Object{
1062
+ Class: "MyFavoriteClass",
1063
+ CreationTimeUnix: 123456,
1064
+ LastUpdateTimeUnix: 56789,
1065
+ ID: strfmt.UUID("73f2eb5f-5abf-447a-81ca-74b1dd168247"),
1066
+ Additional: models.AdditionalProperties{
1067
+ "classification": &additional.Classification{
1068
+ BasedOn: []string{"some", "fields"},
1069
+ },
1070
+ "interpretation": map[string]interface{}{
1071
+ "Source": []interface{}{
1072
+ map[string]interface{}{
1073
+ "concept": "foo",
1074
+ "occurrence": float64(7),
1075
+ "weight": float64(3),
1076
+ },
1077
+ },
1078
+ },
1079
+ "group": &additional.Group{
1080
+ ID: 100,
1081
+ GroupedBy: &additional.GroupedBy{
1082
+ Value: "group-by-some-property",
1083
+ Path: []string{"property-path"},
1084
+ },
1085
+ MaxDistance: 0.1,
1086
+ MinDistance: 0.2,
1087
+ Count: 200,
1088
+ Hits: []map[string]interface{}{
1089
+ {
1090
+ "property1": "value1",
1091
+ "_additional": &additional.GroupHitAdditional{
1092
+ ID: "2c76ca18-2073-4c48-aa52-7f444d2f5b80",
1093
+ Distance: 0.24,
1094
+ },
1095
+ },
1096
+ {
1097
+ "property1": "value2",
1098
+ },
1099
+ },
1100
+ },
1101
+ },
1102
+ Properties: map[string]interface{}{
1103
+ "name": "MyName",
1104
+ "foo": float64(17),
1105
+ },
1106
+ },
1107
+ []float32{1, 2, 0.7},
1108
+ map[string][]float32{
1109
+ "vector4": vector4,
1110
+ },
1111
+ map[string][][]float32{
1112
+ "vector1": vector1,
1113
+ "vector2": vector2,
1114
+ "vector3": vector3,
1115
+ },
1116
+ )
1117
+ before.DocID = 7
1118
+
1119
+ asBinary, err := before.MarshalBinary()
1120
+ require.Nil(t, err)
1121
+
1122
+ outVector1, err := MultiVectorFromBinary(asBinary, nil, "vector1")
1123
+ require.Nil(t, err)
1124
+ assert.Equal(t, vector1, outVector1)
1125
+
1126
+ outVector2, err := MultiVectorFromBinary(asBinary, nil, "vector2")
1127
+ require.Nil(t, err)
1128
+ assert.Equal(t, vector2, outVector2)
1129
+
1130
+ outVector3, err := MultiVectorFromBinary(asBinary, nil, "vector3")
1131
+ require.Nil(t, err)
1132
+ assert.Equal(t, vector3, outVector3)
1133
+
1134
+ outVector4, err := VectorFromBinary(asBinary, nil, "vector4")
1135
+ require.Nil(t, err)
1136
+ assert.Equal(t, vector4, outVector4)
1137
+ }
1138
+
1139
+ func TestStorageInvalidObjectMarshalling(t *testing.T) {
1140
+ t.Run("invalid className", func(t *testing.T) {
1141
+ invalidClassName := make([]byte, maxClassNameLength+1)
1142
+ cryptorand.Read(invalidClassName[:])
1143
+
1144
+ invalidObj := FromObject(
1145
+ &models.Object{
1146
+ Class: string(invalidClassName),
1147
+ CreationTimeUnix: 123456,
1148
+ LastUpdateTimeUnix: 56789,
1149
+ ID: strfmt.UUID("73f2eb5f-5abf-447a-81ca-74b1dd168247"),
1150
+ },
1151
+ nil,
1152
+ nil,
1153
+ nil,
1154
+ )
1155
+
1156
+ _, err := invalidObj.MarshalBinary()
1157
+ require.ErrorContains(t, err, "could not marshal 'className' max length exceeded")
1158
+ })
1159
+
1160
+ t.Run("invalid vector", func(t *testing.T) {
1161
+ invalidObj := FromObject(
1162
+ &models.Object{
1163
+ Class: "classA",
1164
+ CreationTimeUnix: 123456,
1165
+ LastUpdateTimeUnix: 56789,
1166
+ ID: strfmt.UUID("73f2eb5f-5abf-447a-81ca-74b1dd168247"),
1167
+ },
1168
+ make([]float32, maxVectorLength+1),
1169
+ nil,
1170
+ nil,
1171
+ )
1172
+
1173
+ _, err := invalidObj.MarshalBinary()
1174
+ require.ErrorContains(t, err, "could not marshal 'vector' max length exceeded")
1175
+ })
1176
+
1177
+ t.Run("invalid named vector size", func(t *testing.T) {
1178
+ invalidObj := FromObject(
1179
+ &models.Object{
1180
+ Class: "classA",
1181
+ CreationTimeUnix: 123456,
1182
+ LastUpdateTimeUnix: 56789,
1183
+ ID: strfmt.UUID("73f2eb5f-5abf-447a-81ca-74b1dd168247"),
1184
+ },
1185
+ nil,
1186
+ map[string][]float32{
1187
+ "vector1": make([]float32, maxVectorLength+1),
1188
+ },
1189
+ nil,
1190
+ )
1191
+
1192
+ _, err := invalidObj.MarshalBinary()
1193
+ require.ErrorContains(t, err, "could not marshal 'vector' max length exceeded")
1194
+ })
1195
+ }
1196
+
1197
+ // Test that using the same buffer as source for unmarshalling does not cause problems due to memoy reuse
1198
+ func TestMemoryReuse(t *testing.T) {
1199
+ props := []map[string]interface{}{
1200
+ {
1201
+ "numberArray": []interface{}{1.1, 2.1},
1202
+ "intArray": []interface{}{1., 2., 5000.},
1203
+ "textArrayUTF": []interface{}{"語", "b"},
1204
+ "boolArray": []interface{}{true, false},
1205
+ "textArray": []interface{}{"hello", ",", "I", "am", "a", "veeery", "long", "Array", "with some text."},
1206
+ "ref": []interface{}{map[string]interface{}{"beacon": "weaviate://localhost/SomeClass/73f4eb5f-5abf-447a-81ca-74b1dd168247"}},
1207
+ "foo": float64(17),
1208
+ },
1209
+ {
1210
+ "numberArray": []interface{}{1.4, 6.1},
1211
+ "intArray": []interface{}{4., 3., 9000.},
1212
+ "textArrayUTF": []interface{}{"a", "c"},
1213
+ "boolArray": []interface{}{true, true},
1214
+ "textArray": []interface{}{"I", "contain", "other", "text"},
1215
+ "ref": []interface{}{map[string]interface{}{"beacon": "weaviate://localhost/SomeClass/73f4eb5f-5abf-447a-81ca-74b1dd168248"}},
1216
+ "foo": float64(5),
1217
+ },
1218
+ {
1219
+ "numberArray": []interface{}{1.4, 6.1, 8.9},
1220
+ "intArray": []interface{}{4., 3., 9000., 1.},
1221
+ "textArrayUTF": []interface{}{"a", "c", "d"},
1222
+ "boolArray": []interface{}{true, true, false},
1223
+ "textArray": []interface{}{"I", "contain", "other", "text", "too"},
1224
+ "ref": []interface{}{map[string]interface{}{"beacon": "weaviate://localhost/SomeClass/73f4eb5f-5abf-447a-81ca-74b1dd168249"}},
1225
+ "foo": float64(9),
1226
+ },
1227
+ }
1228
+
1229
+ largestSize := 0
1230
+ for i, prop := range props {
1231
+ obj := models.Object{
1232
+ Class: "something",
1233
+ ID: strfmt.UUID(fmt.Sprintf("73f4eb5f-5abf-447a-81ca-74b1dd16824%v", i)),
1234
+ Properties: prop,
1235
+ }
1236
+ before := FromObject(&obj, nil, nil, nil)
1237
+ asBinary, err := before.MarshalBinary()
1238
+ require.Nil(t, err)
1239
+ if len(asBinary) > largestSize {
1240
+ largestSize = len(asBinary)
1241
+ }
1242
+ }
1243
+
1244
+ reuseableBuff := make([]byte, largestSize)
1245
+ afterProps := []map[string]interface{}{}
1246
+ for i, beforeProp := range props {
1247
+ obj := models.Object{
1248
+ Class: "something",
1249
+ ID: strfmt.UUID(fmt.Sprintf("73f4eb5f-5abf-447a-81ca-74b1dd16824%v", i)),
1250
+ Properties: beforeProp,
1251
+ }
1252
+
1253
+ propertyPaths := make([][]string, 0, len(beforeProp))
1254
+ for j := range beforeProp {
1255
+ propertyPaths = append(propertyPaths, []string{j})
1256
+ }
1257
+
1258
+ before := FromObject(&obj, nil, nil, nil)
1259
+ asBinary, err := before.MarshalBinary()
1260
+ require.Nil(t, err)
1261
+ reuseableBuff = reuseableBuff[:len(asBinary)]
1262
+ copy(reuseableBuff, asBinary)
1263
+
1264
+ afterProp := map[string]interface{}{}
1265
+ require.Nil(t, UnmarshalProperties(reuseableBuff, afterProp, propertyPaths))
1266
+ afterProps = append(afterProps, afterProp)
1267
+ }
1268
+
1269
+ for i, afterProp := range afterProps {
1270
+ assert.Equal(t, props[i], afterProp)
1271
+ }
1272
+ }
1273
+
1274
+ func BenchmarkUnmarshalPropertiesFullObject(b *testing.B) {
1275
+ benchmarkExtraction(b, nil)
1276
+ }
1277
+
1278
+ func BenchmarkUnmarshalPropertiesExplicitOnlySome(b *testing.B) {
1279
+ benchmarkExtraction(b, []string{"name", "second"})
1280
+ }
1281
+
1282
+ func BenchmarkUnmarshalPropertiesExplicitAll(b *testing.B) {
1283
+ benchmarkExtraction(b, []string{"name", "second", "number", "bool", "array"})
1284
+ }
1285
+
1286
+ func benchmarkExtraction(b *testing.B, propStrings []string) {
1287
+ beforeProps := map[string]interface{}{
1288
+ "name": "some long string",
1289
+ "second": "other very long string",
1290
+ "number": float64(17),
1291
+ "bool": false,
1292
+ "array": []string{"a", "b", "c", "d", "e", "f", "g", "h", "i", "j"},
1293
+ }
1294
+ before := FromObject(
1295
+ &models.Object{
1296
+ Class: "MyFavoriteClass",
1297
+ CreationTimeUnix: 123456,
1298
+ ID: "73f2eb5f-5abf-447a-81ca-74b1dd168247",
1299
+ Properties: beforeProps,
1300
+ },
1301
+ nil,
1302
+ nil,
1303
+ nil,
1304
+ )
1305
+ before.DocID = 7
1306
+ var props *PropertyExtraction
1307
+
1308
+ if len(propStrings) > 0 {
1309
+ propertyPaths := make([][]string, len(propStrings))
1310
+ for i, prop := range propStrings {
1311
+ propertyPaths[i] = []string{prop}
1312
+ }
1313
+
1314
+ props = &PropertyExtraction{
1315
+ PropertyPaths: propertyPaths,
1316
+ }
1317
+ }
1318
+
1319
+ asBinary, err := before.MarshalBinary()
1320
+ require.Nil(b, err)
1321
+
1322
+ b.ResetTimer()
1323
+
1324
+ for n := 0; n < b.N; n++ {
1325
+ after, err := FromBinaryOptional(asBinary, additional.Properties{}, props)
1326
+ require.Nil(b, err)
1327
+ require.NotNil(b, after)
1328
+ }
1329
+ }
1330
+
1331
+ func TestObjectsByDocID(t *testing.T) {
1332
+ // the main variable is the input length here which has an effect on chunking
1333
+ // and parallelization
1334
+ tests := []struct {
1335
+ name string
1336
+ inputIDs []uint64
1337
+ // there is no flag for expected output as that is deterministic based on
1338
+ // the doc ID, we use a convention for the UUID and set a specific prop
1339
+ // exactly to the doc ID.
1340
+ }{
1341
+ {
1342
+ name: "1 object - sequential code path",
1343
+ inputIDs: []uint64{0},
1344
+ },
1345
+ {
1346
+ name: "2 objects - concurrent code path",
1347
+ inputIDs: []uint64{0, 1},
1348
+ },
1349
+ {
1350
+ name: "10 objects - consecutive from beginning",
1351
+ inputIDs: []uint64{0, 1, 2, 3, 4, 5, 6, 7, 8, 9},
1352
+ },
1353
+ {
1354
+ name: "30 objects - consecutive from beginning",
1355
+ inputIDs: []uint64{
1356
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
1357
+ 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,
1358
+ },
1359
+ },
1360
+ {
1361
+ name: "100 objects - random - should perfectly match to divide into groups",
1362
+ inputIDs: pickRandomIDsBetween(0, 1000, 100),
1363
+ },
1364
+ {
1365
+ name: "99 objects - random - uneven groups slightly below perfect chunk size",
1366
+ inputIDs: pickRandomIDsBetween(0, 1000, 99),
1367
+ },
1368
+ {
1369
+ name: "101 objects - random - uneven groups slightly above perfect chunk size",
1370
+ inputIDs: pickRandomIDsBetween(0, 1000, 101),
1371
+ },
1372
+ {
1373
+ name: "117 objects - random - because why not",
1374
+ inputIDs: pickRandomIDsBetween(0, 1000, 117),
1375
+ },
1376
+ }
1377
+
1378
+ logger, _ := test.NewNullLogger()
1379
+
1380
+ bucket := genFakeBucket(t, 1000)
1381
+
1382
+ for _, test := range tests {
1383
+ t.Run(test.name, func(t *testing.T) {
1384
+ res, err := ObjectsByDocID(bucket, test.inputIDs, additional.Properties{}, nil, logger)
1385
+ require.Nil(t, err)
1386
+ require.Len(t, res, len(test.inputIDs))
1387
+
1388
+ for i, obj := range res {
1389
+ expectedDocID := test.inputIDs[i]
1390
+ assert.Equal(t, expectedDocID, uint64(obj.Properties().(map[string]any)["i"].(float64)))
1391
+ expectedUUID := strfmt.UUID(fmt.Sprintf("73f2eb5f-5abf-447a-81ca-74b1dd1%05d", expectedDocID))
1392
+ assert.Equal(t, expectedUUID, obj.ID())
1393
+ }
1394
+ })
1395
+ }
1396
+ }
1397
+
1398
+ func TestSkipMissingObjects(t *testing.T) {
1399
+ bucket := genFakeBucket(t, 1000)
1400
+ logger, _ := test.NewNullLogger()
1401
+ ids := pickRandomIDsBetween(0, 1000, 100)
1402
+ ids = append(ids, 1001, 1002, 1003)
1403
+ objs, err := objectsByDocIDParallel(bucket, ids, additional.Properties{}, nil, logger)
1404
+ require.Nil(t, err)
1405
+ require.Len(t, objs, 100)
1406
+ for _, obj := range objs {
1407
+ require.NotNil(t, obj)
1408
+ }
1409
+ }
1410
+
1411
+ func TestIterateThroughVectorDimensions(t *testing.T) {
1412
+ for _, tt := range []struct {
1413
+ name string
1414
+ object Object
1415
+
1416
+ expect map[string]int
1417
+ }{
1418
+ {
1419
+ name: "empty",
1420
+ object: Object{},
1421
+ expect: map[string]int{},
1422
+ },
1423
+ {
1424
+ name: "legacy",
1425
+ object: Object{
1426
+ Vector: make([]float32, 100),
1427
+ },
1428
+ expect: map[string]int{
1429
+ "": 100,
1430
+ },
1431
+ },
1432
+ {
1433
+ name: "named",
1434
+ object: Object{
1435
+ Vectors: map[string][]float32{
1436
+ "vec1": make([]float32, 100),
1437
+ "vec2": make([]float32, 200),
1438
+ },
1439
+ },
1440
+ expect: map[string]int{
1441
+ "vec1": 100,
1442
+ "vec2": 200,
1443
+ },
1444
+ },
1445
+ {
1446
+ name: "multi",
1447
+ object: Object{
1448
+ MultiVectors: map[string][][]float32{
1449
+ "vec1": {
1450
+ make([]float32, 100),
1451
+ make([]float32, 200),
1452
+ make([]float32, 300),
1453
+ },
1454
+ "vec2": {
1455
+ make([]float32, 400),
1456
+ make([]float32, 500),
1457
+ },
1458
+ },
1459
+ },
1460
+ expect: map[string]int{
1461
+ "vec1": 600,
1462
+ "vec2": 900,
1463
+ },
1464
+ },
1465
+ {
1466
+ name: "mixed",
1467
+ object: Object{
1468
+ Vector: make([]float32, 100),
1469
+ Vectors: map[string][]float32{
1470
+ "vec1": make([]float32, 200),
1471
+ "vec2": make([]float32, 300),
1472
+ },
1473
+ MultiVectors: map[string][][]float32{
1474
+ "vec3": {
1475
+ make([]float32, 400),
1476
+ },
1477
+ "vec4": {
1478
+ make([]float32, 500),
1479
+ },
1480
+ },
1481
+ },
1482
+ expect: map[string]int{
1483
+ "": 100,
1484
+ "vec1": 200,
1485
+ "vec2": 300,
1486
+ "vec3": 400,
1487
+ "vec4": 500,
1488
+ },
1489
+ },
1490
+ } {
1491
+ t.Run(tt.name, func(t *testing.T) {
1492
+ captured := map[string]int{}
1493
+ err := tt.object.IterateThroughVectorDimensions(func(targetVector string, dims int) error {
1494
+ captured[targetVector] += dims
1495
+ return nil
1496
+ })
1497
+ require.NoError(t, err)
1498
+ require.Equal(t, tt.expect, captured)
1499
+ })
1500
+ }
1501
+ }
1502
+
1503
+ func BenchmarkObjectsByDocID(b *testing.B) {
1504
+ bucket := genFakeBucket(b, 10000)
1505
+ logger, _ := test.NewNullLogger()
1506
+ ids := pickRandomIDsBetween(0, 10000, 100)
1507
+
1508
+ tests := []struct {
1509
+ concurrent bool
1510
+ amount int
1511
+ }{
1512
+ {concurrent: true, amount: 1},
1513
+ {concurrent: false, amount: 1},
1514
+ {concurrent: true, amount: 2},
1515
+ {concurrent: false, amount: 2},
1516
+ {concurrent: true, amount: 10},
1517
+ {concurrent: false, amount: 10},
1518
+ {concurrent: true, amount: 100},
1519
+ {concurrent: false, amount: 100},
1520
+ }
1521
+ b.ResetTimer()
1522
+
1523
+ for _, tt := range tests {
1524
+ b.Run(fmt.Sprintf("Concurrent: %v with amount: %v", tt.concurrent, tt.amount), func(t *testing.B) {
1525
+ for i := 0; i < b.N; i++ {
1526
+ if tt.concurrent {
1527
+ _, err := objectsByDocIDParallel(bucket, ids[:tt.amount], additional.Properties{}, nil, logger)
1528
+ require.Nil(t, err)
1529
+
1530
+ } else {
1531
+ _, err := objectsByDocIDSequential(bucket, ids[:tt.amount], additional.Properties{}, nil)
1532
+ require.Nil(t, err)
1533
+ }
1534
+ }
1535
+ })
1536
+ }
1537
+ }
1538
+
1539
+ func intsToBytes(ints ...uint64) []byte {
1540
+ byteOps := byteops.NewReadWriter(make([]byte, len(ints)*8))
1541
+ for _, i := range ints {
1542
+ byteOps.WriteUint64(i)
1543
+ }
1544
+ return byteOps.Buffer
1545
+ }
1546
+
1547
+ func FuzzObjectGet(f *testing.F) {
1548
+ maxSize := uint64(9999)
1549
+ logger, _ := test.NewNullLogger()
1550
+ bucket := genFakeBucket(f, maxSize)
1551
+
1552
+ readTests := []struct {
1553
+ ids []uint64
1554
+ }{
1555
+ {ids: []uint64{0}},
1556
+ {ids: []uint64{0, 1, 2, 3, 4, 5, 6, 7, 8, 9}},
1557
+ {ids: pickRandomIDsBetween(0, 1000, 100)},
1558
+ }
1559
+ for _, tc := range readTests {
1560
+ f.Add(intsToBytes(tc.ids...)) // Use f.Add to provide a seed corpus
1561
+ }
1562
+ f.Fuzz(func(t *testing.T, data []byte) {
1563
+ if len(data) == 0 || len(data)%8 != 0 {
1564
+ return
1565
+ }
1566
+ ids := make([]uint64, len(data)/8)
1567
+ for i := 0; i < len(ids); i++ {
1568
+ ids[i] = binary.LittleEndian.Uint64(data[i*8 : (i+1)*8])
1569
+ if ids[i] >= maxSize {
1570
+ return
1571
+ }
1572
+ }
1573
+
1574
+ res, err := ObjectsByDocID(bucket, ids, additional.Properties{}, nil, logger)
1575
+ require.Nil(t, err)
1576
+ require.Len(t, res, len(ids))
1577
+ for i, obj := range res {
1578
+ expectedDocID := ids[i]
1579
+ assert.Equal(t, expectedDocID, uint64(obj.Properties().(map[string]any)["i"].(float64)))
1580
+ expectedUUID := strfmt.UUID(fmt.Sprintf("73f2eb5f-5abf-447a-81ca-74b1dd1%05d", expectedDocID))
1581
+ assert.Equal(t, expectedUUID, obj.ID())
1582
+ }
1583
+ })
1584
+ }
1585
+
1586
+ type fakeBucket struct {
1587
+ objects map[uint64][]byte
1588
+ }
1589
+
1590
+ func (f *fakeBucket) GetBySecondary(_ int, _ []byte) ([]byte, error) {
1591
+ panic("not implemented")
1592
+ }
1593
+
1594
+ func (f *fakeBucket) GetBySecondaryWithBuffer(indexID int, docIDBytes []byte, lsmBuf []byte) ([]byte, []byte, error) {
1595
+ docID := binary.LittleEndian.Uint64(docIDBytes)
1596
+ objBytes, ok := f.objects[docID]
1597
+ if !ok {
1598
+ return nil, nil, nil
1599
+ }
1600
+ if len(lsmBuf) < len(objBytes) {
1601
+ lsmBuf = make([]byte, len(objBytes))
1602
+ }
1603
+
1604
+ copy(lsmBuf, objBytes)
1605
+ return lsmBuf[:len(objBytes)], lsmBuf, nil
1606
+ }
1607
+
1608
+ func genFakeBucket(t testing.TB, maxSize uint64) *fakeBucket {
1609
+ bucket := &fakeBucket{objects: map[uint64][]byte{}}
1610
+ for i := uint64(0); i < maxSize; i++ {
1611
+ obj := New(i)
1612
+ obj.SetProperties(map[string]any{"i": i, "foo": strings.Repeat("bar", int(i))})
1613
+ obj.SetClass("MyClass")
1614
+ obj.SetID(strfmt.UUID(fmt.Sprintf("73f2eb5f-5abf-447a-81ca-74b1dd1%05d", i)))
1615
+ objBytes, err := obj.MarshalBinary()
1616
+ require.Nil(t, err)
1617
+ bucket.objects[i] = objBytes
1618
+ }
1619
+
1620
+ return bucket
1621
+ }
1622
+
1623
+ func pickRandomIDsBetween(start, end uint64, count int) []uint64 {
1624
+ ids := make([]uint64, count)
1625
+ for i := 0; i < count; i++ {
1626
+ ids[i] = start + uint64(rand.Intn(int(end-start)))
1627
+ }
1628
+ return ids
1629
+ }
platform/dbops/binaries/weaviate-src/entities/sync/sync.go ADDED
@@ -0,0 +1,112 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // _ _
2
+ // __ _____ __ ___ ___ __ _| |_ ___
3
+ // \ \ /\ / / _ \/ _` \ \ / / |/ _` | __/ _ \
4
+ // \ V V / __/ (_| |\ V /| | (_| | || __/
5
+ // \_/\_/ \___|\__,_| \_/ |_|\__,_|\__\___|
6
+ //
7
+ // Copyright © 2016 - 2025 Weaviate B.V. All rights reserved.
8
+ //
9
+ // CONTACT: hello@weaviate.io
10
+ //
11
+
12
+ package sync
13
+
14
+ import (
15
+ "sync"
16
+ )
17
+
18
+ // KeyLocker it is a thread safe wrapper of sync.Map
19
+ // Usage: it's used in order to lock specific key in a map
20
+ // to synchronize concurrent access to a code block.
21
+ //
22
+ // locker.Lock(id)
23
+ // defer locker.Unlock(id)
24
+ type KeyLocker struct {
25
+ m sync.Map
26
+ }
27
+
28
+ // NewKeyLocker creates Keylocker
29
+ func NewKeyLocker() *KeyLocker {
30
+ return &KeyLocker{
31
+ m: sync.Map{},
32
+ }
33
+ }
34
+
35
+ // Lock it locks a specific bucket by it's ID
36
+ // to hold ant concurrent access to that specific item
37
+ //
38
+ // do not forget calling Unlock() after locking it.
39
+ func (s *KeyLocker) Lock(ID string) {
40
+ iLock := &sync.Mutex{}
41
+ iLocks, _ := s.m.LoadOrStore(ID, iLock)
42
+
43
+ iLock = iLocks.(*sync.Mutex)
44
+ iLock.Lock()
45
+ }
46
+
47
+ // Unlock it unlocks a specific item by it's ID
48
+ func (s *KeyLocker) Unlock(ID string) {
49
+ iLocks, _ := s.m.Load(ID)
50
+ iLock := iLocks.(*sync.Mutex)
51
+ iLock.Unlock()
52
+ }
53
+
54
+ // KeyRWLocker it is a thread safe wrapper of sync.Map
55
+ // Usage: it's used in order to lock/rlock specific key in a map
56
+ // to synchronize concurrent access to a code block.
57
+ //
58
+ // locker.Lock(id)
59
+ // defer locker.Unlock(id)
60
+ //
61
+ // or
62
+ //
63
+ // locker.RLock(id)
64
+ // defer locker.RUnlock(id)
65
+ type KeyRWLocker struct {
66
+ m sync.Map
67
+ }
68
+
69
+ // NewKeyLocker creates Keylocker
70
+ func NewKeyRWLocker() *KeyRWLocker {
71
+ return &KeyRWLocker{
72
+ m: sync.Map{},
73
+ }
74
+ }
75
+
76
+ // Lock it locks a specific bucket by it's ID
77
+ // to hold ant concurrent access to that specific item
78
+ //
79
+ // do not forget calling Unlock() after locking it.
80
+ func (s *KeyRWLocker) Lock(ID string) {
81
+ iLock := &sync.RWMutex{}
82
+ iLocks, _ := s.m.LoadOrStore(ID, iLock)
83
+
84
+ iLock = iLocks.(*sync.RWMutex)
85
+ iLock.Lock()
86
+ }
87
+
88
+ // Unlock it unlocks a specific item by it's ID
89
+ func (s *KeyRWLocker) Unlock(ID string) {
90
+ iLocks, _ := s.m.Load(ID)
91
+ iLock := iLocks.(*sync.RWMutex)
92
+ iLock.Unlock()
93
+ }
94
+
95
+ // RLock it rlocks a specific bucket by it's ID
96
+ // to hold ant concurrent access to that specific item
97
+ //
98
+ // do not forget calling RUnlock() after rlocking it.
99
+ func (s *KeyRWLocker) RLock(ID string) {
100
+ iLock := &sync.RWMutex{}
101
+ iLocks, _ := s.m.LoadOrStore(ID, iLock)
102
+
103
+ iLock = iLocks.(*sync.RWMutex)
104
+ iLock.RLock()
105
+ }
106
+
107
+ // RUnlock it runlocks a specific item by it's ID
108
+ func (s *KeyRWLocker) RUnlock(ID string) {
109
+ iLocks, _ := s.m.Load(ID)
110
+ iLock := iLocks.(*sync.RWMutex)
111
+ iLock.RUnlock()
112
+ }
platform/dbops/binaries/weaviate-src/entities/sync/sync_test.go ADDED
@@ -0,0 +1,116 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // _ _
2
+ // __ _____ __ ___ ___ __ _| |_ ___
3
+ // \ \ /\ / / _ \/ _` \ \ / / |/ _` | __/ _ \
4
+ // \ V V / __/ (_| |\ V /| | (_| | || __/
5
+ // \_/\_/ \___|\__,_| \_/ |_|\__,_|\__\___|
6
+ //
7
+ // Copyright © 2016 - 2025 Weaviate B.V. All rights reserved.
8
+ //
9
+ // CONTACT: hello@weaviate.io
10
+ //
11
+
12
+ package sync
13
+
14
+ import (
15
+ "sync"
16
+ "testing"
17
+
18
+ "github.com/stretchr/testify/require"
19
+ )
20
+
21
+ func mutexLocked(m *sync.Mutex) bool {
22
+ rlocked := m.TryLock()
23
+ if rlocked {
24
+ defer m.Unlock()
25
+ }
26
+ return !rlocked
27
+ }
28
+
29
+ func rwMutexLocked(m *sync.RWMutex) bool {
30
+ // can not RLock
31
+ rlocked := m.TryRLock()
32
+ if rlocked {
33
+ defer m.RUnlock()
34
+ }
35
+ return !rlocked
36
+ }
37
+
38
+ func rwMutexRLocked(m *sync.RWMutex) bool {
39
+ // can not Lock, but can RLock
40
+ locked := m.TryLock()
41
+ if locked {
42
+ defer m.Unlock()
43
+ return false
44
+ }
45
+ rlocked := m.TryRLock()
46
+ if rlocked {
47
+ defer m.RUnlock()
48
+ }
49
+ return rlocked
50
+ }
51
+
52
+ func TestKeyLockerLockUnlock(t *testing.T) {
53
+ r := require.New(t)
54
+ s := NewKeyLocker()
55
+
56
+ s.Lock("t1")
57
+ lock, _ := s.m.Load("t1")
58
+ r.True(mutexLocked(lock.(*sync.Mutex)))
59
+
60
+ s.Unlock("t1")
61
+ lock, _ = s.m.Load("t1")
62
+ r.False(mutexLocked(lock.(*sync.Mutex)))
63
+
64
+ s.Lock("t2")
65
+ lock, _ = s.m.Load("t2")
66
+ r.True(mutexLocked(lock.(*sync.Mutex)))
67
+
68
+ s.Unlock("t2")
69
+ lock, _ = s.m.Load("t2")
70
+ r.False(mutexLocked(lock.(*sync.Mutex)))
71
+ }
72
+
73
+ func TestKeyRWLockerLockUnlock(t *testing.T) {
74
+ r := require.New(t)
75
+ s := NewKeyRWLocker()
76
+
77
+ s.Lock("t1")
78
+ lock, _ := s.m.Load("t1")
79
+ r.True(rwMutexLocked(lock.(*sync.RWMutex)))
80
+ r.False(rwMutexRLocked(lock.(*sync.RWMutex)))
81
+
82
+ s.Unlock("t1")
83
+ lock, _ = s.m.Load("t1")
84
+ r.False(rwMutexLocked(lock.(*sync.RWMutex)))
85
+ r.False(rwMutexRLocked(lock.(*sync.RWMutex)))
86
+
87
+ s.Lock("t2")
88
+ lock, _ = s.m.Load("t2")
89
+ r.True(rwMutexLocked(lock.(*sync.RWMutex)))
90
+ r.False(rwMutexRLocked(lock.(*sync.RWMutex)))
91
+
92
+ s.Unlock("t2")
93
+ lock, _ = s.m.Load("t2")
94
+ r.False(rwMutexLocked(lock.(*sync.RWMutex)))
95
+ r.False(rwMutexRLocked(lock.(*sync.RWMutex)))
96
+
97
+ s.RLock("t1")
98
+ lock, _ = s.m.Load("t1")
99
+ r.False(rwMutexLocked(lock.(*sync.RWMutex)))
100
+ r.True(rwMutexRLocked(lock.(*sync.RWMutex)))
101
+
102
+ s.RUnlock("t1")
103
+ lock, _ = s.m.Load("t1")
104
+ r.False(rwMutexLocked(lock.(*sync.RWMutex)))
105
+ r.False(rwMutexRLocked(lock.(*sync.RWMutex)))
106
+
107
+ s.RLock("t2")
108
+ lock, _ = s.m.Load("t2")
109
+ r.False(rwMutexLocked(lock.(*sync.RWMutex)))
110
+ r.True(rwMutexRLocked(lock.(*sync.RWMutex)))
111
+
112
+ s.RUnlock("t2")
113
+ lock, _ = s.m.Load("t2")
114
+ r.False(rwMutexLocked(lock.(*sync.RWMutex)))
115
+ r.False(rwMutexRLocked(lock.(*sync.RWMutex)))
116
+ }
platform/dbops/binaries/weaviate-src/entities/tenantactivity/types.go ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // _ _
2
+ // __ _____ __ ___ ___ __ _| |_ ___
3
+ // \ \ /\ / / _ \/ _` \ \ / / |/ _` | __/ _ \
4
+ // \ V V / __/ (_| |\ V /| | (_| | || __/
5
+ // \_/\_/ \___|\__,_| \_/ |_|\__,_|\__\___|
6
+ //
7
+ // Copyright © 2016 - 2025 Weaviate B.V. All rights reserved.
8
+ //
9
+ // CONTACT: hello@weaviate.io
10
+ //
11
+
12
+ package tenantactivity
13
+
14
+ import "time"
15
+
16
+ type ByCollection map[string]ByTenant
17
+
18
+ type ByTenant map[string]time.Time
19
+
20
+ type UsageFilter int
21
+
22
+ const (
23
+ UsageFilterAll UsageFilter = iota
24
+ UsageFilterOnlyReads
25
+ UsageFilterOnlyWrites
26
+ )
platform/dbops/binaries/weaviate-src/entities/tokenizer/tokenizer.go ADDED
@@ -0,0 +1,452 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // _ _
2
+ // __ _____ __ ___ ___ __ _| |_ ___
3
+ // \ \ /\ / / _ \/ _` \ \ / / |/ _` | __/ _ \
4
+ // \ V V / __/ (_| |\ V /| | (_| | || __/
5
+ // \_/\_/ \___|\__,_| \_/ |_|\__,_|\__\___|
6
+ //
7
+ // Copyright © 2016 - 2025 Weaviate B.V. All rights reserved.
8
+ //
9
+ // CONTACT: hello@weaviate.io
10
+ //
11
+
12
+ package tokenizer
13
+
14
+ import (
15
+ "os"
16
+ "runtime"
17
+ "strconv"
18
+ "strings"
19
+ "sync"
20
+ "time"
21
+ "unicode"
22
+
23
+ entcfg "github.com/weaviate/weaviate/entities/config"
24
+
25
+ "github.com/go-ego/gse"
26
+ koDict "github.com/ikawaha/kagome-dict-ko"
27
+ "github.com/ikawaha/kagome-dict/ipa"
28
+ kagomeTokenizer "github.com/ikawaha/kagome/v2/tokenizer"
29
+ "github.com/weaviate/weaviate/entities/models"
30
+ "github.com/weaviate/weaviate/usecases/monitoring"
31
+ )
32
+
33
+ var (
34
+ gseTokenizer *gse.Segmenter // Japanese
35
+ gseTokenizerCh *gse.Segmenter // Chinese
36
+ gseLock = &sync.Mutex{} // Lock for gse
37
+ UseGse = false // Load Japanese dictionary and prepare tokenizer
38
+ UseGseCh = false // Load Chinese dictionary and prepare tokenizer
39
+ KagomeKrEnabled = false // Load Korean dictionary and prepare tokenizer
40
+ KagomeJaEnabled = false // Load Japanese dictionary and prepare tokenizer
41
+ // The Tokenizer Libraries can consume a lot of memory, so we limit the number of parallel tokenizers
42
+ ApacTokenizerThrottle = chan struct{}(nil) // Throttle for tokenizers
43
+ tokenizers KagomeTokenizers // Tokenizers for Korean and Japanese
44
+ kagomeInitLock sync.Mutex // Lock for kagome initialization
45
+ )
46
+
47
+ type KagomeTokenizers struct {
48
+ Korean *kagomeTokenizer.Tokenizer
49
+ Japanese *kagomeTokenizer.Tokenizer
50
+ }
51
+
52
+ // Optional tokenizers can be enabled with an environment variable like:
53
+ // 'ENABLE_TOKENIZER_XXX', e.g. 'ENABLE_TOKENIZER_GSE', 'ENABLE_TOKENIZER_KAGOME_KR', 'ENABLE_TOKENIZER_KAGOME_JA'
54
+ var Tokenizations []string = []string{
55
+ models.PropertyTokenizationWord,
56
+ models.PropertyTokenizationLowercase,
57
+ models.PropertyTokenizationWhitespace,
58
+ models.PropertyTokenizationField,
59
+ models.PropertyTokenizationTrigram,
60
+ }
61
+
62
+ func init() {
63
+ numParallel := runtime.GOMAXPROCS(0)
64
+ numParallelStr := os.Getenv("TOKENIZER_CONCURRENCY_COUNT")
65
+ if numParallelStr != "" {
66
+ x, err := strconv.Atoi(numParallelStr)
67
+ if err == nil {
68
+ numParallel = x
69
+ }
70
+ }
71
+ ApacTokenizerThrottle = make(chan struct{}, numParallel)
72
+ if entcfg.Enabled(os.Getenv("USE_GSE")) || entcfg.Enabled(os.Getenv("ENABLE_TOKENIZER_GSE")) {
73
+ UseGse = true
74
+ Tokenizations = append(Tokenizations, models.PropertyTokenizationGse)
75
+ init_gse()
76
+ }
77
+ if entcfg.Enabled(os.Getenv("ENABLE_TOKENIZER_GSE_CH")) {
78
+ Tokenizations = append(Tokenizations, models.PropertyTokenizationGseCh)
79
+ UseGseCh = true
80
+ init_gse_ch()
81
+ }
82
+ if entcfg.Enabled(os.Getenv("ENABLE_TOKENIZER_KAGOME_KR")) {
83
+ Tokenizations = append(Tokenizations, models.PropertyTokenizationKagomeKr)
84
+ }
85
+ if entcfg.Enabled(os.Getenv("ENABLE_TOKENIZER_KAGOME_JA")) {
86
+ Tokenizations = append(Tokenizations, models.PropertyTokenizationKagomeJa)
87
+ }
88
+ _ = initializeKagomeTokenizerKr()
89
+ _ = initializeKagomeTokenizerJa()
90
+ }
91
+
92
+ func init_gse() {
93
+ gseLock.Lock()
94
+ defer gseLock.Unlock()
95
+ if gseTokenizer == nil {
96
+ startTime := time.Now()
97
+ seg, err := gse.New("ja")
98
+ if err != nil {
99
+ return
100
+ }
101
+ gseTokenizer = &seg
102
+ monitoring.GetMetrics().TokenizerInitializeDuration.WithLabelValues("gse").Observe(time.Since(startTime).Seconds())
103
+ }
104
+ }
105
+
106
+ func init_gse_ch() {
107
+ gseLock.Lock()
108
+ defer gseLock.Unlock()
109
+ if gseTokenizerCh == nil {
110
+ startTime := time.Now()
111
+ seg, err := gse.New("zh")
112
+ if err != nil {
113
+ return
114
+ }
115
+ gseTokenizerCh = &seg
116
+ monitoring.GetMetrics().TokenizerInitializeDuration.WithLabelValues("gse").Observe(time.Since(startTime).Seconds())
117
+ }
118
+ }
119
+
120
+ func Tokenize(tokenization string, in string) []string {
121
+ switch tokenization {
122
+ case models.PropertyTokenizationWord:
123
+ return tokenizeWord(in)
124
+ case models.PropertyTokenizationLowercase:
125
+ return tokenizeLowercase(in)
126
+ case models.PropertyTokenizationWhitespace:
127
+ return tokenizeWhitespace(in)
128
+ case models.PropertyTokenizationField:
129
+ return tokenizeField(in)
130
+ case models.PropertyTokenizationTrigram:
131
+ return tokenizetrigram(in)
132
+ case models.PropertyTokenizationGse:
133
+ ApacTokenizerThrottle <- struct{}{}
134
+ defer func() { <-ApacTokenizerThrottle }()
135
+ return tokenizeGSE(in)
136
+ case models.PropertyTokenizationGseCh:
137
+ ApacTokenizerThrottle <- struct{}{}
138
+ defer func() { <-ApacTokenizerThrottle }()
139
+ return tokenizeGseCh(in)
140
+ case models.PropertyTokenizationKagomeKr:
141
+ ApacTokenizerThrottle <- struct{}{}
142
+ defer func() { <-ApacTokenizerThrottle }()
143
+ return tokenizeKagomeKr(in)
144
+ case models.PropertyTokenizationKagomeJa:
145
+ ApacTokenizerThrottle <- struct{}{}
146
+ defer func() { <-ApacTokenizerThrottle }()
147
+ return tokenizeKagomeJa(in)
148
+ default:
149
+ return []string{}
150
+ }
151
+ }
152
+
153
+ func TokenizeWithWildcards(tokenization string, in string) []string {
154
+ switch tokenization {
155
+ case models.PropertyTokenizationWord:
156
+ return tokenizeWordWithWildcards(in)
157
+ case models.PropertyTokenizationLowercase:
158
+ return tokenizeLowercase(in)
159
+ case models.PropertyTokenizationWhitespace:
160
+ return tokenizeWhitespace(in)
161
+ case models.PropertyTokenizationField:
162
+ return tokenizeField(in)
163
+ case models.PropertyTokenizationTrigram:
164
+ return tokenizetrigramWithWildcards(in)
165
+ case models.PropertyTokenizationGse:
166
+ ApacTokenizerThrottle <- struct{}{}
167
+ defer func() { <-ApacTokenizerThrottle }()
168
+ return tokenizeGSE(in)
169
+ case models.PropertyTokenizationGseCh:
170
+ ApacTokenizerThrottle <- struct{}{}
171
+ defer func() { <-ApacTokenizerThrottle }()
172
+ return tokenizeGseCh(in)
173
+ case models.PropertyTokenizationKagomeKr:
174
+ ApacTokenizerThrottle <- struct{}{}
175
+ defer func() { <-ApacTokenizerThrottle }()
176
+ return tokenizeKagomeKr(in)
177
+ case models.PropertyTokenizationKagomeJa:
178
+ ApacTokenizerThrottle <- struct{}{}
179
+ defer func() { <-ApacTokenizerThrottle }()
180
+ return tokenizeKagomeJa(in)
181
+ default:
182
+ return []string{}
183
+ }
184
+ }
185
+
186
+ func removeEmptyStrings(terms []string) []string {
187
+ for i := 0; i < len(terms); i++ {
188
+ if terms[i] == "" || terms[i] == " " {
189
+ terms = append(terms[:i], terms[i+1:]...)
190
+ i--
191
+ }
192
+ }
193
+ return terms
194
+ }
195
+
196
+ // tokenizeField trims white spaces
197
+ // (former DataTypeString/Field)
198
+ func tokenizeField(in string) []string {
199
+ startTime := time.Now()
200
+ ret := []string{strings.TrimFunc(in, unicode.IsSpace)}
201
+ monitoring.GetMetrics().TokenizerDuration.WithLabelValues("field").Observe(float64(time.Since(startTime).Seconds()))
202
+ monitoring.GetMetrics().TokenCount.WithLabelValues("field").Add(float64(len(ret)))
203
+ monitoring.GetMetrics().TokenCountPerRequest.WithLabelValues("field").Observe(float64(len(ret)))
204
+ return ret
205
+ }
206
+
207
+ // tokenizeWhitespace splits on white spaces, does not alter casing
208
+ // (former DataTypeString/Word)
209
+ func tokenizeWhitespace(in string) []string {
210
+ startTime := time.Now()
211
+ ret := strings.FieldsFunc(in, unicode.IsSpace)
212
+ monitoring.GetMetrics().TokenizerDuration.WithLabelValues("whitespace").Observe(float64(time.Since(startTime).Seconds()))
213
+ monitoring.GetMetrics().TokenCount.WithLabelValues("whitespace").Add(float64(len(ret)))
214
+ monitoring.GetMetrics().TokenCountPerRequest.WithLabelValues("whitespace").Observe(float64(len(ret)))
215
+ return ret
216
+ }
217
+
218
+ // tokenizeLowercase splits on white spaces and lowercases the words
219
+ func tokenizeLowercase(in string) []string {
220
+ startTime := time.Now()
221
+ terms := tokenizeWhitespace(in)
222
+ ret := lowercase(terms)
223
+ monitoring.GetMetrics().TokenizerDuration.WithLabelValues("lowercase").Observe(float64(time.Since(startTime).Seconds()))
224
+ return ret
225
+ }
226
+
227
+ // tokenizeWord splits on any non-alphanumerical and lowercases the words
228
+ // (former DataTypeText/Word)
229
+ func tokenizeWord(in string) []string {
230
+ startTime := time.Now()
231
+ terms := strings.FieldsFunc(in, func(r rune) bool {
232
+ return !unicode.IsLetter(r) && !unicode.IsNumber(r)
233
+ })
234
+ ret := lowercase(terms)
235
+ monitoring.GetMetrics().TokenizerDuration.WithLabelValues("word").Observe(float64(time.Since(startTime).Seconds()))
236
+ monitoring.GetMetrics().TokenCount.WithLabelValues("word").Add(float64(len(ret)))
237
+ monitoring.GetMetrics().TokenCountPerRequest.WithLabelValues("word").Observe(float64(len(ret)))
238
+ return ret
239
+ }
240
+
241
+ // tokenizetrigram splits on any non-alphanumerical and lowercases the words, joins them together, then groups them into trigrams
242
+ func tokenizetrigram(in string) []string {
243
+ startTime := time.Now()
244
+ // Strip whitespace and punctuation from the input string
245
+ inputString := strings.ToLower(strings.Join(strings.FieldsFunc(in, func(r rune) bool {
246
+ return !unicode.IsLetter(r) && !unicode.IsNumber(r)
247
+ }), ""))
248
+ runes := []rune(inputString)
249
+ var trirunes [][]rune
250
+ for i := 0; i < len(runes)-2; i++ {
251
+ trirunes = append(trirunes, runes[i:i+3])
252
+ }
253
+
254
+ var trigrams []string
255
+ for _, trirune := range trirunes {
256
+ trigrams = append(trigrams, string(trirune))
257
+ }
258
+ monitoring.GetMetrics().TokenizerDuration.WithLabelValues("trigram").Observe(float64(time.Since(startTime).Seconds()))
259
+ monitoring.GetMetrics().TokenCount.WithLabelValues("trigram").Add(float64(len(trigrams)))
260
+ monitoring.GetMetrics().TokenCountPerRequest.WithLabelValues("trigram").Observe(float64(len(trigrams)))
261
+ return trigrams
262
+ }
263
+
264
+ // tokenizeGSE uses the gse tokenizer to tokenise Japanese
265
+ func tokenizeGSE(in string) []string {
266
+ if !UseGse {
267
+ return []string{}
268
+ }
269
+ startTime := time.Now()
270
+ gseLock.Lock()
271
+ defer gseLock.Unlock()
272
+ terms := gseTokenizer.CutAll(in)
273
+
274
+ ret := removeEmptyStrings(terms)
275
+
276
+ monitoring.GetMetrics().TokenizerDuration.WithLabelValues("gse").Observe(float64(time.Since(startTime).Seconds()))
277
+ monitoring.GetMetrics().TokenCount.WithLabelValues("gse").Add(float64(len(ret)))
278
+ monitoring.GetMetrics().TokenCountPerRequest.WithLabelValues("gse").Observe(float64(len(ret)))
279
+ return ret
280
+ }
281
+
282
+ // tokenizeGSE uses the gse tokenizer to tokenise Chinese
283
+ func tokenizeGseCh(in string) []string {
284
+ if !UseGseCh {
285
+ return []string{}
286
+ }
287
+ gseLock.Lock()
288
+ defer gseLock.Unlock()
289
+ startTime := time.Now()
290
+ terms := gseTokenizerCh.CutAll(in)
291
+ ret := removeEmptyStrings(terms)
292
+
293
+ monitoring.GetMetrics().TokenizerDuration.WithLabelValues("gse").Observe(float64(time.Since(startTime).Seconds()))
294
+ monitoring.GetMetrics().TokenCount.WithLabelValues("gse").Add(float64(len(ret)))
295
+ monitoring.GetMetrics().TokenCountPerRequest.WithLabelValues("gse").Observe(float64(len(ret)))
296
+ return ret
297
+ }
298
+
299
+ func initializeKagomeTokenizerKr() error {
300
+ // Acquire lock to prevent initialization race
301
+ kagomeInitLock.Lock()
302
+ defer kagomeInitLock.Unlock()
303
+
304
+ if entcfg.Enabled(os.Getenv("ENABLE_TOKENIZER_KAGOME_KR")) {
305
+ if tokenizers.Korean != nil {
306
+ return nil
307
+ }
308
+ startTime := time.Now()
309
+
310
+ dictInstance := koDict.Dict()
311
+ tokenizer, err := kagomeTokenizer.New(dictInstance)
312
+ if err != nil {
313
+ return err
314
+ }
315
+
316
+ tokenizers.Korean = tokenizer
317
+ KagomeKrEnabled = true
318
+ monitoring.GetMetrics().TokenizerInitializeDuration.WithLabelValues("kagome_kr").Observe(float64(time.Since(startTime).Seconds()))
319
+ return nil
320
+ }
321
+
322
+ return nil
323
+ }
324
+
325
+ func tokenizeKagomeKr(in string) []string {
326
+ tokenizer := tokenizers.Korean
327
+ if tokenizer == nil || !KagomeKrEnabled {
328
+ return []string{}
329
+ }
330
+ startTime := time.Now()
331
+
332
+ kagomeTokens := tokenizer.Tokenize(in)
333
+ terms := make([]string, 0, len(kagomeTokens))
334
+
335
+ for _, token := range kagomeTokens {
336
+ if token.Surface != "EOS" && token.Surface != "BOS" {
337
+ terms = append(terms, token.Surface)
338
+ }
339
+ }
340
+
341
+ ret := removeEmptyStrings(terms)
342
+ monitoring.GetMetrics().TokenizerDuration.WithLabelValues("kagome_kr").Observe(float64(time.Since(startTime).Seconds()))
343
+ monitoring.GetMetrics().TokenCount.WithLabelValues("kagome_kr").Add(float64(len(ret)))
344
+ monitoring.GetMetrics().TokenCountPerRequest.WithLabelValues("kagome_kr").Observe(float64(len(ret)))
345
+ return ret
346
+ }
347
+
348
+ func initializeKagomeTokenizerJa() error {
349
+ // Acquire lock to prevent initialization race
350
+ kagomeInitLock.Lock()
351
+ defer kagomeInitLock.Unlock()
352
+
353
+ if entcfg.Enabled(os.Getenv("ENABLE_TOKENIZER_KAGOME_JA")) {
354
+ if tokenizers.Japanese != nil {
355
+ return nil
356
+ }
357
+ startTime := time.Now()
358
+ dictInstance := ipa.Dict()
359
+ tokenizer, err := kagomeTokenizer.New(dictInstance)
360
+ if err != nil {
361
+ return err
362
+ }
363
+
364
+ tokenizers.Japanese = tokenizer
365
+ KagomeJaEnabled = true
366
+ monitoring.GetMetrics().TokenizerInitializeDuration.WithLabelValues("kagome_ja").Observe(float64(time.Since(startTime).Seconds()))
367
+ return nil
368
+ }
369
+
370
+ return nil
371
+ }
372
+
373
+ func tokenizeKagomeJa(in string) []string {
374
+ tokenizer := tokenizers.Japanese
375
+ if tokenizer == nil || !KagomeJaEnabled {
376
+ return []string{}
377
+ }
378
+
379
+ startTime := time.Now()
380
+ kagomeTokens := tokenizer.Analyze(in, kagomeTokenizer.Search)
381
+ terms := make([]string, 0, len(kagomeTokens))
382
+
383
+ for _, token := range kagomeTokens {
384
+ if token.Surface != "EOS" && token.Surface != "BOS" {
385
+ terms = append(terms, strings.ToLower(token.Surface))
386
+ }
387
+ }
388
+
389
+ ret := removeEmptyStrings(terms)
390
+ monitoring.GetMetrics().TokenizerDuration.WithLabelValues("kagome_ja").Observe(float64(time.Since(startTime).Seconds()))
391
+ monitoring.GetMetrics().TokenCount.WithLabelValues("kagome_ja").Add(float64(len(ret)))
392
+ monitoring.GetMetrics().TokenCountPerRequest.WithLabelValues("kagome_ja").Observe(float64(len(ret)))
393
+ return ret
394
+ }
395
+
396
+ // tokenizeWordWithWildcards splits on any non-alphanumerical except wildcard-symbols and
397
+ // lowercases the words
398
+ func tokenizeWordWithWildcards(in string) []string {
399
+ startTime := time.Now()
400
+ terms := strings.FieldsFunc(in, func(r rune) bool {
401
+ return !unicode.IsLetter(r) && !unicode.IsNumber(r) && r != '?' && r != '*'
402
+ })
403
+ ret := lowercase(terms)
404
+ monitoring.GetMetrics().TokenizerDuration.WithLabelValues("word_with_wildcards").Observe(float64(time.Since(startTime).Seconds()))
405
+ monitoring.GetMetrics().TokenCount.WithLabelValues("word_with_wildcards").Add(float64(len(ret)))
406
+ monitoring.GetMetrics().TokenCountPerRequest.WithLabelValues("word_with_wildcards").Observe(float64(len(ret)))
407
+ return ret
408
+ }
409
+
410
+ // tokenizetrigramWithWildcards splits on any non-alphanumerical and lowercases the words, applies any wildcards, then joins them together, then groups them into trigrams
411
+ // this is unlikely to be useful, but is included for completeness
412
+ func tokenizetrigramWithWildcards(in string) []string {
413
+ startTime := time.Now()
414
+ terms := tokenizeWordWithWildcards(in)
415
+ inputString := strings.Join(terms, "")
416
+ var trigrams []string
417
+ for i := 0; i < len(inputString)-2; i++ {
418
+ trigrams = append(trigrams, inputString[i:i+3])
419
+ }
420
+ monitoring.GetMetrics().TokenizerDuration.WithLabelValues("trigram_with_wildcards").Observe(float64(time.Since(startTime).Seconds()))
421
+ monitoring.GetMetrics().TokenCount.WithLabelValues("trigram_with_wildcards").Add(float64(len(trigrams)))
422
+ monitoring.GetMetrics().TokenCountPerRequest.WithLabelValues("trigram_with_wildcards").Observe(float64(len(trigrams)))
423
+ return trigrams
424
+ }
425
+
426
+ func lowercase(terms []string) []string {
427
+ for i := range terms {
428
+ terms[i] = strings.ToLower(terms[i])
429
+ }
430
+ monitoring.GetMetrics().TokenCount.WithLabelValues("lowercase").Add(float64(len(terms)))
431
+ monitoring.GetMetrics().TokenCountPerRequest.WithLabelValues("lowercase").Observe(float64(len(terms)))
432
+ return terms
433
+ }
434
+
435
+ func TokenizeAndCountDuplicates(tokenization string, in string) ([]string, []int) {
436
+ counts := map[string]int{}
437
+ for _, term := range Tokenize(tokenization, in) {
438
+ counts[term]++
439
+ }
440
+
441
+ unique := make([]string, len(counts))
442
+ boosts := make([]int, len(counts))
443
+
444
+ i := 0
445
+ for term, boost := range counts {
446
+ unique[i] = term
447
+ boosts[i] = boost
448
+ i++
449
+ }
450
+
451
+ return unique, boosts
452
+ }
platform/dbops/binaries/weaviate-src/entities/tokenizer/tokenizer_test.go ADDED
@@ -0,0 +1,267 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // _ _
2
+ // __ _____ __ ___ ___ __ _| |_ ___
3
+ // \ \ /\ / / _ \/ _` \ \ / / |/ _` | __/ _ \
4
+ // \ V V / __/ (_| |\ V /| | (_| | || __/
5
+ // \_/\_/ \___|\__,_| \_/ |_|\__,_|\__\___|
6
+ //
7
+ // Copyright © 2016 - 2025 Weaviate B.V. All rights reserved.
8
+ //
9
+ // CONTACT: hello@weaviate.io
10
+ //
11
+
12
+ package tokenizer
13
+
14
+ import (
15
+ "testing"
16
+
17
+ "github.com/stretchr/testify/assert"
18
+ "github.com/weaviate/weaviate/entities/models"
19
+ )
20
+
21
+ func TestTokeniseParallel(t *testing.T) {
22
+ UseGse = true
23
+ init_gse()
24
+ UseGseCh = true
25
+ init_gse_ch()
26
+ // Kagome tokenizer for Korean
27
+ t.Setenv("ENABLE_TOKENIZER_KAGOME_KR", "true")
28
+ _ = initializeKagomeTokenizerKr()
29
+
30
+ // Kagome tokenizer for Japanese
31
+ t.Setenv("ENABLE_TOKENIZER_KAGOME_JA", "true")
32
+ _ = initializeKagomeTokenizerJa()
33
+ for i := 0; i < 1000; i++ {
34
+ go SingleTokenise(t)
35
+ }
36
+ }
37
+
38
+ func SingleTokenise(t *testing.T) {
39
+ tokens := Tokenize(models.PropertyTokenizationTrigram, "Thequickbrownfoxjumpsoverthelazydog")
40
+ assert.Equal(t, []string{"the", "heq", "equ", "qui", "uic", "ick", "ckb", "kbr", "bro", "row", "own", "wnf", "nfo", "fox", "oxj", "xju", "jum", "ump", "mps", "pso", "sov", "ove", "ver", "ert", "rth", "the", "hel", "ela", "laz", "azy", "zyd", "ydo", "dog"}, tokens)
41
+
42
+ tokens = Tokenize(models.PropertyTokenizationTrigram, "The quick brown fox jumps over the lazy dog")
43
+ assert.Equal(t, []string{"the", "heq", "equ", "qui", "uic", "ick", "ckb", "kbr", "bro", "row", "own", "wnf", "nfo", "fox", "oxj", "xju", "jum", "ump", "mps", "pso", "sov", "ove", "ver", "ert", "rth", "the", "hel", "ela", "laz", "azy", "zyd", "ydo", "dog"}, tokens)
44
+
45
+ tokens = Tokenize(models.PropertyTokenizationTrigram, "いろはにほへとちりぬるをわかよたれそつねならむうゐのおくやまけふこえてあさきゆめみしゑひもせす")
46
+ assert.Equal(t, []string{"いろは", "ろはに", "はにほ", "にほへ", "ほへと", "へとち", "とちり", "ちりぬ", "りぬる", "ぬるを", "るをわ", "をわか", "わかよ", "かよた", "よたれ", "たれそ", "れそつ", "そつね", "つねな", "ねなら", "ならむ", "らむう", "むうゐ", "うゐの", "ゐのお", "のおく", "おくや", "くやま", "やまけ", "まけふ", "けふこ", "ふこえ", "こえて", "えてあ", "てあさ", "あさき", "さきゆ", "きゆめ", "ゆめみ", "めみし", "みしゑ", "しゑひ", "ゑひも", "ひもせ", "もせす"}, tokens)
47
+
48
+ tokens = Tokenize(models.PropertyTokenizationTrigram, `春の夜の夢はうつつよりもかなしき
49
+ 夏の夜の夢はうつつに似たり
50
+ 秋の夜の夢はうつつを超え
51
+ 冬の夜の夢は心に響く
52
+
53
+ 山のあなたに小さな村が見える
54
+ 川の音が静かに耳に届く
55
+ 風が木々を通り抜ける音
56
+ 星空の下、すべてが平和である`)
57
+ assert.Equal(t, []string{"春の夜", "の夜の", "夜の夢", "の夢は", "夢はう", "はうつ", "うつつ", "つつよ", "つより", "よりも", "りもか", "もかな", "かなし", "なしき", "しき夏", "き夏の", "夏の夜", "の夜の", "夜の夢", "の夢は", "夢はう", "はうつ", "うつつ", "つつに", "つに似", "に似た", "似たり", "たり秋", "り秋の", "秋の夜", "の夜の", "夜の夢", "の夢は", "夢はう", "はうつ", "うつつ", "つつを", "つを超", "を超え", "超え冬", "え冬の", "冬の夜", "の夜の", "夜の夢", "の夢は", "夢は心", "は心に", "心に響", "に響く", "響く山", "く山の", "山のあ", "のあな", "あなた", "なたに", "たに小", "に小さ", "小さな", "さな村", "な村が", "村が見", "が見え", "見える", "える川", "る川の", "川の音", "の音が", "音が静", "が静か", "静かに", "かに耳", "に耳に", "耳に届", "に届く", "届く風", "く風が", "風が木", "が木々", "木々を", "々を通", "を通り", "通り抜", "り抜け", "抜ける", "ける音", "る音星", "音星空", "星空の", "空の下", "の下す", "下すべ", "すべて", "べてが", "てが平", "が平和", "平和で", "和であ", "である"}, tokens)
58
+
59
+ tokens = Tokenize(models.PropertyTokenizationGse, `春の夜の夢はうつつよりもかなしき
60
+ 夏の夜の夢はうつつに似たり
61
+ 秋の夜の夢はうつつを超え
62
+ 冬の夜の夢は心に響く
63
+
64
+ 山のあなたに小さな村が見える
65
+ 川の音が静かに耳に届く
66
+ 風が木々を通り抜ける音
67
+ 星空の下、すべてが平和である`)
68
+ assert.Equal(t, []string{"春の", "夜", "の", "夢", "はう", "うつ", "うつつ", "つつ", "つよ", "より", "も", "かな", "かなし", "かなしき", "なし", "しき", "\n", "\t", "夏", "の", "夜", "の", "夢", "はう", "うつ", "うつつ", "つつ", "に", "似", "たり", "\n", "\t", "秋", "の", "夜", "の", "夢", "はう", "うつ", "うつつ", "つつ", "を", "超え", "\n", "\t", "冬", "の", "夜", "の", "夢", "は", "心", "に", "響く", "\n", "\n", "\t", "山", "の", "あな", "あなた", "に", "小さ", "小さな", "村", "が", "見え", "見える", "える", "\n", "\t", "川", "の", "音", "が", "静か", "かに", "耳", "に", "届く", "\n", "\t", "風", "が", "木々", "を", "通り", "通り抜け", "通り抜ける", "抜け", "抜ける", "ける", "音", "\n", "\t", "星空", "の", "下", "、", "すべ", "すべて", "が", "平和", "で", "ある"}, tokens)
69
+
70
+ tokens = Tokenize(models.PropertyTokenizationGse, "素早い茶色の狐が怠けた犬を飛び越えた")
71
+ assert.Equal(t, []string{"素早", "素早い", "早い", "茶色", "の", "狐", "が", "怠け", "けた", "犬", "を", "飛び", "飛び越え", "越え", "た"}, tokens)
72
+
73
+ tokens = Tokenize(models.PropertyTokenizationGse, "すばやいちゃいろのきつねがなまけたいぬをとびこえた")
74
+ assert.Equal(t, []string{"すばや", "すばやい", "やい", "いち", "ちゃ", "ちゃい", "ちゃいろ", "いろ", "のき", "きつ", "きつね", "つね", "ねが", "がな", "なま", "なまけ", "まけ", "けた", "けたい", "たい", "いぬ", "を", "とび", "とびこえ", "こえ", "た"}, tokens)
75
+
76
+ tokens = Tokenize(models.PropertyTokenizationGse, "スバヤイチャイロノキツネガナマケタイヌヲトビコエタ")
77
+ assert.Equal(t, []string{"スバ", "ヤイ", "イチ", "チャイ", "チャイロ", "ノ", "キツ", "キツネ", "ツネ", "ネガ", "ナマ", "ケタ", "タイ", "イヌ", "ヲ", "トビ", "コ", "エ", "タ"}, tokens)
78
+
79
+ tokens = Tokenize(models.PropertyTokenizationGse, "The quick brown fox jumps over the lazy dog")
80
+ assert.Equal(t, []string{"t", "h", "e", "q", "u", "i", "c", "k", "b", "r", "o", "w", "n", "f", "o", "x", "j", "u", "m", "p", "s", "o", "v", "e", "r", "t", "h", "e", "l", "a", "z", "y", "d", "o", "g"}, tokens)
81
+
82
+ tokens = Tokenize(models.PropertyTokenizationGseCh, "施氏食狮史石室诗士施氏,嗜狮,誓食十狮。氏时时适市视狮。十时,适十狮适市。是时,适施氏适市。氏视是十狮,恃矢势,使是十狮逝世。氏拾是十狮尸,适石室。石室湿,氏使侍拭石室。石室拭,氏始试食是十狮尸。食时,始识是十狮尸,实十石狮尸。试释是事。")
83
+ assert.Equal(t, []string{"施", "氏", "食", "狮", "史", "石室", "诗", "士", "施", "氏", ",", "嗜", "狮", ",", "誓", "食", "十", "狮", "。", "氏", "时时", "适", "市", "视", "狮", "。", "十时", ",", "适", "十", "狮", "适", "市", "。", "是", "时", ",", "适", "施", "氏", "适", "市", "。", "氏", "视", "是", "十", "狮", ",", "恃", "矢", "势", ",", "使", "是", "十", "狮", "逝世", "。", "氏", "拾", "是", "十", "狮", "尸", ",", "适", "石室", "。", "石室", "湿", ",", "氏", "使", "侍", "拭", "石室", "。", "石室", "拭", ",", "氏", "始", "试", "食", "是", "十", "狮", "尸", "。", "食", "时", ",", "始", "识", "是", "十", "狮", "尸", ",", "实", "十", "石狮", "尸", "。", "试", "释", "是", "事", "。"}, tokens)
84
+
85
+ tokens = Tokenize(models.PropertyTokenizationKagomeKr, "아버지가방에들어가신다")
86
+ assert.Equal(t, []string{"아버지", "가", "방", "에", "들어가", "신다"}, tokens)
87
+
88
+ tokens = Tokenize(models.PropertyTokenizationKagomeKr, "아버지가 방에 들어가신다")
89
+ assert.Equal(t, []string{"아버지", "가", "방", "에", "들어가", "신다"}, tokens)
90
+
91
+ tokens = Tokenize(models.PropertyTokenizationKagomeKr, "결정하겠다")
92
+ assert.Equal(t, []string{"결정", "하", "겠", "다"}, tokens)
93
+
94
+ tokens = Tokenize(models.PropertyTokenizationKagomeKr, "한국어를처리하는예시입니다")
95
+ assert.Equal(t, []string{"한국어", "를", "처리", "하", "는", "예시", "입니다"}, tokens)
96
+
97
+ tokens = Tokenize(models.PropertyTokenizationKagomeKr, "한국어를 처리하는 예시입니다")
98
+ assert.Equal(t, []string{"한국어", "를", "처리", "하", "는", "예시", "입니다"}, tokens)
99
+
100
+ tokens = Tokenize(models.PropertyTokenizationKagomeJa, `春の夜の夢はうつつよりもかなしき
101
+ 夏の夜の夢はうつつに似たり
102
+ 秋の夜の夢はうつつを超え
103
+ 冬の夜の夢は心に響く
104
+
105
+ 山のあなたに小さな村が見える
106
+ 川の音が静かに耳に届く
107
+ 風が木々を通り抜ける音
108
+ 星空の下、すべてが平和である`)
109
+ assert.Equal(t, []string{"春", "の", "夜", "の", "夢", "は", "うつつ", "より", "も", "かなしき", "\n\t", "夏", "の", "夜", "の", "夢", "は", "うつつ", "に", "似", "たり", "\n\t", "秋", "の", "夜", "の", "夢", "は", "うつつ", "を", "超え", "\n\t", "冬", "の", "夜", "の", "夢", "は", "心", "に", "響く", "\n\n\t", "山", "の", "あなた", "に", "小さな", "村", "が", "見える", "\n\t", "川", "の", "音", "が", "静か", "に", "耳", "に", "届く", "\n\t", "風", "が", "木々", "を", "通り抜ける", "音", "\n\t", "星空", "の", "下", "、", "すべて", "が", "平和", "で", "ある"}, tokens)
110
+
111
+ tokens = Tokenize(models.PropertyTokenizationKagomeJa, "素早い茶色の狐が怠けた犬を飛び越えた")
112
+ assert.Equal(t, []string{"素早い", "茶色", "の", "狐", "が", "怠け", "た", "犬", "を", "飛び越え", "た"}, tokens)
113
+
114
+ tokens = Tokenize(models.PropertyTokenizationKagomeJa, "すばやいちゃいろのきつねがなまけたいぬをとびこえた")
115
+ assert.Equal(t, []string{"すばやい", "ちゃ", "いろ", "の", "きつね", "が", "なまけ", "た", "いぬ", "を", "とびこえ", "た"}, tokens)
116
+
117
+ tokens = Tokenize(models.PropertyTokenizationKagomeJa, "スバヤイチャイロノキツネガナマケタイヌヲトビコエタ")
118
+ assert.Equal(t, []string{"スバ", "ヤイ", "チャイ", "ロノキツネガナマケタイヌヲトビコエタ"}, tokens)
119
+
120
+ tokens = Tokenize(models.PropertyTokenizationKagomeJa, "The quick brown fox jumps over the lazy dog")
121
+ assert.Equal(t, []string{"the", "quick", "brown", "fox", "jumps", "over", "the", "lazy", "dog"}, tokens)
122
+ }
123
+
124
+ func TestTokenize(t *testing.T) {
125
+ input := " Hello You*-beautiful_world?!"
126
+
127
+ type testCase struct {
128
+ tokenization string
129
+ expected []string
130
+ }
131
+
132
+ t.Run("tokenize", func(t *testing.T) {
133
+ testCases := []testCase{
134
+ {
135
+ tokenization: models.PropertyTokenizationField,
136
+ expected: []string{"Hello You*-beautiful_world?!"},
137
+ },
138
+ {
139
+ tokenization: models.PropertyTokenizationWhitespace,
140
+ expected: []string{"Hello", "You*-beautiful_world?!"},
141
+ },
142
+ {
143
+ tokenization: models.PropertyTokenizationLowercase,
144
+ expected: []string{"hello", "you*-beautiful_world?!"},
145
+ },
146
+ {
147
+ tokenization: models.PropertyTokenizationWord,
148
+ expected: []string{"hello", "you", "beautiful", "world"},
149
+ },
150
+ }
151
+
152
+ for _, tc := range testCases {
153
+ terms := Tokenize(tc.tokenization, input)
154
+ assert.ElementsMatch(t, tc.expected, terms)
155
+ }
156
+ })
157
+
158
+ t.Run("tokenize with wildcards", func(t *testing.T) {
159
+ testCases := []testCase{
160
+ {
161
+ tokenization: models.PropertyTokenizationField,
162
+ expected: []string{"Hello You*-beautiful_world?!"},
163
+ },
164
+ {
165
+ tokenization: models.PropertyTokenizationWhitespace,
166
+ expected: []string{"Hello", "You*-beautiful_world?!"},
167
+ },
168
+ {
169
+ tokenization: models.PropertyTokenizationLowercase,
170
+ expected: []string{"hello", "you*-beautiful_world?!"},
171
+ },
172
+ {
173
+ tokenization: models.PropertyTokenizationWord,
174
+ expected: []string{"hello", "you*", "beautiful", "world?"},
175
+ },
176
+ }
177
+
178
+ for _, tc := range testCases {
179
+ terms := TokenizeWithWildcards(tc.tokenization, input)
180
+ assert.ElementsMatch(t, tc.expected, terms)
181
+ }
182
+ })
183
+ }
184
+
185
+ func TestTokenizeAndCountDuplicates(t *testing.T) {
186
+ type testCase struct {
187
+ input string
188
+ tokenization string
189
+ expected map[string]int
190
+ }
191
+
192
+ t.Setenv("ENABLE_TOKENIZER_KAGOME_KR", "true")
193
+ _ = initializeKagomeTokenizerKr()
194
+
195
+ alphaInput := "Hello You Beautiful World! hello you beautiful world!"
196
+
197
+ testCases := []testCase{
198
+ {
199
+ input: alphaInput,
200
+ tokenization: models.PropertyTokenizationField,
201
+ expected: map[string]int{
202
+ "Hello You Beautiful World! hello you beautiful world!": 1,
203
+ },
204
+ },
205
+ {
206
+ input: alphaInput,
207
+ tokenization: models.PropertyTokenizationWhitespace,
208
+ expected: map[string]int{
209
+ "Hello": 1,
210
+ "You": 1,
211
+ "Beautiful": 1,
212
+ "World!": 1,
213
+ "hello": 1,
214
+ "you": 1,
215
+ "beautiful": 1,
216
+ "world!": 1,
217
+ },
218
+ },
219
+ {
220
+ input: alphaInput,
221
+ tokenization: models.PropertyTokenizationLowercase,
222
+ expected: map[string]int{
223
+ "hello": 2,
224
+ "you": 2,
225
+ "beautiful": 2,
226
+ "world!": 2,
227
+ },
228
+ },
229
+ {
230
+ input: alphaInput,
231
+ tokenization: models.PropertyTokenizationWord,
232
+ expected: map[string]int{
233
+ "hello": 2,
234
+ "you": 2,
235
+ "beautiful": 2,
236
+ "world": 2,
237
+ },
238
+ },
239
+ {
240
+ input: "한국어를 처리하는 예시입니다 한국어를 처리하는 예시입니다",
241
+ tokenization: models.PropertyTokenizationKagomeKr,
242
+ expected: map[string]int{
243
+ "한국어": 2,
244
+ "를": 2,
245
+ "처리": 2,
246
+ "하": 2,
247
+ "는": 2,
248
+ "예시": 2,
249
+ "입니다": 2,
250
+ },
251
+ },
252
+ }
253
+
254
+ for _, tc := range testCases {
255
+ t.Run(tc.tokenization, func(t *testing.T) {
256
+ terms, dups := TokenizeAndCountDuplicates(tc.tokenization, tc.input)
257
+
258
+ assert.Len(t, terms, len(tc.expected))
259
+ assert.Len(t, dups, len(tc.expected))
260
+
261
+ for i := range terms {
262
+ assert.Contains(t, tc.expected, terms[i])
263
+ assert.Equal(t, tc.expected[terms[i]], dups[i])
264
+ }
265
+ })
266
+ }
267
+ }
platform/dbops/binaries/weaviate-src/entities/vectorindex/common/config.go ADDED
@@ -0,0 +1,110 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // _ _
2
+ // __ _____ __ ___ ___ __ _| |_ ___
3
+ // \ \ /\ / / _ \/ _` \ \ / / |/ _` | __/ _ \
4
+ // \ V V / __/ (_| |\ V /| | (_| | || __/
5
+ // \_/\_/ \___|\__,_| \_/ |_|\__,_|\__\___|
6
+ //
7
+ // Copyright © 2016 - 2025 Weaviate B.V. All rights reserved.
8
+ //
9
+ // CONTACT: hello@weaviate.io
10
+ //
11
+
12
+ package common
13
+
14
+ import (
15
+ "encoding/json"
16
+ "math"
17
+ "strconv"
18
+
19
+ "github.com/pkg/errors"
20
+ )
21
+
22
+ const (
23
+ DistanceCosine = "cosine"
24
+ DistanceDot = "dot"
25
+ DistanceL2Squared = "l2-squared"
26
+ DistanceManhattan = "manhattan"
27
+ DistanceHamming = "hamming"
28
+
29
+ // Set these defaults if the user leaves them blank
30
+ DefaultVectorCacheMaxObjects = 1e12
31
+ DefaultDistanceMetric = DistanceCosine
32
+ )
33
+
34
+ const (
35
+ CompressionBQ = "bq"
36
+ CompressionPQ = "pq"
37
+ CompressionSQ = "sq"
38
+ CompressionRQ = "rq"
39
+ NoCompression = "none"
40
+ )
41
+
42
+ // Tries to parse the int value from the map, if it overflows math.MaxInt64, it
43
+ // uses math.MaxInt64 instead. This is to protect from rounding errors from
44
+ // json marshalling where the type may be assumed as float64
45
+ func OptionalIntFromMap(in map[string]interface{}, name string,
46
+ setFn func(v int),
47
+ ) error {
48
+ value, ok := in[name]
49
+ if !ok {
50
+ return nil
51
+ }
52
+
53
+ var asInt64 int64
54
+ var err error
55
+
56
+ // depending on whether we get the results from disk or from the REST API,
57
+ // numbers may be represented slightly differently
58
+ switch typed := value.(type) {
59
+ case json.Number:
60
+ asInt64, err = typed.Int64()
61
+ case float64:
62
+ asInt64 = int64(typed)
63
+ }
64
+ if err != nil {
65
+ // try to recover from error
66
+ if errors.Is(err, strconv.ErrRange) {
67
+ setFn(int(math.MaxInt64))
68
+ return nil
69
+ }
70
+
71
+ return errors.Wrapf(err, "json.Number to int64 for %q", name)
72
+ }
73
+
74
+ setFn(int(asInt64))
75
+ return nil
76
+ }
77
+
78
+ func OptionalBoolFromMap(in map[string]interface{}, name string,
79
+ setFn func(v bool),
80
+ ) error {
81
+ value, ok := in[name]
82
+ if !ok {
83
+ return nil
84
+ }
85
+
86
+ asBool, ok := value.(bool)
87
+ if !ok {
88
+ return nil
89
+ }
90
+
91
+ setFn(asBool)
92
+ return nil
93
+ }
94
+
95
+ func OptionalStringFromMap(in map[string]interface{}, name string,
96
+ setFn func(v string),
97
+ ) error {
98
+ value, ok := in[name]
99
+ if !ok {
100
+ return nil
101
+ }
102
+
103
+ asString, ok := value.(string)
104
+ if !ok {
105
+ return nil
106
+ }
107
+
108
+ setFn(asString)
109
+ return nil
110
+ }
platform/dbops/binaries/weaviate-src/entities/vectorindex/config.go ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // _ _
2
+ // __ _____ __ ___ ___ __ _| |_ ___
3
+ // \ \ /\ / / _ \/ _` \ \ / / |/ _` | __/ _ \
4
+ // \ V V / __/ (_| |\ V /| | (_| | || __/
5
+ // \_/\_/ \___|\__,_| \_/ |_|\__,_|\__\___|
6
+ //
7
+ // Copyright © 2016 - 2025 Weaviate B.V. All rights reserved.
8
+ //
9
+ // CONTACT: hello@weaviate.io
10
+ //
11
+
12
+ package vectorindex
13
+
14
+ import (
15
+ "fmt"
16
+
17
+ schemaConfig "github.com/weaviate/weaviate/entities/schema/config"
18
+ "github.com/weaviate/weaviate/entities/vectorindex/dynamic"
19
+ "github.com/weaviate/weaviate/entities/vectorindex/flat"
20
+ "github.com/weaviate/weaviate/entities/vectorindex/hnsw"
21
+ )
22
+
23
+ const (
24
+ DefaultVectorIndexType = VectorIndexTypeHNSW
25
+ VectorIndexTypeHNSW = "hnsw"
26
+ VectorIndexTypeFLAT = "flat"
27
+ VectorIndexTypeDYNAMIC = "dynamic"
28
+ )
29
+
30
+ // ParseAndValidateConfig from an unknown input value, as this is not further
31
+ // specified in the API to allow of exchanging the index type
32
+ func ParseAndValidateConfig(input interface{}, vectorIndexType string, isMultiVector bool) (schemaConfig.VectorIndexConfig, error) {
33
+ if len(vectorIndexType) == 0 {
34
+ vectorIndexType = DefaultVectorIndexType
35
+ }
36
+
37
+ switch vectorIndexType {
38
+ case VectorIndexTypeHNSW:
39
+ return hnsw.ParseAndValidateConfig(input, isMultiVector)
40
+ case VectorIndexTypeFLAT:
41
+ return flat.ParseAndValidateConfig(input)
42
+ case VectorIndexTypeDYNAMIC:
43
+ return dynamic.ParseAndValidateConfig(input, isMultiVector)
44
+ default:
45
+ return nil, fmt.Errorf("invalid vector index %q. Supported types are hnsw and flat", vectorIndexType)
46
+ }
47
+ }
platform/dbops/binaries/weaviate-src/entities/vectorindex/dynamic/config.go ADDED
@@ -0,0 +1,124 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // _ _
2
+ // __ _____ __ ___ ___ __ _| |_ ___
3
+ // \ \ /\ / / _ \/ _` \ \ / / |/ _` | __/ _ \
4
+ // \ V V / __/ (_| |\ V /| | (_| | || __/
5
+ // \_/\_/ \___|\__,_| \_/ |_|\__,_|\__\___|
6
+ //
7
+ // Copyright © 2016 - 2025 Weaviate B.V. All rights reserved.
8
+ //
9
+ // CONTACT: hello@weaviate.io
10
+ //
11
+
12
+ package dynamic
13
+
14
+ import (
15
+ "fmt"
16
+
17
+ schemaConfig "github.com/weaviate/weaviate/entities/schema/config"
18
+ "github.com/weaviate/weaviate/entities/vectorindex/common"
19
+ "github.com/weaviate/weaviate/entities/vectorindex/flat"
20
+ "github.com/weaviate/weaviate/entities/vectorindex/hnsw"
21
+ )
22
+
23
+ const (
24
+ DefaultThreshold = 10_000
25
+ )
26
+
27
+ type UserConfig struct {
28
+ Distance string `json:"distance"`
29
+ Threshold uint64 `json:"threshold"`
30
+ HnswUC hnsw.UserConfig `json:"hnsw"`
31
+ FlatUC flat.UserConfig `json:"flat"`
32
+ }
33
+
34
+ // IndexType returns the type of the underlying vector index, thus making sure
35
+ // the schema.VectorIndexConfig interface is implemented
36
+ func (u UserConfig) IndexType() string {
37
+ return "dynamic"
38
+ }
39
+
40
+ func (u UserConfig) DistanceName() string {
41
+ return u.Distance
42
+ }
43
+
44
+ func (u UserConfig) IsMultiVector() bool {
45
+ return false
46
+ }
47
+
48
+ // SetDefaults in the user-specifyable part of the config
49
+ func (u *UserConfig) SetDefaults() {
50
+ u.Threshold = DefaultThreshold
51
+ u.Distance = common.DefaultDistanceMetric
52
+ u.HnswUC = hnsw.NewDefaultUserConfig()
53
+ u.FlatUC = flat.NewDefaultUserConfig()
54
+ }
55
+
56
+ func NewDefaultUserConfig() UserConfig {
57
+ uc := UserConfig{}
58
+ uc.SetDefaults()
59
+ return uc
60
+ }
61
+
62
+ // ParseAndValidateConfig from an unknown input value, as this is not further
63
+ // specified in the API to allow of exchanging the index type
64
+ func ParseAndValidateConfig(input interface{}, isMultiVector bool) (schemaConfig.VectorIndexConfig, error) {
65
+ uc := UserConfig{}
66
+ uc.SetDefaults()
67
+
68
+ if input == nil {
69
+ return uc, nil
70
+ }
71
+
72
+ asMap, ok := input.(map[string]interface{})
73
+ if !ok || asMap == nil {
74
+ return uc, fmt.Errorf("input must be a non-nil map")
75
+ }
76
+
77
+ if err := common.OptionalStringFromMap(asMap, "distance", func(v string) {
78
+ uc.Distance = v
79
+ }); err != nil {
80
+ return uc, err
81
+ }
82
+
83
+ if err := common.OptionalIntFromMap(asMap, "threshold", func(v int) {
84
+ uc.Threshold = uint64(v)
85
+ }); err != nil {
86
+ return uc, err
87
+ }
88
+
89
+ hnswConfig, ok := asMap["hnsw"]
90
+ if ok && hnswConfig != nil {
91
+ hnswUC, err := hnsw.ParseAndValidateConfig(hnswConfig, isMultiVector)
92
+ if err != nil {
93
+ return uc, err
94
+ }
95
+
96
+ castedHnswUC, ok := hnswUC.(hnsw.UserConfig)
97
+ if !ok {
98
+ return uc, fmt.Errorf("invalid hnsw configuration")
99
+ }
100
+ uc.HnswUC = castedHnswUC
101
+ if uc.HnswUC.Multivector.Enabled {
102
+ return uc, fmt.Errorf("multi vector index is not supported for dynamic index")
103
+ }
104
+
105
+ }
106
+
107
+ flatConfig, ok := asMap["flat"]
108
+ if !ok || flatConfig == nil {
109
+ return uc, nil
110
+ }
111
+
112
+ flatUC, err := flat.ParseAndValidateConfig(flatConfig)
113
+ if err != nil {
114
+ return uc, err
115
+ }
116
+
117
+ castedFlatUC, ok := flatUC.(flat.UserConfig)
118
+ if !ok {
119
+ return uc, fmt.Errorf("invalid flat configuration")
120
+ }
121
+ uc.FlatUC = castedFlatUC
122
+
123
+ return uc, nil
124
+ }
platform/dbops/binaries/weaviate-src/entities/vectorindex/dynamic/config_test.go ADDED
@@ -0,0 +1,395 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // _ _
2
+ // __ _____ __ ___ ___ __ _| |_ ___
3
+ // \ \ /\ / / _ \/ _` \ \ / / |/ _` | __/ _ \
4
+ // \ V V / __/ (_| |\ V /| | (_| | || __/
5
+ // \_/\_/ \___|\__,_| \_/ |_|\__,_|\__\___|
6
+ //
7
+ // Copyright © 2016 - 2025 Weaviate B.V. All rights reserved.
8
+ //
9
+ // CONTACT: hello@weaviate.io
10
+ //
11
+
12
+ package dynamic
13
+
14
+ import (
15
+ "testing"
16
+
17
+ "github.com/stretchr/testify/assert"
18
+ "github.com/stretchr/testify/require"
19
+ "github.com/weaviate/weaviate/entities/vectorindex/common"
20
+ "github.com/weaviate/weaviate/entities/vectorindex/flat"
21
+ "github.com/weaviate/weaviate/entities/vectorindex/hnsw"
22
+ )
23
+
24
+ func Test_DynamicUserConfig(t *testing.T) {
25
+ type test struct {
26
+ name string
27
+ input interface{}
28
+ expected UserConfig
29
+ expectErr bool
30
+ expectErrMsg string
31
+ }
32
+
33
+ tests := []test{
34
+ {
35
+ name: "nothing specified, all defaults",
36
+ input: nil,
37
+ expected: UserConfig{
38
+ Distance: common.DefaultDistanceMetric,
39
+ Threshold: DefaultThreshold,
40
+ HnswUC: hnsw.UserConfig{
41
+ CleanupIntervalSeconds: hnsw.DefaultCleanupIntervalSeconds,
42
+ MaxConnections: hnsw.DefaultMaxConnections,
43
+ EFConstruction: hnsw.DefaultEFConstruction,
44
+ VectorCacheMaxObjects: common.DefaultVectorCacheMaxObjects,
45
+ EF: hnsw.DefaultEF,
46
+ Skip: hnsw.DefaultSkip,
47
+ FlatSearchCutoff: hnsw.DefaultFlatSearchCutoff,
48
+ DynamicEFMin: hnsw.DefaultDynamicEFMin,
49
+ DynamicEFMax: hnsw.DefaultDynamicEFMax,
50
+ DynamicEFFactor: hnsw.DefaultDynamicEFFactor,
51
+ Distance: common.DefaultDistanceMetric,
52
+ PQ: hnsw.PQConfig{
53
+ Enabled: hnsw.DefaultPQEnabled,
54
+ Segments: hnsw.DefaultPQSegments,
55
+ Centroids: hnsw.DefaultPQCentroids,
56
+ TrainingLimit: hnsw.DefaultPQTrainingLimit,
57
+ Encoder: hnsw.PQEncoder{
58
+ Type: hnsw.DefaultPQEncoderType,
59
+ Distribution: hnsw.DefaultPQEncoderDistribution,
60
+ },
61
+ },
62
+ SQ: hnsw.SQConfig{
63
+ Enabled: hnsw.DefaultSQEnabled,
64
+ TrainingLimit: hnsw.DefaultSQTrainingLimit,
65
+ RescoreLimit: hnsw.DefaultSQRescoreLimit,
66
+ },
67
+ RQ: hnsw.RQConfig{
68
+ Enabled: hnsw.DefaultRQEnabled,
69
+ Bits: hnsw.DefaultRQBits,
70
+ RescoreLimit: hnsw.DefaultRQRescoreLimit,
71
+ },
72
+ FilterStrategy: hnsw.DefaultFilterStrategy,
73
+ Multivector: hnsw.MultivectorConfig{
74
+ Enabled: hnsw.DefaultMultivectorEnabled,
75
+ Aggregation: hnsw.DefaultMultivectorAggregation,
76
+ MuveraConfig: hnsw.MuveraConfig{
77
+ Enabled: hnsw.DefaultMultivectorMuveraEnabled,
78
+ KSim: hnsw.DefaultMultivectorKSim,
79
+ DProjections: hnsw.DefaultMultivectorDProjections,
80
+ Repetitions: hnsw.DefaultMultivectorRepetitions,
81
+ },
82
+ },
83
+ },
84
+ FlatUC: flat.UserConfig{
85
+ VectorCacheMaxObjects: common.DefaultVectorCacheMaxObjects,
86
+ Distance: common.DefaultDistanceMetric,
87
+ PQ: flat.CompressionUserConfig{
88
+ Enabled: flat.DefaultCompressionEnabled,
89
+ RescoreLimit: flat.DefaultCompressionRescore,
90
+ Cache: flat.DefaultVectorCache,
91
+ },
92
+ BQ: flat.CompressionUserConfig{
93
+ Enabled: flat.DefaultCompressionEnabled,
94
+ RescoreLimit: flat.DefaultCompressionRescore,
95
+ Cache: flat.DefaultVectorCache,
96
+ },
97
+ SQ: flat.CompressionUserConfig{
98
+ Enabled: flat.DefaultCompressionEnabled,
99
+ RescoreLimit: flat.DefaultCompressionRescore,
100
+ Cache: flat.DefaultVectorCache,
101
+ },
102
+ },
103
+ },
104
+ },
105
+ {
106
+ name: "threshold is properly set",
107
+ input: map[string]interface{}{
108
+ "threshold": float64(100),
109
+ },
110
+ expected: UserConfig{
111
+ Distance: common.DefaultDistanceMetric,
112
+ Threshold: 100,
113
+ HnswUC: hnsw.UserConfig{
114
+ CleanupIntervalSeconds: hnsw.DefaultCleanupIntervalSeconds,
115
+ MaxConnections: hnsw.DefaultMaxConnections,
116
+ EFConstruction: hnsw.DefaultEFConstruction,
117
+ VectorCacheMaxObjects: common.DefaultVectorCacheMaxObjects,
118
+ EF: hnsw.DefaultEF,
119
+ Skip: hnsw.DefaultSkip,
120
+ FlatSearchCutoff: hnsw.DefaultFlatSearchCutoff,
121
+ DynamicEFMin: hnsw.DefaultDynamicEFMin,
122
+ DynamicEFMax: hnsw.DefaultDynamicEFMax,
123
+ DynamicEFFactor: hnsw.DefaultDynamicEFFactor,
124
+ Distance: common.DefaultDistanceMetric,
125
+ PQ: hnsw.PQConfig{
126
+ Enabled: hnsw.DefaultPQEnabled,
127
+ Segments: hnsw.DefaultPQSegments,
128
+ Centroids: hnsw.DefaultPQCentroids,
129
+ TrainingLimit: hnsw.DefaultPQTrainingLimit,
130
+ Encoder: hnsw.PQEncoder{
131
+ Type: hnsw.DefaultPQEncoderType,
132
+ Distribution: hnsw.DefaultPQEncoderDistribution,
133
+ },
134
+ },
135
+ SQ: hnsw.SQConfig{
136
+ Enabled: hnsw.DefaultSQEnabled,
137
+ TrainingLimit: hnsw.DefaultSQTrainingLimit,
138
+ RescoreLimit: hnsw.DefaultSQRescoreLimit,
139
+ },
140
+ RQ: hnsw.RQConfig{
141
+ Enabled: hnsw.DefaultRQEnabled,
142
+ Bits: hnsw.DefaultRQBits,
143
+ RescoreLimit: hnsw.DefaultRQRescoreLimit,
144
+ },
145
+ FilterStrategy: hnsw.DefaultFilterStrategy,
146
+ Multivector: hnsw.MultivectorConfig{
147
+ Enabled: hnsw.DefaultMultivectorEnabled,
148
+ Aggregation: hnsw.DefaultMultivectorAggregation,
149
+ MuveraConfig: hnsw.MuveraConfig{
150
+ Enabled: hnsw.DefaultMultivectorMuveraEnabled,
151
+ KSim: hnsw.DefaultMultivectorKSim,
152
+ DProjections: hnsw.DefaultMultivectorDProjections,
153
+ Repetitions: hnsw.DefaultMultivectorRepetitions,
154
+ },
155
+ },
156
+ },
157
+ FlatUC: flat.UserConfig{
158
+ VectorCacheMaxObjects: common.DefaultVectorCacheMaxObjects,
159
+ Distance: common.DefaultDistanceMetric,
160
+ PQ: flat.CompressionUserConfig{
161
+ Enabled: flat.DefaultCompressionEnabled,
162
+ RescoreLimit: flat.DefaultCompressionRescore,
163
+ Cache: flat.DefaultVectorCache,
164
+ },
165
+ BQ: flat.CompressionUserConfig{
166
+ Enabled: flat.DefaultCompressionEnabled,
167
+ RescoreLimit: flat.DefaultCompressionRescore,
168
+ Cache: flat.DefaultVectorCache,
169
+ },
170
+ SQ: flat.CompressionUserConfig{
171
+ Enabled: flat.DefaultCompressionEnabled,
172
+ RescoreLimit: flat.DefaultCompressionRescore,
173
+ Cache: flat.DefaultVectorCache,
174
+ },
175
+ },
176
+ },
177
+ },
178
+ {
179
+ name: "hnsw is properly set",
180
+ input: map[string]interface{}{
181
+ "hnsw": map[string]interface{}{
182
+ "cleanupIntervalSeconds": float64(11),
183
+ "maxConnections": float64(12),
184
+ "efConstruction": float64(13),
185
+ "vectorCacheMaxObjects": float64(14),
186
+ "ef": float64(15),
187
+ "flatSearchCutoff": float64(16),
188
+ "dynamicEfMin": float64(17),
189
+ "dynamicEfMax": float64(18),
190
+ "dynamicEfFactor": float64(19),
191
+ "pq": map[string]interface{}{
192
+ "enabled": true,
193
+ "bitCompression": false,
194
+ "segments": float64(64),
195
+ "centroids": float64(200),
196
+ "trainingLimit": float64(100),
197
+ "encoder": map[string]interface{}{
198
+ "type": hnsw.PQEncoderTypeKMeans,
199
+ },
200
+ },
201
+ "filterStrategy": hnsw.FilterStrategyAcorn,
202
+ },
203
+ },
204
+ expected: UserConfig{
205
+ Distance: common.DefaultDistanceMetric,
206
+ Threshold: DefaultThreshold,
207
+ HnswUC: hnsw.UserConfig{
208
+ CleanupIntervalSeconds: 11,
209
+ MaxConnections: 12,
210
+ EFConstruction: 13,
211
+ VectorCacheMaxObjects: 14,
212
+ EF: 15,
213
+ FlatSearchCutoff: 16,
214
+ DynamicEFMin: 17,
215
+ DynamicEFMax: 18,
216
+ DynamicEFFactor: 19,
217
+ Distance: common.DefaultDistanceMetric,
218
+ PQ: hnsw.PQConfig{
219
+ Enabled: true,
220
+ Segments: 64,
221
+ Centroids: 200,
222
+ TrainingLimit: 100,
223
+ Encoder: hnsw.PQEncoder{
224
+ Type: hnsw.DefaultPQEncoderType,
225
+ Distribution: hnsw.DefaultPQEncoderDistribution,
226
+ },
227
+ },
228
+ SQ: hnsw.SQConfig{
229
+ Enabled: hnsw.DefaultSQEnabled,
230
+ TrainingLimit: hnsw.DefaultSQTrainingLimit,
231
+ RescoreLimit: hnsw.DefaultSQRescoreLimit,
232
+ },
233
+ RQ: hnsw.RQConfig{
234
+ Enabled: hnsw.DefaultRQEnabled,
235
+ Bits: hnsw.DefaultRQBits,
236
+ RescoreLimit: hnsw.DefaultRQRescoreLimit,
237
+ },
238
+ FilterStrategy: hnsw.FilterStrategyAcorn,
239
+ Multivector: hnsw.MultivectorConfig{
240
+ Enabled: hnsw.DefaultMultivectorEnabled,
241
+ Aggregation: hnsw.DefaultMultivectorAggregation,
242
+ MuveraConfig: hnsw.MuveraConfig{
243
+ Enabled: hnsw.DefaultMultivectorMuveraEnabled,
244
+ KSim: hnsw.DefaultMultivectorKSim,
245
+ DProjections: hnsw.DefaultMultivectorDProjections,
246
+ Repetitions: hnsw.DefaultMultivectorRepetitions,
247
+ },
248
+ },
249
+ },
250
+ FlatUC: flat.UserConfig{
251
+ VectorCacheMaxObjects: common.DefaultVectorCacheMaxObjects,
252
+ Distance: common.DefaultDistanceMetric,
253
+ PQ: flat.CompressionUserConfig{
254
+ Enabled: flat.DefaultCompressionEnabled,
255
+ RescoreLimit: flat.DefaultCompressionRescore,
256
+ Cache: flat.DefaultVectorCache,
257
+ },
258
+ BQ: flat.CompressionUserConfig{
259
+ Enabled: flat.DefaultCompressionEnabled,
260
+ RescoreLimit: flat.DefaultCompressionRescore,
261
+ Cache: flat.DefaultVectorCache,
262
+ },
263
+ SQ: flat.CompressionUserConfig{
264
+ Enabled: flat.DefaultCompressionEnabled,
265
+ RescoreLimit: flat.DefaultCompressionRescore,
266
+ Cache: flat.DefaultVectorCache,
267
+ },
268
+ },
269
+ },
270
+ },
271
+ {
272
+ name: "dynamic index is set with multivector",
273
+ input: map[string]interface{}{
274
+ "hnsw": map[string]interface{}{
275
+ "multivector": map[string]interface{}{
276
+ "enabled": true,
277
+ },
278
+ },
279
+ },
280
+ expectErr: true,
281
+ expectErrMsg: "multi vector index is not supported for dynamic index",
282
+ },
283
+ {
284
+ name: "flat is properly set",
285
+ input: map[string]interface{}{
286
+ "flat": map[string]interface{}{
287
+ "vectorCacheMaxObjects": float64(100),
288
+ "distance": "cosine",
289
+ "bq": map[string]interface{}{
290
+ "enabled": true,
291
+ "rescoreLimit": float64(100),
292
+ "cache": true,
293
+ },
294
+ },
295
+ },
296
+ expected: UserConfig{
297
+ Distance: common.DefaultDistanceMetric,
298
+ Threshold: DefaultThreshold,
299
+ HnswUC: hnsw.UserConfig{
300
+ CleanupIntervalSeconds: hnsw.DefaultCleanupIntervalSeconds,
301
+ MaxConnections: hnsw.DefaultMaxConnections,
302
+ EFConstruction: hnsw.DefaultEFConstruction,
303
+ VectorCacheMaxObjects: common.DefaultVectorCacheMaxObjects,
304
+ EF: hnsw.DefaultEF,
305
+ Skip: hnsw.DefaultSkip,
306
+ FlatSearchCutoff: hnsw.DefaultFlatSearchCutoff,
307
+ DynamicEFMin: hnsw.DefaultDynamicEFMin,
308
+ DynamicEFMax: hnsw.DefaultDynamicEFMax,
309
+ DynamicEFFactor: hnsw.DefaultDynamicEFFactor,
310
+ Distance: common.DefaultDistanceMetric,
311
+ PQ: hnsw.PQConfig{
312
+ Enabled: hnsw.DefaultPQEnabled,
313
+ Segments: hnsw.DefaultPQSegments,
314
+ Centroids: hnsw.DefaultPQCentroids,
315
+ TrainingLimit: hnsw.DefaultPQTrainingLimit,
316
+ Encoder: hnsw.PQEncoder{
317
+ Type: hnsw.DefaultPQEncoderType,
318
+ Distribution: hnsw.DefaultPQEncoderDistribution,
319
+ },
320
+ },
321
+ SQ: hnsw.SQConfig{
322
+ Enabled: hnsw.DefaultSQEnabled,
323
+ TrainingLimit: hnsw.DefaultSQTrainingLimit,
324
+ RescoreLimit: hnsw.DefaultSQRescoreLimit,
325
+ },
326
+ RQ: hnsw.RQConfig{
327
+ Enabled: hnsw.DefaultRQEnabled,
328
+ Bits: hnsw.DefaultRQBits,
329
+ RescoreLimit: hnsw.DefaultRQRescoreLimit,
330
+ },
331
+ FilterStrategy: hnsw.DefaultFilterStrategy,
332
+ Multivector: hnsw.MultivectorConfig{
333
+ Enabled: hnsw.DefaultMultivectorEnabled,
334
+ Aggregation: hnsw.DefaultMultivectorAggregation,
335
+ MuveraConfig: hnsw.MuveraConfig{
336
+ Enabled: hnsw.DefaultMultivectorMuveraEnabled,
337
+ KSim: hnsw.DefaultMultivectorKSim,
338
+ DProjections: hnsw.DefaultMultivectorDProjections,
339
+ Repetitions: hnsw.DefaultMultivectorRepetitions,
340
+ },
341
+ },
342
+ },
343
+ FlatUC: flat.UserConfig{
344
+ VectorCacheMaxObjects: 100,
345
+ Distance: common.DefaultDistanceMetric,
346
+ PQ: flat.CompressionUserConfig{
347
+ Enabled: false,
348
+ RescoreLimit: flat.DefaultCompressionRescore,
349
+ Cache: flat.DefaultVectorCache,
350
+ },
351
+ BQ: flat.CompressionUserConfig{
352
+ Enabled: true,
353
+ RescoreLimit: 100,
354
+ Cache: true,
355
+ },
356
+ SQ: flat.CompressionUserConfig{
357
+ Enabled: flat.DefaultCompressionEnabled,
358
+ RescoreLimit: flat.DefaultCompressionRescore,
359
+ Cache: flat.DefaultVectorCache,
360
+ },
361
+ },
362
+ },
363
+ },
364
+ {
365
+ name: "pq enabled with flat returns error",
366
+ input: map[string]interface{}{
367
+ "flat": map[string]interface{}{
368
+ "vectorCacheMaxObjects": float64(100),
369
+ "distance": "cosine",
370
+ "pq": map[string]interface{}{
371
+ "enabled": true,
372
+ "rescoreLimit": float64(100),
373
+ "cache": true,
374
+ },
375
+ },
376
+ },
377
+ expectErr: true,
378
+ expectErrMsg: "PQ is not currently supported for flat indices",
379
+ },
380
+ }
381
+
382
+ for _, test := range tests {
383
+ t.Run(test.name, func(t *testing.T) {
384
+ cfg, err := ParseAndValidateConfig(test.input, false)
385
+ if test.expectErr {
386
+ require.NotNil(t, err)
387
+ assert.Contains(t, err.Error(), test.expectErrMsg)
388
+ return
389
+ } else {
390
+ assert.Nil(t, err)
391
+ assert.Equal(t, test.expected, cfg)
392
+ }
393
+ })
394
+ }
395
+ }
platform/dbops/binaries/weaviate-src/entities/vectorindex/flat/config.go ADDED
@@ -0,0 +1,190 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // _ _
2
+ // __ _____ __ ___ ___ __ _| |_ ___
3
+ // \ \ /\ / / _ \/ _` \ \ / / |/ _` | __/ _ \
4
+ // \ V V / __/ (_| |\ V /| | (_| | || __/
5
+ // \_/\_/ \___|\__,_| \_/ |_|\__,_|\__\___|
6
+ //
7
+ // Copyright © 2016 - 2025 Weaviate B.V. All rights reserved.
8
+ //
9
+ // CONTACT: hello@weaviate.io
10
+ //
11
+
12
+ package flat
13
+
14
+ import (
15
+ "errors"
16
+ "fmt"
17
+
18
+ schemaConfig "github.com/weaviate/weaviate/entities/schema/config"
19
+ vectorindexcommon "github.com/weaviate/weaviate/entities/vectorindex/common"
20
+ )
21
+
22
+ const (
23
+ DefaultVectorCache = false
24
+ DefaultVectorCacheMaxObjects = 1e12
25
+ DefaultCompressionEnabled = false
26
+ DefaultCompressionRescore = -1 // indicates "let Weaviate pick"
27
+ )
28
+
29
+ type CompressionUserConfig struct {
30
+ Enabled bool `json:"enabled"`
31
+ RescoreLimit int `json:"rescoreLimit"`
32
+ Cache bool `json:"cache"`
33
+ }
34
+
35
+ type UserConfig struct {
36
+ Distance string `json:"distance"`
37
+ VectorCacheMaxObjects int `json:"vectorCacheMaxObjects"`
38
+ PQ CompressionUserConfig `json:"pq"`
39
+ BQ CompressionUserConfig `json:"bq"`
40
+ SQ CompressionUserConfig `json:"sq"`
41
+ }
42
+
43
+ // IndexType returns the type of the underlying vector index, thus making sure
44
+ // the schema.VectorIndexConfig interface is implemented
45
+ func (u UserConfig) IndexType() string {
46
+ return "flat"
47
+ }
48
+
49
+ func (u UserConfig) DistanceName() string {
50
+ return u.Distance
51
+ }
52
+
53
+ func (u UserConfig) IsMultiVector() bool {
54
+ return false
55
+ }
56
+
57
+ // SetDefaults in the user-specifyable part of the config
58
+ func (u *UserConfig) SetDefaults() {
59
+ u.PQ.Cache = DefaultVectorCache
60
+ u.BQ.Cache = DefaultVectorCache
61
+ u.VectorCacheMaxObjects = DefaultVectorCacheMaxObjects
62
+ u.Distance = vectorindexcommon.DefaultDistanceMetric
63
+ u.PQ.Enabled = DefaultCompressionEnabled
64
+ u.PQ.RescoreLimit = DefaultCompressionRescore
65
+ u.BQ.Enabled = DefaultCompressionEnabled
66
+ u.BQ.RescoreLimit = DefaultCompressionRescore
67
+ u.SQ.Enabled = DefaultCompressionEnabled
68
+ u.SQ.RescoreLimit = DefaultCompressionRescore
69
+ }
70
+
71
+ // ParseAndValidateConfig from an unknown input value, as this is not further
72
+ // specified in the API to allow of exchanging the index type
73
+ func ParseAndValidateConfig(input interface{}) (schemaConfig.VectorIndexConfig, error) {
74
+ uc := UserConfig{}
75
+ uc.SetDefaults()
76
+
77
+ if input == nil {
78
+ return uc, nil
79
+ }
80
+
81
+ asMap, ok := input.(map[string]interface{})
82
+ if !ok || asMap == nil {
83
+ return uc, fmt.Errorf("input must be a non-nil map")
84
+ }
85
+
86
+ if err := vectorindexcommon.OptionalStringFromMap(asMap, "distance", func(v string) {
87
+ uc.Distance = v
88
+ }); err != nil {
89
+ return uc, err
90
+ }
91
+
92
+ if err := vectorindexcommon.OptionalIntFromMap(asMap, "vectorCacheMaxObjects", func(v int) {
93
+ uc.VectorCacheMaxObjects = v
94
+ }); err != nil {
95
+ return uc, err
96
+ }
97
+
98
+ if err := parseCompression(asMap, &uc); err != nil {
99
+ return uc, err
100
+ }
101
+
102
+ return uc, nil
103
+ }
104
+
105
+ func parseCompressionMap(in interface{}, cuc *CompressionUserConfig) error {
106
+ configMap, ok := in.(map[string]interface{})
107
+ if ok {
108
+ if err := vectorindexcommon.OptionalBoolFromMap(configMap, "enabled", func(v bool) {
109
+ cuc.Enabled = v
110
+ }); err != nil {
111
+ return err
112
+ }
113
+
114
+ if err := vectorindexcommon.OptionalBoolFromMap(configMap, "cache", func(v bool) {
115
+ cuc.Cache = v
116
+ }); err != nil {
117
+ return err
118
+ }
119
+
120
+ if err := vectorindexcommon.OptionalIntFromMap(configMap, "rescoreLimit", func(v int) {
121
+ cuc.RescoreLimit = v
122
+ }); err != nil {
123
+ return err
124
+ }
125
+ }
126
+ return nil
127
+ }
128
+
129
+ func parseCompression(in map[string]interface{}, uc *UserConfig) error {
130
+ pqConfigValue, pqOk := in["pq"]
131
+ bqConfigValue, bqOk := in["bq"]
132
+ sqConfigValue, sqOk := in["sq"]
133
+
134
+ if !pqOk && !bqOk && !sqOk {
135
+ return nil
136
+ }
137
+
138
+ if pqOk {
139
+ err := parseCompressionMap(pqConfigValue, &uc.PQ)
140
+ if err != nil {
141
+ return err
142
+ }
143
+ }
144
+
145
+ if bqOk {
146
+ err := parseCompressionMap(bqConfigValue, &uc.BQ)
147
+ if err != nil {
148
+ return err
149
+ }
150
+ }
151
+
152
+ if sqOk {
153
+ err := parseCompressionMap(sqConfigValue, &uc.SQ)
154
+ if err != nil {
155
+ return err
156
+ }
157
+ }
158
+
159
+ compressionConfigs := []CompressionUserConfig{uc.PQ, uc.BQ, uc.SQ}
160
+ totalEnabled := 0
161
+
162
+ for _, compressionConfig := range compressionConfigs {
163
+ if compressionConfig.Cache && !compressionConfig.Enabled {
164
+ return errors.New("not possible to use the cache without compression")
165
+ }
166
+ if compressionConfig.Enabled {
167
+ totalEnabled++
168
+ }
169
+ }
170
+
171
+ if totalEnabled > 1 {
172
+ return errors.New("cannot enable multiple quantization methods at the same time")
173
+ }
174
+
175
+ // TODO: remove once PQ and SQ are supported
176
+ if uc.PQ.Enabled {
177
+ return errors.New("PQ is not currently supported for flat indices")
178
+ }
179
+ if uc.SQ.Enabled {
180
+ return errors.New("SQ is not currently supported for flat indices")
181
+ }
182
+
183
+ return nil
184
+ }
185
+
186
+ func NewDefaultUserConfig() UserConfig {
187
+ uc := UserConfig{}
188
+ uc.SetDefaults()
189
+ return uc
190
+ }
platform/dbops/binaries/weaviate-src/entities/vectorindex/flat/config_test.go ADDED
@@ -0,0 +1,148 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // _ _
2
+ // __ _____ __ ___ ___ __ _| |_ ___
3
+ // \ \ /\ / / _ \/ _` \ \ / / |/ _` | __/ _ \
4
+ // \ V V / __/ (_| |\ V /| | (_| | || __/
5
+ // \_/\_/ \___|\__,_| \_/ |_|\__,_|\__\___|
6
+ //
7
+ // Copyright © 2016 - 2025 Weaviate B.V. All rights reserved.
8
+ //
9
+ // CONTACT: hello@weaviate.io
10
+ //
11
+
12
+ package flat
13
+
14
+ import (
15
+ "testing"
16
+
17
+ "github.com/stretchr/testify/assert"
18
+ "github.com/stretchr/testify/require"
19
+ "github.com/weaviate/weaviate/entities/vectorindex/common"
20
+ )
21
+
22
+ func Test_FlatUserConfig(t *testing.T) {
23
+ type test struct {
24
+ name string
25
+ input interface{}
26
+ expected UserConfig
27
+ expectErr bool
28
+ expectErrMsg string
29
+ }
30
+
31
+ tests := []test{
32
+ {
33
+ name: "nothing specified, all defaults",
34
+ input: nil,
35
+ expected: UserConfig{
36
+ VectorCacheMaxObjects: common.DefaultVectorCacheMaxObjects,
37
+ Distance: common.DefaultDistanceMetric,
38
+ PQ: CompressionUserConfig{
39
+ Enabled: DefaultCompressionEnabled,
40
+ RescoreLimit: DefaultCompressionRescore,
41
+ Cache: DefaultVectorCache,
42
+ },
43
+ BQ: CompressionUserConfig{
44
+ Enabled: DefaultCompressionEnabled,
45
+ RescoreLimit: DefaultCompressionRescore,
46
+ Cache: DefaultVectorCache,
47
+ },
48
+ SQ: CompressionUserConfig{
49
+ Enabled: DefaultCompressionEnabled,
50
+ RescoreLimit: DefaultCompressionRescore,
51
+ Cache: DefaultVectorCache,
52
+ },
53
+ },
54
+ },
55
+ {
56
+ name: "bq enabled",
57
+ input: map[string]interface{}{
58
+ "vectorCacheMaxObjects": float64(100),
59
+ "distance": "cosine",
60
+ "bq": map[string]interface{}{
61
+ "enabled": true,
62
+ "rescoreLimit": float64(100),
63
+ "cache": true,
64
+ },
65
+ },
66
+ expected: UserConfig{
67
+ VectorCacheMaxObjects: 100,
68
+ Distance: common.DefaultDistanceMetric,
69
+ PQ: CompressionUserConfig{
70
+ Enabled: false,
71
+ RescoreLimit: DefaultCompressionRescore,
72
+ Cache: DefaultVectorCache,
73
+ },
74
+ BQ: CompressionUserConfig{
75
+ Enabled: true,
76
+ RescoreLimit: 100,
77
+ Cache: true,
78
+ },
79
+ SQ: CompressionUserConfig{
80
+ Enabled: DefaultCompressionEnabled,
81
+ RescoreLimit: DefaultCompressionRescore,
82
+ Cache: DefaultVectorCache,
83
+ },
84
+ },
85
+ },
86
+ {
87
+ name: "sq enabled",
88
+ input: map[string]interface{}{
89
+ "vectorCacheMaxObjects": float64(100),
90
+ "distance": "cosine",
91
+ "sq": map[string]interface{}{
92
+ "enabled": true,
93
+ "rescoreLimit": float64(20),
94
+ "cache": true,
95
+ },
96
+ },
97
+ expectErr: true,
98
+ expectErrMsg: "SQ is not currently supported for flat indices",
99
+ },
100
+ {
101
+ name: "pq enabled",
102
+ input: map[string]interface{}{
103
+ "vectorCacheMaxObjects": float64(100),
104
+ "distance": "cosine",
105
+ "pq": map[string]interface{}{
106
+ "enabled": true,
107
+ "rescoreLimit": float64(100),
108
+ "cache": true,
109
+ },
110
+ },
111
+ expectErr: true,
112
+ expectErrMsg: "PQ is not currently supported for flat indices",
113
+ },
114
+ {
115
+ name: "sq and bq enabled",
116
+ input: map[string]interface{}{
117
+ "vectorCacheMaxObjects": float64(100),
118
+ "distance": "cosine",
119
+ "sq": map[string]interface{}{
120
+ "enabled": true,
121
+ "rescoreLimit": float64(100),
122
+ "cache": true,
123
+ },
124
+ "bq": map[string]interface{}{
125
+ "enabled": true,
126
+ "rescoreLimit": float64(100),
127
+ "cache": true,
128
+ },
129
+ },
130
+ expectErr: true,
131
+ expectErrMsg: "cannot enable multiple quantization methods at the same time",
132
+ },
133
+ }
134
+
135
+ for _, test := range tests {
136
+ t.Run(test.name, func(t *testing.T) {
137
+ cfg, err := ParseAndValidateConfig(test.input)
138
+ if test.expectErr {
139
+ require.NotNil(t, err)
140
+ assert.Contains(t, err.Error(), test.expectErrMsg)
141
+ return
142
+ } else {
143
+ assert.Nil(t, err)
144
+ assert.Equal(t, test.expected, cfg)
145
+ }
146
+ })
147
+ }
148
+ }
platform/dbops/binaries/weaviate-src/entities/vectorindex/hnsw/bq_config.go ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // _ _
2
+ // __ _____ __ ___ ___ __ _| |_ ___
3
+ // \ \ /\ / / _ \/ _` \ \ / / |/ _` | __/ _ \
4
+ // \ V V / __/ (_| |\ V /| | (_| | || __/
5
+ // \_/\_/ \___|\__,_| \_/ |_|\__,_|\__\___|
6
+ //
7
+ // Copyright © 2016 - 2025 Weaviate B.V. All rights reserved.
8
+ //
9
+ // CONTACT: hello@weaviate.io
10
+ //
11
+
12
+ package hnsw
13
+
14
+ import "github.com/weaviate/weaviate/entities/vectorindex/common"
15
+
16
+ const (
17
+ DefaultBQEnabled = false
18
+ )
19
+
20
+ type BQConfig struct {
21
+ Enabled bool `json:"enabled"`
22
+ }
23
+
24
+ func parseBQMap(in map[string]interface{}, bq *BQConfig) error {
25
+ bqConfigValue, ok := in["bq"]
26
+ if !ok {
27
+ return nil
28
+ }
29
+
30
+ bqConfigMap, ok := bqConfigValue.(map[string]interface{})
31
+ if !ok {
32
+ return nil
33
+ }
34
+
35
+ if err := common.OptionalBoolFromMap(bqConfigMap, "enabled", func(v bool) {
36
+ bq.Enabled = v
37
+ }); err != nil {
38
+ return err
39
+ }
40
+
41
+ return nil
42
+ }
platform/dbops/binaries/weaviate-src/entities/vectorindex/hnsw/config.go ADDED
@@ -0,0 +1,331 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // _ _
2
+ // __ _____ __ ___ ___ __ _| |_ ___
3
+ // \ \ /\ / / _ \/ _` \ \ / / |/ _` | __/ _ \
4
+ // \ V V / __/ (_| |\ V /| | (_| | || __/
5
+ // \_/\_/ \___|\__,_| \_/ |_|\__,_|\__\___|
6
+ //
7
+ // Copyright © 2016 - 2025 Weaviate B.V. All rights reserved.
8
+ //
9
+ // CONTACT: hello@weaviate.io
10
+ //
11
+
12
+ package hnsw
13
+
14
+ import (
15
+ "fmt"
16
+ "os"
17
+ "strings"
18
+
19
+ "github.com/weaviate/weaviate/entities/schema/config"
20
+ vectorIndexCommon "github.com/weaviate/weaviate/entities/vectorindex/common"
21
+ )
22
+
23
+ const (
24
+ // Set these defaults if the user leaves them blank
25
+ DefaultCleanupIntervalSeconds = 5 * 60
26
+ DefaultMaxConnections = 32
27
+ DefaultEFConstruction = 128
28
+ DefaultEF = -1 // indicates "let Weaviate pick"
29
+ DefaultDynamicEFMin = 100
30
+ DefaultDynamicEFMax = 500
31
+ DefaultDynamicEFFactor = 8
32
+ DefaultSkip = false
33
+ DefaultFlatSearchCutoff = 40000
34
+
35
+ FilterStrategySweeping = "sweeping"
36
+ FilterStrategyAcorn = "acorn"
37
+
38
+ DefaultFilterStrategy = FilterStrategySweeping
39
+
40
+ // Fail validation if those criteria are not met
41
+ MinmumMaxConnections = 4
42
+ MaximumMaxConnections = 2047
43
+ MinmumEFConstruction = 4
44
+ )
45
+
46
+ // UserConfig bundles all values settable by a user in the per-class settings
47
+ type UserConfig struct {
48
+ Skip bool `json:"skip"`
49
+ CleanupIntervalSeconds int `json:"cleanupIntervalSeconds"`
50
+ MaxConnections int `json:"maxConnections"`
51
+ EFConstruction int `json:"efConstruction"`
52
+ EF int `json:"ef"`
53
+ DynamicEFMin int `json:"dynamicEfMin"`
54
+ DynamicEFMax int `json:"dynamicEfMax"`
55
+ DynamicEFFactor int `json:"dynamicEfFactor"`
56
+ VectorCacheMaxObjects int `json:"vectorCacheMaxObjects"`
57
+ FlatSearchCutoff int `json:"flatSearchCutoff"`
58
+ Distance string `json:"distance"`
59
+ PQ PQConfig `json:"pq"`
60
+ BQ BQConfig `json:"bq"`
61
+ SQ SQConfig `json:"sq"`
62
+ RQ RQConfig `json:"rq"`
63
+ FilterStrategy string `json:"filterStrategy"`
64
+ Multivector MultivectorConfig `json:"multivector"`
65
+ SkipDefaultQuantization bool `json:"skipDefaultQuantization"`
66
+ TrackDefaultQuantization bool `json:"trackDefaultQuantization"`
67
+ }
68
+
69
+ // IndexType returns the type of the underlying vector index, thus making sure
70
+ // the schema.VectorIndexConfig interface is implemented
71
+ func (u UserConfig) IndexType() string {
72
+ return "hnsw"
73
+ }
74
+
75
+ func (u UserConfig) DistanceName() string {
76
+ return u.Distance
77
+ }
78
+
79
+ func (u UserConfig) IsMultiVector() bool {
80
+ return u.Multivector.Enabled
81
+ }
82
+
83
+ // SetDefaults in the user-specifyable part of the config
84
+ func (u *UserConfig) SetDefaults() {
85
+ u.MaxConnections = DefaultMaxConnections
86
+ u.EFConstruction = DefaultEFConstruction
87
+ u.CleanupIntervalSeconds = DefaultCleanupIntervalSeconds
88
+ u.VectorCacheMaxObjects = vectorIndexCommon.DefaultVectorCacheMaxObjects
89
+ u.EF = DefaultEF
90
+ u.DynamicEFFactor = DefaultDynamicEFFactor
91
+ u.DynamicEFMax = DefaultDynamicEFMax
92
+ u.DynamicEFMin = DefaultDynamicEFMin
93
+ u.Skip = DefaultSkip
94
+ u.FlatSearchCutoff = DefaultFlatSearchCutoff
95
+ u.Distance = vectorIndexCommon.DefaultDistanceMetric
96
+ u.PQ = PQConfig{
97
+ Enabled: DefaultPQEnabled,
98
+ BitCompression: DefaultPQBitCompression,
99
+ Segments: DefaultPQSegments,
100
+ Centroids: DefaultPQCentroids,
101
+ TrainingLimit: DefaultPQTrainingLimit,
102
+ Encoder: PQEncoder{
103
+ Type: DefaultPQEncoderType,
104
+ Distribution: DefaultPQEncoderDistribution,
105
+ },
106
+ }
107
+ u.BQ = BQConfig{
108
+ Enabled: DefaultBQEnabled,
109
+ }
110
+ u.SQ = SQConfig{
111
+ Enabled: DefaultSQEnabled,
112
+ TrainingLimit: DefaultSQTrainingLimit,
113
+ RescoreLimit: DefaultSQRescoreLimit,
114
+ }
115
+ u.RQ = RQConfig{
116
+ Enabled: DefaultRQEnabled,
117
+ Bits: DefaultRQBits,
118
+ RescoreLimit: DefaultRQRescoreLimit,
119
+ }
120
+ if strategy := os.Getenv("HNSW_DEFAULT_FILTER_STRATEGY"); strategy == FilterStrategyAcorn {
121
+ u.FilterStrategy = FilterStrategyAcorn
122
+ } else {
123
+ u.FilterStrategy = FilterStrategySweeping
124
+ }
125
+ u.Multivector = MultivectorConfig{
126
+ Aggregation: DefaultMultivectorAggregation,
127
+ Enabled: DefaultMultivectorEnabled,
128
+ MuveraConfig: MuveraConfig{
129
+ Enabled: DefaultMultivectorMuveraEnabled,
130
+ KSim: DefaultMultivectorKSim,
131
+ DProjections: DefaultMultivectorDProjections,
132
+ Repetitions: DefaultMultivectorRepetitions,
133
+ },
134
+ }
135
+ }
136
+
137
+ // ParseAndValidateConfig from an unknown input value, as this is not further
138
+ // specified in the API to allow of exchanging the index type
139
+ func ParseAndValidateConfig(input interface{}, isMultiVector bool) (config.VectorIndexConfig, error) {
140
+ uc := UserConfig{}
141
+ uc.SetDefaults()
142
+
143
+ if input == nil {
144
+ return uc, nil
145
+ }
146
+
147
+ asMap, ok := input.(map[string]interface{})
148
+ if !ok || asMap == nil {
149
+ return uc, fmt.Errorf("input must be a non-nil map")
150
+ }
151
+
152
+ if err := vectorIndexCommon.OptionalIntFromMap(asMap, "maxConnections", func(v int) {
153
+ uc.MaxConnections = v
154
+ }); err != nil {
155
+ return uc, err
156
+ }
157
+
158
+ if err := vectorIndexCommon.OptionalIntFromMap(asMap, "cleanupIntervalSeconds", func(v int) {
159
+ uc.CleanupIntervalSeconds = v
160
+ }); err != nil {
161
+ return uc, err
162
+ }
163
+
164
+ if err := vectorIndexCommon.OptionalIntFromMap(asMap, "efConstruction", func(v int) {
165
+ uc.EFConstruction = v
166
+ }); err != nil {
167
+ return uc, err
168
+ }
169
+
170
+ if err := vectorIndexCommon.OptionalIntFromMap(asMap, "ef", func(v int) {
171
+ uc.EF = v
172
+ }); err != nil {
173
+ return uc, err
174
+ }
175
+
176
+ if err := vectorIndexCommon.OptionalIntFromMap(asMap, "dynamicEfFactor", func(v int) {
177
+ uc.DynamicEFFactor = v
178
+ }); err != nil {
179
+ return uc, err
180
+ }
181
+
182
+ if err := vectorIndexCommon.OptionalIntFromMap(asMap, "dynamicEfMax", func(v int) {
183
+ uc.DynamicEFMax = v
184
+ }); err != nil {
185
+ return uc, err
186
+ }
187
+
188
+ if err := vectorIndexCommon.OptionalIntFromMap(asMap, "dynamicEfMin", func(v int) {
189
+ uc.DynamicEFMin = v
190
+ }); err != nil {
191
+ return uc, err
192
+ }
193
+
194
+ if err := vectorIndexCommon.OptionalIntFromMap(asMap, "vectorCacheMaxObjects", func(v int) {
195
+ uc.VectorCacheMaxObjects = v
196
+ }); err != nil {
197
+ return uc, err
198
+ }
199
+
200
+ if err := vectorIndexCommon.OptionalIntFromMap(asMap, "flatSearchCutoff", func(v int) {
201
+ uc.FlatSearchCutoff = v
202
+ }); err != nil {
203
+ return uc, err
204
+ }
205
+
206
+ if err := vectorIndexCommon.OptionalBoolFromMap(asMap, "skip", func(v bool) {
207
+ uc.Skip = v
208
+ }); err != nil {
209
+ return uc, err
210
+ }
211
+
212
+ if err := vectorIndexCommon.OptionalStringFromMap(asMap, "distance", func(v string) {
213
+ uc.Distance = v
214
+ }); err != nil {
215
+ return uc, err
216
+ }
217
+
218
+ if err := parsePQMap(asMap, &uc.PQ); err != nil {
219
+ return uc, err
220
+ }
221
+
222
+ if err := parseBQMap(asMap, &uc.BQ); err != nil {
223
+ return uc, err
224
+ }
225
+
226
+ if err := parseSQMap(asMap, &uc.SQ); err != nil {
227
+ return uc, err
228
+ }
229
+
230
+ if err := parseRQMap(asMap, &uc.RQ); err != nil {
231
+ return uc, err
232
+ }
233
+
234
+ if err := vectorIndexCommon.OptionalStringFromMap(asMap, "filterStrategy", func(v string) {
235
+ uc.FilterStrategy = v
236
+ }); err != nil {
237
+ return uc, err
238
+ }
239
+
240
+ if err := parseMultivectorMap(asMap, &uc.Multivector, isMultiVector); err != nil {
241
+ return uc, err
242
+ }
243
+
244
+ if err := vectorIndexCommon.OptionalBoolFromMap(asMap, "skipDefaultQuantization", func(v bool) {
245
+ uc.SkipDefaultQuantization = v
246
+ }); err != nil {
247
+ return uc, err
248
+ }
249
+
250
+ if err := vectorIndexCommon.OptionalBoolFromMap(asMap, "trackDefaultQuantization", func(v bool) {
251
+ uc.TrackDefaultQuantization = v
252
+ }); err != nil {
253
+ return uc, err
254
+ }
255
+
256
+ return uc, uc.validate()
257
+ }
258
+
259
+ func (u *UserConfig) validate() error {
260
+ var errMsgs []string
261
+ if u.MaxConnections < MinmumMaxConnections {
262
+ errMsgs = append(errMsgs, fmt.Sprintf(
263
+ "maxConnections must be a positive integer with a minimum of %d",
264
+ MinmumMaxConnections,
265
+ ))
266
+ }
267
+
268
+ if u.MaxConnections > MaximumMaxConnections {
269
+ errMsgs = append(errMsgs, fmt.Sprintf(
270
+ "maxConnections must be less than %d",
271
+ MaximumMaxConnections+1,
272
+ ))
273
+ }
274
+
275
+ if u.EFConstruction < MinmumEFConstruction {
276
+ errMsgs = append(errMsgs, fmt.Sprintf(
277
+ "efConstruction must be a positive integer with a minimum of %d",
278
+ MinmumMaxConnections,
279
+ ))
280
+ }
281
+
282
+ if u.FilterStrategy != FilterStrategySweeping && u.FilterStrategy != FilterStrategyAcorn {
283
+ errMsgs = append(errMsgs, "filterStrategy must be either 'sweeping' or 'acorn'")
284
+ }
285
+
286
+ if len(errMsgs) > 0 {
287
+ return fmt.Errorf("invalid hnsw config: %s",
288
+ strings.Join(errMsgs, ", "))
289
+ }
290
+
291
+ enabled := 0
292
+ if u.PQ.Enabled {
293
+ enabled++
294
+ }
295
+ if u.BQ.Enabled {
296
+ enabled++
297
+ }
298
+ if u.SQ.Enabled {
299
+ enabled++
300
+ }
301
+ if u.RQ.Enabled {
302
+ enabled++
303
+ }
304
+ if enabled > 1 {
305
+ return fmt.Errorf("invalid hnsw config: more than a single compression methods enabled")
306
+ }
307
+
308
+ err := ValidateRQConfig(u.RQ)
309
+ if err != nil {
310
+ return err
311
+ }
312
+
313
+ if u.Multivector.MuveraConfig.Enabled && u.Multivector.MuveraConfig.KSim > 10 {
314
+ return fmt.Errorf("invalid hnsw config: ksim must be less than 10")
315
+ }
316
+
317
+ return nil
318
+ }
319
+
320
+ func NewDefaultUserConfig() UserConfig {
321
+ uc := UserConfig{}
322
+ uc.SetDefaults()
323
+ return uc
324
+ }
325
+
326
+ func NewDefaultMultiVectorUserConfig() UserConfig {
327
+ uc := UserConfig{}
328
+ uc.SetDefaults()
329
+ uc.Multivector = MultivectorConfig{Enabled: true}
330
+ return uc
331
+ }
platform/dbops/binaries/weaviate-src/entities/vectorindex/hnsw/config_test.go ADDED
@@ -0,0 +1,1148 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // _ _
2
+ // __ _____ __ ___ ___ __ _| |_ ___
3
+ // \ \ /\ / / _ \/ _` \ \ / / |/ _` | __/ _ \
4
+ // \ V V / __/ (_| |\ V /| | (_| | || __/
5
+ // \_/\_/ \___|\__,_| \_/ |_|\__,_|\__\___|
6
+ //
7
+ // Copyright © 2016 - 2025 Weaviate B.V. All rights reserved.
8
+ //
9
+ // CONTACT: hello@weaviate.io
10
+ //
11
+
12
+ package hnsw
13
+
14
+ import (
15
+ "encoding/json"
16
+ "math"
17
+ "os"
18
+ "testing"
19
+
20
+ "github.com/stretchr/testify/assert"
21
+ "github.com/stretchr/testify/require"
22
+ "github.com/weaviate/weaviate/entities/vectorindex/common"
23
+ )
24
+
25
+ func Test_UserConfig(t *testing.T) {
26
+ type test struct {
27
+ name string
28
+ input interface{}
29
+ expected UserConfig
30
+ expectErr bool
31
+ expectErrMsg string
32
+ }
33
+
34
+ tests := []test{
35
+ {
36
+ name: "nothing specified, all defaults",
37
+ input: nil,
38
+ expected: UserConfig{
39
+ CleanupIntervalSeconds: DefaultCleanupIntervalSeconds,
40
+ MaxConnections: DefaultMaxConnections,
41
+ EFConstruction: DefaultEFConstruction,
42
+ VectorCacheMaxObjects: common.DefaultVectorCacheMaxObjects,
43
+ EF: DefaultEF,
44
+ Skip: DefaultSkip,
45
+ FlatSearchCutoff: DefaultFlatSearchCutoff,
46
+ DynamicEFMin: DefaultDynamicEFMin,
47
+ DynamicEFMax: DefaultDynamicEFMax,
48
+ DynamicEFFactor: DefaultDynamicEFFactor,
49
+ Distance: common.DefaultDistanceMetric,
50
+ PQ: PQConfig{
51
+ Enabled: DefaultPQEnabled,
52
+ BitCompression: DefaultPQBitCompression,
53
+ Segments: DefaultPQSegments,
54
+ Centroids: DefaultPQCentroids,
55
+ TrainingLimit: DefaultPQTrainingLimit,
56
+ Encoder: PQEncoder{
57
+ Type: DefaultPQEncoderType,
58
+ Distribution: DefaultPQEncoderDistribution,
59
+ },
60
+ },
61
+ SQ: SQConfig{
62
+ Enabled: DefaultSQEnabled,
63
+ TrainingLimit: DefaultSQTrainingLimit,
64
+ RescoreLimit: DefaultSQRescoreLimit,
65
+ },
66
+ RQ: RQConfig{
67
+ Enabled: DefaultRQEnabled,
68
+ Bits: DefaultRQBits,
69
+ RescoreLimit: DefaultRQRescoreLimit,
70
+ },
71
+ FilterStrategy: DefaultFilterStrategy,
72
+ Multivector: MultivectorConfig{
73
+ Enabled: DefaultMultivectorEnabled,
74
+ Aggregation: DefaultMultivectorAggregation,
75
+ MuveraConfig: MuveraConfig{
76
+ Enabled: DefaultMultivectorMuveraEnabled,
77
+ KSim: DefaultMultivectorKSim,
78
+ DProjections: DefaultMultivectorDProjections,
79
+ Repetitions: DefaultMultivectorRepetitions,
80
+ },
81
+ },
82
+ },
83
+ },
84
+
85
+ {
86
+ name: "with maximum connections",
87
+ input: map[string]interface{}{
88
+ "maxConnections": json.Number("100"),
89
+ },
90
+ expected: UserConfig{
91
+ CleanupIntervalSeconds: DefaultCleanupIntervalSeconds,
92
+ MaxConnections: 100,
93
+ EFConstruction: DefaultEFConstruction,
94
+ VectorCacheMaxObjects: common.DefaultVectorCacheMaxObjects,
95
+ EF: DefaultEF,
96
+ FlatSearchCutoff: DefaultFlatSearchCutoff,
97
+ DynamicEFMin: DefaultDynamicEFMin,
98
+ DynamicEFMax: DefaultDynamicEFMax,
99
+ DynamicEFFactor: DefaultDynamicEFFactor,
100
+ Distance: common.DefaultDistanceMetric,
101
+ PQ: PQConfig{
102
+ Enabled: DefaultPQEnabled,
103
+ BitCompression: DefaultPQBitCompression,
104
+ Segments: DefaultPQSegments,
105
+ Centroids: DefaultPQCentroids,
106
+ TrainingLimit: DefaultPQTrainingLimit,
107
+ Encoder: PQEncoder{
108
+ Type: DefaultPQEncoderType,
109
+ Distribution: DefaultPQEncoderDistribution,
110
+ },
111
+ },
112
+ SQ: SQConfig{
113
+ Enabled: DefaultSQEnabled,
114
+ TrainingLimit: DefaultSQTrainingLimit,
115
+ RescoreLimit: DefaultSQRescoreLimit,
116
+ },
117
+ RQ: RQConfig{
118
+ Enabled: DefaultRQEnabled,
119
+ Bits: DefaultRQBits,
120
+ RescoreLimit: DefaultRQRescoreLimit,
121
+ },
122
+ FilterStrategy: DefaultFilterStrategy,
123
+ Multivector: MultivectorConfig{
124
+ Enabled: DefaultMultivectorEnabled,
125
+ Aggregation: DefaultMultivectorAggregation,
126
+ MuveraConfig: MuveraConfig{
127
+ Enabled: DefaultMultivectorMuveraEnabled,
128
+ KSim: DefaultMultivectorKSim,
129
+ DProjections: DefaultMultivectorDProjections,
130
+ Repetitions: DefaultMultivectorRepetitions,
131
+ },
132
+ },
133
+ },
134
+ },
135
+
136
+ {
137
+ name: "with all optional fields",
138
+ input: map[string]interface{}{
139
+ "cleanupIntervalSeconds": json.Number("11"),
140
+ "maxConnections": json.Number("12"),
141
+ "efConstruction": json.Number("13"),
142
+ "vectorCacheMaxObjects": json.Number("14"),
143
+ "ef": json.Number("15"),
144
+ "flatSearchCutoff": json.Number("16"),
145
+ "dynamicEfMin": json.Number("17"),
146
+ "dynamicEfMax": json.Number("18"),
147
+ "dynamicEfFactor": json.Number("19"),
148
+ "skip": true,
149
+ "distance": "l2-squared",
150
+ },
151
+ expected: UserConfig{
152
+ CleanupIntervalSeconds: 11,
153
+ MaxConnections: 12,
154
+ EFConstruction: 13,
155
+ VectorCacheMaxObjects: 14,
156
+ EF: 15,
157
+ FlatSearchCutoff: 16,
158
+ DynamicEFMin: 17,
159
+ DynamicEFMax: 18,
160
+ DynamicEFFactor: 19,
161
+ Skip: true,
162
+ Distance: "l2-squared",
163
+ PQ: PQConfig{
164
+ Enabled: DefaultPQEnabled,
165
+ BitCompression: DefaultPQBitCompression,
166
+ Segments: DefaultPQSegments,
167
+ Centroids: DefaultPQCentroids,
168
+ TrainingLimit: DefaultPQTrainingLimit,
169
+ Encoder: PQEncoder{
170
+ Type: DefaultPQEncoderType,
171
+ Distribution: DefaultPQEncoderDistribution,
172
+ },
173
+ },
174
+ SQ: SQConfig{
175
+ Enabled: DefaultSQEnabled,
176
+ TrainingLimit: DefaultSQTrainingLimit,
177
+ RescoreLimit: DefaultSQRescoreLimit,
178
+ },
179
+ RQ: RQConfig{
180
+ Enabled: DefaultRQEnabled,
181
+ Bits: DefaultRQBits,
182
+ RescoreLimit: DefaultRQRescoreLimit,
183
+ },
184
+ FilterStrategy: DefaultFilterStrategy,
185
+ Multivector: MultivectorConfig{
186
+ Enabled: DefaultMultivectorEnabled,
187
+ Aggregation: DefaultMultivectorAggregation,
188
+ MuveraConfig: MuveraConfig{
189
+ Enabled: DefaultMultivectorMuveraEnabled,
190
+ KSim: DefaultMultivectorKSim,
191
+ DProjections: DefaultMultivectorDProjections,
192
+ Repetitions: DefaultMultivectorRepetitions,
193
+ },
194
+ },
195
+ },
196
+ },
197
+
198
+ {
199
+ name: "with all optional fields",
200
+ input: map[string]interface{}{
201
+ "cleanupIntervalSeconds": json.Number("11"),
202
+ "maxConnections": json.Number("12"),
203
+ "efConstruction": json.Number("13"),
204
+ "vectorCacheMaxObjects": json.Number("14"),
205
+ "ef": json.Number("15"),
206
+ "flatSearchCutoff": json.Number("16"),
207
+ "dynamicEfMin": json.Number("17"),
208
+ "dynamicEfMax": json.Number("18"),
209
+ "dynamicEfFactor": json.Number("19"),
210
+ "skip": true,
211
+ "distance": "manhattan",
212
+ },
213
+ expected: UserConfig{
214
+ CleanupIntervalSeconds: 11,
215
+ MaxConnections: 12,
216
+ EFConstruction: 13,
217
+ VectorCacheMaxObjects: 14,
218
+ EF: 15,
219
+ FlatSearchCutoff: 16,
220
+ DynamicEFMin: 17,
221
+ DynamicEFMax: 18,
222
+ DynamicEFFactor: 19,
223
+ Skip: true,
224
+ Distance: "manhattan",
225
+ PQ: PQConfig{
226
+ Enabled: DefaultPQEnabled,
227
+ BitCompression: DefaultPQBitCompression,
228
+ Segments: DefaultPQSegments,
229
+ Centroids: DefaultPQCentroids,
230
+ TrainingLimit: DefaultPQTrainingLimit,
231
+ Encoder: PQEncoder{
232
+ Type: DefaultPQEncoderType,
233
+ Distribution: DefaultPQEncoderDistribution,
234
+ },
235
+ },
236
+ SQ: SQConfig{
237
+ Enabled: DefaultSQEnabled,
238
+ TrainingLimit: DefaultSQTrainingLimit,
239
+ RescoreLimit: DefaultSQRescoreLimit,
240
+ },
241
+ RQ: RQConfig{
242
+ Enabled: DefaultRQEnabled,
243
+ Bits: DefaultRQBits,
244
+ RescoreLimit: DefaultRQRescoreLimit,
245
+ },
246
+ FilterStrategy: DefaultFilterStrategy,
247
+ Multivector: MultivectorConfig{
248
+ Enabled: DefaultMultivectorEnabled,
249
+ Aggregation: DefaultMultivectorAggregation,
250
+ MuveraConfig: MuveraConfig{
251
+ Enabled: DefaultMultivectorMuveraEnabled,
252
+ KSim: DefaultMultivectorKSim,
253
+ DProjections: DefaultMultivectorDProjections,
254
+ Repetitions: DefaultMultivectorRepetitions,
255
+ },
256
+ },
257
+ },
258
+ },
259
+
260
+ {
261
+ name: "with all optional fields",
262
+ input: map[string]interface{}{
263
+ "cleanupIntervalSeconds": json.Number("11"),
264
+ "maxConnections": json.Number("12"),
265
+ "efConstruction": json.Number("13"),
266
+ "vectorCacheMaxObjects": json.Number("14"),
267
+ "ef": json.Number("15"),
268
+ "flatSearchCutoff": json.Number("16"),
269
+ "dynamicEfMin": json.Number("17"),
270
+ "dynamicEfMax": json.Number("18"),
271
+ "dynamicEfFactor": json.Number("19"),
272
+ "skip": true,
273
+ "distance": "hamming",
274
+ "filterStrategy": "sweeping",
275
+ },
276
+ expected: UserConfig{
277
+ CleanupIntervalSeconds: 11,
278
+ MaxConnections: 12,
279
+ EFConstruction: 13,
280
+ VectorCacheMaxObjects: 14,
281
+ EF: 15,
282
+ FlatSearchCutoff: 16,
283
+ DynamicEFMin: 17,
284
+ DynamicEFMax: 18,
285
+ DynamicEFFactor: 19,
286
+ Skip: true,
287
+ Distance: "hamming",
288
+ PQ: PQConfig{
289
+ Enabled: DefaultPQEnabled,
290
+ BitCompression: DefaultPQBitCompression,
291
+ Segments: DefaultPQSegments,
292
+ Centroids: DefaultPQCentroids,
293
+ TrainingLimit: DefaultPQTrainingLimit,
294
+ Encoder: PQEncoder{
295
+ Type: DefaultPQEncoderType,
296
+ Distribution: DefaultPQEncoderDistribution,
297
+ },
298
+ },
299
+ SQ: SQConfig{
300
+ Enabled: DefaultSQEnabled,
301
+ TrainingLimit: DefaultSQTrainingLimit,
302
+ RescoreLimit: DefaultSQRescoreLimit,
303
+ },
304
+ RQ: RQConfig{
305
+ Enabled: DefaultRQEnabled,
306
+ Bits: DefaultRQBits,
307
+ RescoreLimit: DefaultRQRescoreLimit,
308
+ },
309
+ FilterStrategy: DefaultFilterStrategy,
310
+ Multivector: MultivectorConfig{
311
+ Enabled: DefaultMultivectorEnabled,
312
+ Aggregation: DefaultMultivectorAggregation,
313
+ MuveraConfig: MuveraConfig{
314
+ Enabled: DefaultMultivectorMuveraEnabled,
315
+ KSim: DefaultMultivectorKSim,
316
+ DProjections: DefaultMultivectorDProjections,
317
+ Repetitions: DefaultMultivectorRepetitions,
318
+ },
319
+ },
320
+ },
321
+ },
322
+
323
+ {
324
+ // opposed to from the API
325
+ name: "with raw data as floats",
326
+ input: map[string]interface{}{
327
+ "cleanupIntervalSeconds": float64(11),
328
+ "maxConnections": float64(12),
329
+ "efConstruction": float64(13),
330
+ "vectorCacheMaxObjects": float64(14),
331
+ "ef": float64(15),
332
+ "flatSearchCutoff": float64(16),
333
+ "dynamicEfMin": float64(17),
334
+ "dynamicEfMax": float64(18),
335
+ "dynamicEfFactor": float64(19),
336
+ },
337
+ expected: UserConfig{
338
+ CleanupIntervalSeconds: 11,
339
+ MaxConnections: 12,
340
+ EFConstruction: 13,
341
+ VectorCacheMaxObjects: 14,
342
+ EF: 15,
343
+ FlatSearchCutoff: 16,
344
+ DynamicEFMin: 17,
345
+ DynamicEFMax: 18,
346
+ DynamicEFFactor: 19,
347
+ Distance: common.DefaultDistanceMetric,
348
+ PQ: PQConfig{
349
+ Enabled: DefaultPQEnabled,
350
+ BitCompression: DefaultPQBitCompression,
351
+ Segments: DefaultPQSegments,
352
+ Centroids: DefaultPQCentroids,
353
+ TrainingLimit: DefaultPQTrainingLimit,
354
+ Encoder: PQEncoder{
355
+ Type: DefaultPQEncoderType,
356
+ Distribution: DefaultPQEncoderDistribution,
357
+ },
358
+ },
359
+ SQ: SQConfig{
360
+ Enabled: DefaultSQEnabled,
361
+ TrainingLimit: DefaultSQTrainingLimit,
362
+ RescoreLimit: DefaultSQRescoreLimit,
363
+ },
364
+ RQ: RQConfig{
365
+ Enabled: DefaultRQEnabled,
366
+ Bits: DefaultRQBits,
367
+ RescoreLimit: DefaultRQRescoreLimit,
368
+ },
369
+ FilterStrategy: DefaultFilterStrategy,
370
+ Multivector: MultivectorConfig{
371
+ Enabled: DefaultMultivectorEnabled,
372
+ Aggregation: DefaultMultivectorAggregation,
373
+ MuveraConfig: MuveraConfig{
374
+ Enabled: DefaultMultivectorMuveraEnabled,
375
+ KSim: DefaultMultivectorKSim,
376
+ DProjections: DefaultMultivectorDProjections,
377
+ Repetitions: DefaultMultivectorRepetitions,
378
+ },
379
+ },
380
+ },
381
+ },
382
+
383
+ {
384
+ name: "with pq tile normal encoder",
385
+ input: map[string]interface{}{
386
+ "cleanupIntervalSeconds": float64(11),
387
+ "maxConnections": float64(12),
388
+ "efConstruction": float64(13),
389
+ "vectorCacheMaxObjects": float64(14),
390
+ "ef": float64(15),
391
+ "flatSearchCutoff": float64(16),
392
+ "dynamicEfMin": float64(17),
393
+ "dynamicEfMax": float64(18),
394
+ "dynamicEfFactor": float64(19),
395
+ "pq": map[string]interface{}{
396
+ "enabled": true,
397
+ "bitCompression": false,
398
+ "segments": float64(64),
399
+ "centroids": float64(DefaultPQCentroids),
400
+ "trainingLimit": float64(DefaultPQTrainingLimit),
401
+ "encoder": map[string]interface{}{
402
+ "type": "tile",
403
+ "distribution": "normal",
404
+ },
405
+ },
406
+ },
407
+ expected: UserConfig{
408
+ CleanupIntervalSeconds: 11,
409
+ MaxConnections: 12,
410
+ EFConstruction: 13,
411
+ VectorCacheMaxObjects: 14,
412
+ EF: 15,
413
+ FlatSearchCutoff: 16,
414
+ DynamicEFMin: 17,
415
+ DynamicEFMax: 18,
416
+ DynamicEFFactor: 19,
417
+ Distance: common.DefaultDistanceMetric,
418
+ PQ: PQConfig{
419
+ Enabled: true,
420
+ Segments: 64,
421
+ Centroids: DefaultPQCentroids,
422
+ TrainingLimit: DefaultPQTrainingLimit,
423
+ Encoder: PQEncoder{
424
+ Type: "tile",
425
+ Distribution: "normal",
426
+ },
427
+ },
428
+ SQ: SQConfig{
429
+ Enabled: DefaultSQEnabled,
430
+ TrainingLimit: DefaultSQTrainingLimit,
431
+ RescoreLimit: DefaultSQRescoreLimit,
432
+ },
433
+ RQ: RQConfig{
434
+ Enabled: DefaultRQEnabled,
435
+ Bits: DefaultRQBits,
436
+ RescoreLimit: DefaultRQRescoreLimit,
437
+ },
438
+ FilterStrategy: DefaultFilterStrategy,
439
+ Multivector: MultivectorConfig{
440
+ Enabled: DefaultMultivectorEnabled,
441
+ Aggregation: DefaultMultivectorAggregation,
442
+ MuveraConfig: MuveraConfig{
443
+ Enabled: DefaultMultivectorMuveraEnabled,
444
+ KSim: DefaultMultivectorKSim,
445
+ DProjections: DefaultMultivectorDProjections,
446
+ Repetitions: DefaultMultivectorRepetitions,
447
+ },
448
+ },
449
+ },
450
+ },
451
+
452
+ {
453
+ name: "with pq kmeans normal encoder",
454
+ input: map[string]interface{}{
455
+ "cleanupIntervalSeconds": float64(11),
456
+ "maxConnections": float64(12),
457
+ "efConstruction": float64(13),
458
+ "vectorCacheMaxObjects": float64(14),
459
+ "ef": float64(15),
460
+ "flatSearchCutoff": float64(16),
461
+ "dynamicEfMin": float64(17),
462
+ "dynamicEfMax": float64(18),
463
+ "dynamicEfFactor": float64(19),
464
+ "pq": map[string]interface{}{
465
+ "enabled": true,
466
+ "bitCompression": false,
467
+ "segments": float64(64),
468
+ "centroids": float64(DefaultPQCentroids),
469
+ "trainingLimit": float64(DefaultPQTrainingLimit),
470
+ "encoder": map[string]interface{}{
471
+ "type": PQEncoderTypeKMeans,
472
+ },
473
+ },
474
+ },
475
+ expected: UserConfig{
476
+ CleanupIntervalSeconds: 11,
477
+ MaxConnections: 12,
478
+ EFConstruction: 13,
479
+ VectorCacheMaxObjects: 14,
480
+ EF: 15,
481
+ FlatSearchCutoff: 16,
482
+ DynamicEFMin: 17,
483
+ DynamicEFMax: 18,
484
+ DynamicEFFactor: 19,
485
+ Distance: common.DefaultDistanceMetric,
486
+ PQ: PQConfig{
487
+ Enabled: true,
488
+ Segments: 64,
489
+ Centroids: DefaultPQCentroids,
490
+ TrainingLimit: DefaultPQTrainingLimit,
491
+ Encoder: PQEncoder{
492
+ Type: DefaultPQEncoderType,
493
+ Distribution: DefaultPQEncoderDistribution,
494
+ },
495
+ },
496
+ SQ: SQConfig{
497
+ Enabled: DefaultSQEnabled,
498
+ TrainingLimit: DefaultSQTrainingLimit,
499
+ RescoreLimit: DefaultSQRescoreLimit,
500
+ },
501
+ RQ: RQConfig{
502
+ Enabled: DefaultRQEnabled,
503
+ Bits: DefaultRQBits,
504
+ RescoreLimit: DefaultRQRescoreLimit,
505
+ },
506
+ FilterStrategy: DefaultFilterStrategy,
507
+ Multivector: MultivectorConfig{
508
+ Enabled: DefaultMultivectorEnabled,
509
+ Aggregation: DefaultMultivectorAggregation,
510
+ MuveraConfig: MuveraConfig{
511
+ Enabled: DefaultMultivectorMuveraEnabled,
512
+ KSim: DefaultMultivectorKSim,
513
+ DProjections: DefaultMultivectorDProjections,
514
+ Repetitions: DefaultMultivectorRepetitions,
515
+ },
516
+ },
517
+ },
518
+ },
519
+
520
+ {
521
+ name: "with invalid encoder",
522
+ input: map[string]interface{}{
523
+ "pq": map[string]interface{}{
524
+ "enabled": true,
525
+ "encoder": map[string]interface{}{
526
+ "type": "bernoulli",
527
+ },
528
+ },
529
+ },
530
+ expectErr: true,
531
+ expectErrMsg: "invalid encoder type bernoulli",
532
+ },
533
+
534
+ {
535
+ name: "with invalid distribution",
536
+ input: map[string]interface{}{
537
+ "pq": map[string]interface{}{
538
+ "enabled": true,
539
+ "encoder": map[string]interface{}{
540
+ "distribution": "lognormal",
541
+ },
542
+ },
543
+ },
544
+ expectErr: true,
545
+ expectErrMsg: "invalid encoder distribution lognormal",
546
+ },
547
+
548
+ {
549
+ // opposed to from the API
550
+ name: "with rounded vectorCacheMaxObjects that would otherwise overflow",
551
+ input: map[string]interface{}{
552
+ "cleanupIntervalSeconds": json.Number("11"),
553
+ "maxConnections": json.Number("12"),
554
+ "efConstruction": json.Number("13"),
555
+ "vectorCacheMaxObjects": json.Number("9223372036854776000"),
556
+ "ef": json.Number("15"),
557
+ "flatSearchCutoff": json.Number("16"),
558
+ "dynamicEfMin": json.Number("17"),
559
+ "dynamicEfMax": json.Number("18"),
560
+ "dynamicEfFactor": json.Number("19"),
561
+ },
562
+ expected: UserConfig{
563
+ CleanupIntervalSeconds: 11,
564
+ MaxConnections: 12,
565
+ EFConstruction: 13,
566
+ VectorCacheMaxObjects: math.MaxInt64,
567
+ EF: 15,
568
+ FlatSearchCutoff: 16,
569
+ DynamicEFMin: 17,
570
+ DynamicEFMax: 18,
571
+ DynamicEFFactor: 19,
572
+ Distance: common.DefaultDistanceMetric,
573
+ PQ: PQConfig{
574
+ Enabled: DefaultPQEnabled,
575
+ BitCompression: DefaultPQBitCompression,
576
+ Segments: DefaultPQSegments,
577
+ Centroids: DefaultPQCentroids,
578
+ TrainingLimit: DefaultPQTrainingLimit,
579
+ Encoder: PQEncoder{
580
+ Type: DefaultPQEncoderType,
581
+ Distribution: DefaultPQEncoderDistribution,
582
+ },
583
+ },
584
+ SQ: SQConfig{
585
+ Enabled: DefaultSQEnabled,
586
+ TrainingLimit: DefaultSQTrainingLimit,
587
+ RescoreLimit: DefaultSQRescoreLimit,
588
+ },
589
+ RQ: RQConfig{
590
+ Enabled: DefaultRQEnabled,
591
+ Bits: DefaultRQBits,
592
+ RescoreLimit: DefaultRQRescoreLimit,
593
+ },
594
+ FilterStrategy: DefaultFilterStrategy,
595
+ Multivector: MultivectorConfig{
596
+ Enabled: DefaultMultivectorEnabled,
597
+ Aggregation: DefaultMultivectorAggregation,
598
+ MuveraConfig: MuveraConfig{
599
+ Enabled: DefaultMultivectorMuveraEnabled,
600
+ KSim: DefaultMultivectorKSim,
601
+ DProjections: DefaultMultivectorDProjections,
602
+ Repetitions: DefaultMultivectorRepetitions,
603
+ },
604
+ },
605
+ },
606
+ },
607
+ {
608
+ name: "invalid max connections (json)",
609
+ input: map[string]interface{}{
610
+ "maxConnections": json.Number("0"),
611
+ },
612
+ expectErr: true,
613
+ expectErrMsg: "maxConnections must be a positive integer " +
614
+ "with a minimum of 4",
615
+ },
616
+ {
617
+ name: "invalid max connections (float)",
618
+ input: map[string]interface{}{
619
+ "maxConnections": float64(3),
620
+ },
621
+ expectErr: true,
622
+ expectErrMsg: "maxConnections must be a positive integer " +
623
+ "with a minimum of 4",
624
+ },
625
+ {
626
+ name: "invalid efConstruction (json)",
627
+ input: map[string]interface{}{
628
+ "efConstruction": json.Number("0"),
629
+ },
630
+ expectErr: true,
631
+ expectErrMsg: "efConstruction must be a positive integer " +
632
+ "with a minimum of 4",
633
+ },
634
+ {
635
+ name: "invalid efConstruction (float)",
636
+ input: map[string]interface{}{
637
+ "efConstruction": float64(3),
638
+ },
639
+ expectErr: true,
640
+ expectErrMsg: "efConstruction must be a positive integer " +
641
+ "with a minimum of 4",
642
+ },
643
+ {
644
+ name: "with bq",
645
+ input: map[string]interface{}{
646
+ "cleanupIntervalSeconds": float64(11),
647
+ "maxConnections": float64(12),
648
+ "efConstruction": float64(13),
649
+ "vectorCacheMaxObjects": float64(14),
650
+ "ef": float64(15),
651
+ "flatSearchCutoff": float64(16),
652
+ "dynamicEfMin": float64(17),
653
+ "dynamicEfMax": float64(18),
654
+ "dynamicEfFactor": float64(19),
655
+ "bq": map[string]interface{}{
656
+ "enabled": true,
657
+ },
658
+ },
659
+ expected: UserConfig{
660
+ CleanupIntervalSeconds: 11,
661
+ MaxConnections: 12,
662
+ EFConstruction: 13,
663
+ VectorCacheMaxObjects: 14,
664
+ EF: 15,
665
+ FlatSearchCutoff: 16,
666
+ DynamicEFMin: 17,
667
+ DynamicEFMax: 18,
668
+ DynamicEFFactor: 19,
669
+ Distance: common.DefaultDistanceMetric,
670
+ PQ: PQConfig{
671
+ Enabled: false,
672
+ Segments: 0,
673
+ Centroids: DefaultPQCentroids,
674
+ TrainingLimit: DefaultPQTrainingLimit,
675
+ Encoder: PQEncoder{
676
+ Type: DefaultPQEncoderType,
677
+ Distribution: DefaultPQEncoderDistribution,
678
+ },
679
+ },
680
+ BQ: BQConfig{
681
+ Enabled: true,
682
+ },
683
+ SQ: SQConfig{
684
+ Enabled: DefaultSQEnabled,
685
+ TrainingLimit: DefaultSQTrainingLimit,
686
+ RescoreLimit: DefaultSQRescoreLimit,
687
+ },
688
+ RQ: RQConfig{
689
+ Enabled: DefaultRQEnabled,
690
+ Bits: DefaultRQBits,
691
+ RescoreLimit: DefaultRQRescoreLimit,
692
+ },
693
+ FilterStrategy: DefaultFilterStrategy,
694
+ Multivector: MultivectorConfig{
695
+ Enabled: DefaultMultivectorEnabled,
696
+ Aggregation: DefaultMultivectorAggregation,
697
+ MuveraConfig: MuveraConfig{
698
+ Enabled: DefaultMultivectorMuveraEnabled,
699
+ KSim: DefaultMultivectorKSim,
700
+ DProjections: DefaultMultivectorDProjections,
701
+ Repetitions: DefaultMultivectorRepetitions,
702
+ },
703
+ },
704
+ },
705
+ },
706
+ {
707
+ name: "with sq",
708
+ input: map[string]interface{}{
709
+ "cleanupIntervalSeconds": float64(11),
710
+ "maxConnections": float64(12),
711
+ "efConstruction": float64(13),
712
+ "vectorCacheMaxObjects": float64(14),
713
+ "ef": float64(15),
714
+ "flatSearchCutoff": float64(16),
715
+ "dynamicEfMin": float64(17),
716
+ "dynamicEfMax": float64(18),
717
+ "dynamicEfFactor": float64(19),
718
+ "sq": map[string]interface{}{
719
+ "enabled": true,
720
+ },
721
+ },
722
+ expected: UserConfig{
723
+ CleanupIntervalSeconds: 11,
724
+ MaxConnections: 12,
725
+ EFConstruction: 13,
726
+ VectorCacheMaxObjects: 14,
727
+ EF: 15,
728
+ FlatSearchCutoff: 16,
729
+ DynamicEFMin: 17,
730
+ DynamicEFMax: 18,
731
+ DynamicEFFactor: 19,
732
+ Distance: common.DefaultDistanceMetric,
733
+ PQ: PQConfig{
734
+ Enabled: false,
735
+ Segments: 0,
736
+ Centroids: DefaultPQCentroids,
737
+ TrainingLimit: DefaultPQTrainingLimit,
738
+ Encoder: PQEncoder{
739
+ Type: DefaultPQEncoderType,
740
+ Distribution: DefaultPQEncoderDistribution,
741
+ },
742
+ },
743
+ SQ: SQConfig{
744
+ Enabled: true,
745
+ TrainingLimit: DefaultSQTrainingLimit,
746
+ RescoreLimit: DefaultSQRescoreLimit,
747
+ },
748
+ RQ: RQConfig{
749
+ Enabled: DefaultRQEnabled,
750
+ Bits: DefaultRQBits,
751
+ RescoreLimit: DefaultRQRescoreLimit,
752
+ },
753
+ FilterStrategy: DefaultFilterStrategy,
754
+ Multivector: MultivectorConfig{
755
+ Enabled: DefaultMultivectorEnabled,
756
+ Aggregation: DefaultMultivectorAggregation,
757
+ MuveraConfig: MuveraConfig{
758
+ Enabled: DefaultMultivectorMuveraEnabled,
759
+ KSim: DefaultMultivectorKSim,
760
+ DProjections: DefaultMultivectorDProjections,
761
+ Repetitions: DefaultMultivectorRepetitions,
762
+ },
763
+ },
764
+ },
765
+ },
766
+ {
767
+ name: "with invalid compression",
768
+ input: map[string]interface{}{
769
+ "pq": map[string]interface{}{
770
+ "enabled": true,
771
+ "encoder": map[string]interface{}{
772
+ "type": "kmeans",
773
+ },
774
+ },
775
+ "bq": map[string]interface{}{
776
+ "enabled": true,
777
+ },
778
+ },
779
+ expectErr: true,
780
+ expectErrMsg: "invalid hnsw config: more than a single compression methods enabled",
781
+ },
782
+ {
783
+ name: "with invalid filter strategy",
784
+ input: map[string]interface{}{
785
+ "filterStrategy": "chestnut",
786
+ },
787
+ expectErr: true,
788
+ expectErrMsg: "invalid hnsw config: filterStrategy must be either 'sweeping' or 'acorn'",
789
+ },
790
+ {
791
+ name: "acorn enabled, all defaults",
792
+ input: map[string]interface{}{
793
+ "filterStrategy": "acorn",
794
+ },
795
+ expected: UserConfig{
796
+ CleanupIntervalSeconds: DefaultCleanupIntervalSeconds,
797
+ MaxConnections: DefaultMaxConnections,
798
+ EFConstruction: DefaultEFConstruction,
799
+ VectorCacheMaxObjects: common.DefaultVectorCacheMaxObjects,
800
+ EF: DefaultEF,
801
+ Skip: DefaultSkip,
802
+ FlatSearchCutoff: DefaultFlatSearchCutoff,
803
+ DynamicEFMin: DefaultDynamicEFMin,
804
+ DynamicEFMax: DefaultDynamicEFMax,
805
+ DynamicEFFactor: DefaultDynamicEFFactor,
806
+ Distance: common.DefaultDistanceMetric,
807
+ PQ: PQConfig{
808
+ Enabled: DefaultPQEnabled,
809
+ BitCompression: DefaultPQBitCompression,
810
+ Segments: DefaultPQSegments,
811
+ Centroids: DefaultPQCentroids,
812
+ TrainingLimit: DefaultPQTrainingLimit,
813
+ Encoder: PQEncoder{
814
+ Type: DefaultPQEncoderType,
815
+ Distribution: DefaultPQEncoderDistribution,
816
+ },
817
+ },
818
+ SQ: SQConfig{
819
+ Enabled: DefaultSQEnabled,
820
+ TrainingLimit: DefaultSQTrainingLimit,
821
+ RescoreLimit: DefaultSQRescoreLimit,
822
+ },
823
+ RQ: RQConfig{
824
+ Enabled: DefaultRQEnabled,
825
+ Bits: DefaultRQBits,
826
+ RescoreLimit: DefaultRQRescoreLimit,
827
+ },
828
+ FilterStrategy: FilterStrategyAcorn,
829
+ Multivector: MultivectorConfig{
830
+ Enabled: DefaultMultivectorEnabled,
831
+ Aggregation: DefaultMultivectorAggregation,
832
+ MuveraConfig: MuveraConfig{
833
+ Enabled: DefaultMultivectorMuveraEnabled,
834
+ KSim: DefaultMultivectorKSim,
835
+ DProjections: DefaultMultivectorDProjections,
836
+ Repetitions: DefaultMultivectorRepetitions,
837
+ },
838
+ },
839
+ },
840
+ },
841
+ {
842
+ name: "max connections at maximum allowed value (2047)",
843
+ input: map[string]interface{}{
844
+ "maxConnections": json.Number("2047"),
845
+ },
846
+ expected: UserConfig{
847
+ CleanupIntervalSeconds: DefaultCleanupIntervalSeconds,
848
+ MaxConnections: 2047,
849
+ EFConstruction: DefaultEFConstruction,
850
+ VectorCacheMaxObjects: common.DefaultVectorCacheMaxObjects,
851
+ EF: DefaultEF,
852
+ Skip: DefaultSkip,
853
+ FlatSearchCutoff: DefaultFlatSearchCutoff,
854
+ DynamicEFMin: DefaultDynamicEFMin,
855
+ DynamicEFMax: DefaultDynamicEFMax,
856
+ DynamicEFFactor: DefaultDynamicEFFactor,
857
+ Distance: common.DefaultDistanceMetric,
858
+ PQ: PQConfig{
859
+ Enabled: DefaultPQEnabled,
860
+ BitCompression: DefaultPQBitCompression,
861
+ Segments: DefaultPQSegments,
862
+ Centroids: DefaultPQCentroids,
863
+ TrainingLimit: DefaultPQTrainingLimit,
864
+ Encoder: PQEncoder{
865
+ Type: DefaultPQEncoderType,
866
+ Distribution: DefaultPQEncoderDistribution,
867
+ },
868
+ },
869
+ SQ: SQConfig{
870
+ Enabled: DefaultSQEnabled,
871
+ TrainingLimit: DefaultSQTrainingLimit,
872
+ RescoreLimit: DefaultSQRescoreLimit,
873
+ },
874
+ RQ: RQConfig{
875
+ Enabled: DefaultRQEnabled,
876
+ Bits: DefaultRQBits,
877
+ RescoreLimit: DefaultRQRescoreLimit,
878
+ },
879
+ FilterStrategy: DefaultFilterStrategy,
880
+ Multivector: MultivectorConfig{
881
+ Enabled: DefaultMultivectorEnabled,
882
+ Aggregation: DefaultMultivectorAggregation,
883
+ MuveraConfig: MuveraConfig{
884
+ Enabled: DefaultMultivectorMuveraEnabled,
885
+ KSim: DefaultMultivectorKSim,
886
+ DProjections: DefaultMultivectorDProjections,
887
+ Repetitions: DefaultMultivectorRepetitions,
888
+ },
889
+ },
890
+ },
891
+ },
892
+ {
893
+ name: "max connections exceeds maximum allowed value (2048)",
894
+ input: map[string]interface{}{
895
+ "maxConnections": json.Number("2048"),
896
+ },
897
+ expectErr: true,
898
+ expectErrMsg: "maxConnections must be less than 2048",
899
+ },
900
+ {
901
+ name: "with rq defaults",
902
+ input: map[string]interface{}{
903
+ "rq": map[string]interface{}{
904
+ "enabled": true,
905
+ },
906
+ },
907
+ expected: UserConfig{
908
+ CleanupIntervalSeconds: DefaultCleanupIntervalSeconds,
909
+ MaxConnections: DefaultMaxConnections,
910
+ EFConstruction: DefaultEFConstruction,
911
+ VectorCacheMaxObjects: common.DefaultVectorCacheMaxObjects,
912
+ EF: DefaultEF,
913
+ Skip: DefaultSkip,
914
+ FlatSearchCutoff: DefaultFlatSearchCutoff,
915
+ DynamicEFMin: DefaultDynamicEFMin,
916
+ DynamicEFMax: DefaultDynamicEFMax,
917
+ DynamicEFFactor: DefaultDynamicEFFactor,
918
+ Distance: common.DefaultDistanceMetric,
919
+ PQ: PQConfig{
920
+ Enabled: DefaultPQEnabled,
921
+ BitCompression: DefaultPQBitCompression,
922
+ Segments: DefaultPQSegments,
923
+ Centroids: DefaultPQCentroids,
924
+ TrainingLimit: DefaultPQTrainingLimit,
925
+ Encoder: PQEncoder{
926
+ Type: DefaultPQEncoderType,
927
+ Distribution: DefaultPQEncoderDistribution,
928
+ },
929
+ },
930
+ SQ: SQConfig{
931
+ Enabled: DefaultSQEnabled,
932
+ TrainingLimit: DefaultSQTrainingLimit,
933
+ RescoreLimit: DefaultSQRescoreLimit,
934
+ },
935
+ RQ: RQConfig{
936
+ Enabled: true,
937
+ Bits: DefaultRQBits,
938
+ RescoreLimit: DefaultRQRescoreLimit,
939
+ },
940
+ FilterStrategy: DefaultFilterStrategy,
941
+ Multivector: MultivectorConfig{
942
+ Enabled: DefaultMultivectorEnabled,
943
+ Aggregation: DefaultMultivectorAggregation,
944
+ MuveraConfig: MuveraConfig{
945
+ Enabled: DefaultMultivectorMuveraEnabled,
946
+ KSim: DefaultMultivectorKSim,
947
+ DProjections: DefaultMultivectorDProjections,
948
+ Repetitions: DefaultMultivectorRepetitions,
949
+ },
950
+ },
951
+ },
952
+ },
953
+ {
954
+ name: "with rq 8 and rescore limit 0",
955
+ input: map[string]interface{}{
956
+ "rq": map[string]interface{}{
957
+ "enabled": true,
958
+ "bits": float64(8),
959
+ "rescoreLimit": float64(0),
960
+ },
961
+ },
962
+ expected: UserConfig{
963
+ CleanupIntervalSeconds: DefaultCleanupIntervalSeconds,
964
+ MaxConnections: DefaultMaxConnections,
965
+ EFConstruction: DefaultEFConstruction,
966
+ VectorCacheMaxObjects: common.DefaultVectorCacheMaxObjects,
967
+ EF: DefaultEF,
968
+ Skip: DefaultSkip,
969
+ FlatSearchCutoff: DefaultFlatSearchCutoff,
970
+ DynamicEFMin: DefaultDynamicEFMin,
971
+ DynamicEFMax: DefaultDynamicEFMax,
972
+ DynamicEFFactor: DefaultDynamicEFFactor,
973
+ Distance: common.DefaultDistanceMetric,
974
+ PQ: PQConfig{
975
+ Enabled: DefaultPQEnabled,
976
+ BitCompression: DefaultPQBitCompression,
977
+ Segments: DefaultPQSegments,
978
+ Centroids: DefaultPQCentroids,
979
+ TrainingLimit: DefaultPQTrainingLimit,
980
+ Encoder: PQEncoder{
981
+ Type: DefaultPQEncoderType,
982
+ Distribution: DefaultPQEncoderDistribution,
983
+ },
984
+ },
985
+ SQ: SQConfig{
986
+ Enabled: DefaultSQEnabled,
987
+ TrainingLimit: DefaultSQTrainingLimit,
988
+ RescoreLimit: DefaultSQRescoreLimit,
989
+ },
990
+ RQ: RQConfig{
991
+ Enabled: true,
992
+ Bits: DefaultRQBits,
993
+ RescoreLimit: 0,
994
+ },
995
+ FilterStrategy: DefaultFilterStrategy,
996
+ Multivector: MultivectorConfig{
997
+ Enabled: DefaultMultivectorEnabled,
998
+ Aggregation: DefaultMultivectorAggregation,
999
+ MuveraConfig: MuveraConfig{
1000
+ Enabled: DefaultMultivectorMuveraEnabled,
1001
+ KSim: DefaultMultivectorKSim,
1002
+ DProjections: DefaultMultivectorDProjections,
1003
+ Repetitions: DefaultMultivectorRepetitions,
1004
+ },
1005
+ },
1006
+ },
1007
+ },
1008
+ {
1009
+ name: "with rq 1",
1010
+ input: map[string]interface{}{
1011
+ "rq": map[string]interface{}{
1012
+ "enabled": true,
1013
+ "bits": float64(1),
1014
+ },
1015
+ },
1016
+ expected: UserConfig{
1017
+ CleanupIntervalSeconds: DefaultCleanupIntervalSeconds,
1018
+ MaxConnections: DefaultMaxConnections,
1019
+ EFConstruction: DefaultEFConstruction,
1020
+ VectorCacheMaxObjects: common.DefaultVectorCacheMaxObjects,
1021
+ EF: DefaultEF,
1022
+ Skip: DefaultSkip,
1023
+ FlatSearchCutoff: DefaultFlatSearchCutoff,
1024
+ DynamicEFMin: DefaultDynamicEFMin,
1025
+ DynamicEFMax: DefaultDynamicEFMax,
1026
+ DynamicEFFactor: DefaultDynamicEFFactor,
1027
+ Distance: common.DefaultDistanceMetric,
1028
+ PQ: PQConfig{
1029
+ Enabled: DefaultPQEnabled,
1030
+ BitCompression: DefaultPQBitCompression,
1031
+ Segments: DefaultPQSegments,
1032
+ Centroids: DefaultPQCentroids,
1033
+ TrainingLimit: DefaultPQTrainingLimit,
1034
+ Encoder: PQEncoder{
1035
+ Type: DefaultPQEncoderType,
1036
+ Distribution: DefaultPQEncoderDistribution,
1037
+ },
1038
+ },
1039
+ SQ: SQConfig{
1040
+ Enabled: DefaultSQEnabled,
1041
+ TrainingLimit: DefaultSQTrainingLimit,
1042
+ RescoreLimit: DefaultSQRescoreLimit,
1043
+ },
1044
+ RQ: RQConfig{
1045
+ Enabled: true,
1046
+ Bits: 1,
1047
+ RescoreLimit: DefaultBRQRescoreLimit,
1048
+ },
1049
+ FilterStrategy: DefaultFilterStrategy,
1050
+ Multivector: MultivectorConfig{
1051
+ Enabled: DefaultMultivectorEnabled,
1052
+ Aggregation: DefaultMultivectorAggregation,
1053
+ MuveraConfig: MuveraConfig{
1054
+ Enabled: DefaultMultivectorMuveraEnabled,
1055
+ KSim: DefaultMultivectorKSim,
1056
+ DProjections: DefaultMultivectorDProjections,
1057
+ Repetitions: DefaultMultivectorRepetitions,
1058
+ },
1059
+ },
1060
+ },
1061
+ },
1062
+ {
1063
+ name: "with rq 1 and rescore limit 100",
1064
+ input: map[string]interface{}{
1065
+ "rq": map[string]interface{}{
1066
+ "enabled": true,
1067
+ "bits": float64(1),
1068
+ "rescoreLimit": float64(100),
1069
+ },
1070
+ },
1071
+ expected: UserConfig{
1072
+ CleanupIntervalSeconds: DefaultCleanupIntervalSeconds,
1073
+ MaxConnections: DefaultMaxConnections,
1074
+ EFConstruction: DefaultEFConstruction,
1075
+ VectorCacheMaxObjects: common.DefaultVectorCacheMaxObjects,
1076
+ EF: DefaultEF,
1077
+ Skip: DefaultSkip,
1078
+ FlatSearchCutoff: DefaultFlatSearchCutoff,
1079
+ DynamicEFMin: DefaultDynamicEFMin,
1080
+ DynamicEFMax: DefaultDynamicEFMax,
1081
+ DynamicEFFactor: DefaultDynamicEFFactor,
1082
+ Distance: common.DefaultDistanceMetric,
1083
+ PQ: PQConfig{
1084
+ Enabled: DefaultPQEnabled,
1085
+ BitCompression: DefaultPQBitCompression,
1086
+ Segments: DefaultPQSegments,
1087
+ Centroids: DefaultPQCentroids,
1088
+ TrainingLimit: DefaultPQTrainingLimit,
1089
+ Encoder: PQEncoder{
1090
+ Type: DefaultPQEncoderType,
1091
+ Distribution: DefaultPQEncoderDistribution,
1092
+ },
1093
+ },
1094
+ SQ: SQConfig{
1095
+ Enabled: DefaultSQEnabled,
1096
+ TrainingLimit: DefaultSQTrainingLimit,
1097
+ RescoreLimit: DefaultSQRescoreLimit,
1098
+ },
1099
+ RQ: RQConfig{
1100
+ Enabled: true,
1101
+ Bits: 1,
1102
+ RescoreLimit: 100,
1103
+ },
1104
+ FilterStrategy: DefaultFilterStrategy,
1105
+ Multivector: MultivectorConfig{
1106
+ Enabled: DefaultMultivectorEnabled,
1107
+ Aggregation: DefaultMultivectorAggregation,
1108
+ MuveraConfig: MuveraConfig{
1109
+ Enabled: DefaultMultivectorMuveraEnabled,
1110
+ KSim: DefaultMultivectorKSim,
1111
+ DProjections: DefaultMultivectorDProjections,
1112
+ Repetitions: DefaultMultivectorRepetitions,
1113
+ },
1114
+ },
1115
+ },
1116
+ },
1117
+ }
1118
+
1119
+ for _, test := range tests {
1120
+ t.Run(test.name, func(t *testing.T) {
1121
+ cfg, err := ParseAndValidateConfig(test.input, false)
1122
+ if test.expectErr {
1123
+ require.NotNil(t, err)
1124
+ assert.Contains(t, err.Error(), test.expectErrMsg)
1125
+ return
1126
+ } else {
1127
+ assert.Nil(t, err)
1128
+ assert.Equal(t, test.expected, cfg)
1129
+ }
1130
+ })
1131
+ }
1132
+ }
1133
+
1134
+ func Test_UserConfigFilterStrategy(t *testing.T) {
1135
+ t.Run("default filter strategy is sweeping", func(t *testing.T) {
1136
+ cfg := UserConfig{}
1137
+ cfg.SetDefaults()
1138
+ assert.Equal(t, FilterStrategySweeping, cfg.FilterStrategy)
1139
+ })
1140
+
1141
+ t.Run("can override default strategy", func(t *testing.T) {
1142
+ os.Setenv("HNSW_DEFAULT_FILTER_STRATEGY", FilterStrategyAcorn)
1143
+ cfg := UserConfig{}
1144
+ cfg.SetDefaults()
1145
+ assert.Equal(t, FilterStrategyAcorn, cfg.FilterStrategy)
1146
+ assert.Nil(t, os.Unsetenv("HNSW_DEFAULT_FILTER_STRATEGY"))
1147
+ })
1148
+ }
platform/dbops/binaries/weaviate-src/entities/vectorindex/hnsw/multivector_config.go ADDED
@@ -0,0 +1,132 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // _ _
2
+ // __ _____ __ ___ ___ __ _| |_ ___
3
+ // \ \ /\ / / _ \/ _` \ \ / / |/ _` | __/ _ \
4
+ // \ V V / __/ (_| |\ V /| | (_| | || __/
5
+ // \_/\_/ \___|\__,_| \_/ |_|\__,_|\__\___|
6
+ //
7
+ // Copyright © 2016 - 2025 Weaviate B.V. All rights reserved.
8
+ //
9
+ // CONTACT: hello@weaviate.io
10
+ //
11
+
12
+ package hnsw
13
+
14
+ import (
15
+ "fmt"
16
+
17
+ "github.com/weaviate/weaviate/entities/vectorindex/common"
18
+ )
19
+
20
+ const (
21
+ MultivectorAggregationMaxSim = "maxSim"
22
+ )
23
+
24
+ const (
25
+ DefaultMultivectorEnabled = false
26
+ DefaultMultivectorMuveraEnabled = false
27
+ DefaultMultivectorKSim = 4
28
+ DefaultMultivectorDProjections = 16
29
+ DefaultMultivectorRepetitions = 10
30
+ DefaultMultivectorAggregation = "maxSim"
31
+ )
32
+
33
+ // Multivector configuration
34
+ type MultivectorConfig struct {
35
+ Enabled bool `json:"enabled"`
36
+ MuveraConfig MuveraConfig `json:"muvera"`
37
+ Aggregation string `json:"aggregation"`
38
+ }
39
+
40
+ type MuveraConfig struct {
41
+ Enabled bool `json:"enabled"`
42
+ KSim int `json:"ksim"`
43
+ DProjections int `json:"dprojections"`
44
+ Repetitions int `json:"repetitions"`
45
+ }
46
+
47
+ func validAggregation(v string) error {
48
+ switch v {
49
+ case MultivectorAggregationMaxSim:
50
+ default:
51
+ return fmt.Errorf("invalid aggregation type %s", v)
52
+ }
53
+
54
+ return nil
55
+ }
56
+
57
+ func ValidateMultivectorConfig(cfg MultivectorConfig) error {
58
+ if !cfg.Enabled {
59
+ return nil
60
+ }
61
+ err := validAggregation(cfg.Aggregation)
62
+ if err != nil {
63
+ return err
64
+ }
65
+
66
+ return nil
67
+ }
68
+
69
+ func parseMultivectorMap(in map[string]interface{}, multivector *MultivectorConfig, isMultiVector bool) error {
70
+ multivectorConfigValue, ok := in["multivector"]
71
+ if !ok {
72
+ return nil
73
+ }
74
+
75
+ multivectorConfigMap, ok := multivectorConfigValue.(map[string]interface{})
76
+ if !ok {
77
+ return nil
78
+ }
79
+
80
+ if err := common.OptionalBoolFromMap(multivectorConfigMap, "enabled", func(v bool) {
81
+ if isMultiVector {
82
+ // vectorizer set is a multi vector vectorizer, enable multi vector index
83
+ multivector.Enabled = true
84
+ } else {
85
+ multivector.Enabled = v
86
+ }
87
+ }); err != nil {
88
+ return err
89
+ }
90
+
91
+ muveraValue, ok := multivectorConfigMap["muvera"]
92
+ if !ok {
93
+ return nil
94
+ }
95
+
96
+ muveraMap, ok := muveraValue.(map[string]interface{})
97
+ if !ok {
98
+ return nil
99
+ }
100
+
101
+ if err := common.OptionalBoolFromMap(muveraMap, "enabled", func(v bool) {
102
+ multivector.MuveraConfig.Enabled = v
103
+ }); err != nil {
104
+ return err
105
+ }
106
+
107
+ if err := common.OptionalIntFromMap(muveraMap, "ksim", func(v int) {
108
+ multivector.MuveraConfig.KSim = v
109
+ }); err != nil {
110
+ return err
111
+ }
112
+
113
+ if err := common.OptionalIntFromMap(muveraMap, "dprojections", func(v int) {
114
+ multivector.MuveraConfig.DProjections = v
115
+ }); err != nil {
116
+ return err
117
+ }
118
+
119
+ if err := common.OptionalIntFromMap(muveraMap, "repetitions", func(v int) {
120
+ multivector.MuveraConfig.Repetitions = v
121
+ }); err != nil {
122
+ return err
123
+ }
124
+
125
+ if err := common.OptionalStringFromMap(multivectorConfigMap, "aggregation", func(v string) {
126
+ multivector.Aggregation = v
127
+ }); err != nil {
128
+ return err
129
+ }
130
+
131
+ return nil
132
+ }
platform/dbops/binaries/weaviate-src/entities/vectorindex/hnsw/pq_config.go ADDED
@@ -0,0 +1,196 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // _ _
2
+ // __ _____ __ ___ ___ __ _| |_ ___
3
+ // \ \ /\ / / _ \/ _` \ \ / / |/ _` | __/ _ \
4
+ // \ V V / __/ (_| |\ V /| | (_| | || __/
5
+ // \_/\_/ \___|\__,_| \_/ |_|\__,_|\__\___|
6
+ //
7
+ // Copyright © 2016 - 2025 Weaviate B.V. All rights reserved.
8
+ //
9
+ // CONTACT: hello@weaviate.io
10
+ //
11
+
12
+ package hnsw
13
+
14
+ import (
15
+ "fmt"
16
+
17
+ "github.com/weaviate/weaviate/entities/vectorindex/common"
18
+ )
19
+
20
+ const (
21
+ PQEncoderTypeKMeans = "kmeans"
22
+ PQEncoderTypeTile = "tile"
23
+ PQEncoderDistributionLogNormal = "log-normal"
24
+ PQEncoderDistributionNormal = "normal"
25
+ )
26
+
27
+ const (
28
+ DefaultPQEnabled = false
29
+ DefaultPQBitCompression = false
30
+ DefaultPQSegments = 0
31
+ DefaultPQEncoderType = PQEncoderTypeKMeans
32
+ DefaultPQEncoderDistribution = PQEncoderDistributionLogNormal
33
+ DefaultPQCentroids = 256
34
+ DefaultPQTrainingLimit = 100000
35
+ )
36
+
37
+ // Product Quantization encoder configuration
38
+ type PQEncoder struct {
39
+ Type string `json:"type"`
40
+ Distribution string `json:"distribution,omitempty"`
41
+ }
42
+
43
+ // Product Quantization configuration
44
+ type PQConfig struct {
45
+ Enabled bool `json:"enabled"`
46
+ BitCompression bool `json:"bitCompression"`
47
+ Segments int `json:"segments"`
48
+ Centroids int `json:"centroids"`
49
+ TrainingLimit int `json:"trainingLimit"`
50
+ Encoder PQEncoder `json:"encoder"`
51
+ }
52
+
53
+ func validEncoder(v string) error {
54
+ switch v {
55
+ case PQEncoderTypeKMeans:
56
+ case PQEncoderTypeTile:
57
+ default:
58
+ return fmt.Errorf("invalid encoder type %s", v)
59
+ }
60
+
61
+ return nil
62
+ }
63
+
64
+ func validEncoderDistribution(v string) error {
65
+ switch v {
66
+ case PQEncoderDistributionLogNormal:
67
+ case PQEncoderDistributionNormal:
68
+ default:
69
+ return fmt.Errorf("invalid encoder distribution %s", v)
70
+ }
71
+
72
+ return nil
73
+ }
74
+
75
+ func ValidatePQConfig(cfg PQConfig) error {
76
+ if !cfg.Enabled {
77
+ return nil
78
+ }
79
+ err := validEncoder(cfg.Encoder.Type)
80
+ if err != nil {
81
+ return err
82
+ }
83
+
84
+ err = validEncoderDistribution(cfg.Encoder.Distribution)
85
+ if err != nil {
86
+ return err
87
+ }
88
+
89
+ return nil
90
+ }
91
+
92
+ func encoderFromMap(in map[string]interface{}, setFn func(v string)) error {
93
+ value, ok := in["type"]
94
+ if !ok {
95
+ return nil
96
+ }
97
+
98
+ asString, ok := value.(string)
99
+ if !ok {
100
+ return nil
101
+ }
102
+
103
+ err := validEncoder(asString)
104
+ if err != nil {
105
+ return err
106
+ }
107
+
108
+ setFn(asString)
109
+ return nil
110
+ }
111
+
112
+ func encoderDistributionFromMap(in map[string]interface{}, setFn func(v string)) error {
113
+ value, ok := in["distribution"]
114
+ if !ok {
115
+ return nil
116
+ }
117
+
118
+ asString, ok := value.(string)
119
+ if !ok {
120
+ return nil
121
+ }
122
+
123
+ err := validEncoderDistribution(asString)
124
+ if err != nil {
125
+ return err
126
+ }
127
+
128
+ setFn(asString)
129
+ return nil
130
+ }
131
+
132
+ func parsePQMap(in map[string]interface{}, pq *PQConfig) error {
133
+ pqConfigValue, ok := in["pq"]
134
+ if !ok {
135
+ return nil
136
+ }
137
+
138
+ pqConfigMap, ok := pqConfigValue.(map[string]interface{})
139
+ if !ok {
140
+ return nil
141
+ }
142
+
143
+ if err := common.OptionalBoolFromMap(pqConfigMap, "enabled", func(v bool) {
144
+ pq.Enabled = v
145
+ }); err != nil {
146
+ return err
147
+ }
148
+
149
+ if err := common.OptionalBoolFromMap(pqConfigMap, "bitCompression", func(v bool) {
150
+ pq.BitCompression = v
151
+ }); err != nil {
152
+ return err
153
+ }
154
+
155
+ if err := common.OptionalIntFromMap(pqConfigMap, "segments", func(v int) {
156
+ pq.Segments = v
157
+ }); err != nil {
158
+ return err
159
+ }
160
+
161
+ if err := common.OptionalIntFromMap(pqConfigMap, "centroids", func(v int) {
162
+ pq.Centroids = v
163
+ }); err != nil {
164
+ return err
165
+ }
166
+
167
+ if err := common.OptionalIntFromMap(pqConfigMap, "trainingLimit", func(v int) {
168
+ pq.TrainingLimit = v
169
+ }); err != nil {
170
+ return err
171
+ }
172
+
173
+ pqEncoderValue, ok := pqConfigMap["encoder"]
174
+ if !ok {
175
+ return nil
176
+ }
177
+
178
+ pqEncoderMap, ok := pqEncoderValue.(map[string]interface{})
179
+ if !ok {
180
+ return nil
181
+ }
182
+
183
+ if err := encoderFromMap(pqEncoderMap, func(v string) {
184
+ pq.Encoder.Type = v
185
+ }); err != nil {
186
+ return err
187
+ }
188
+
189
+ if err := encoderDistributionFromMap(pqEncoderMap, func(v string) {
190
+ pq.Encoder.Distribution = v
191
+ }); err != nil {
192
+ return err
193
+ }
194
+
195
+ return nil
196
+ }
platform/dbops/binaries/weaviate-src/entities/vectorindex/hnsw/rq_config.go ADDED
@@ -0,0 +1,87 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // _ _
2
+ // __ _____ __ ___ ___ __ _| |_ ___
3
+ // \ \ /\ / / _ \/ _` \ \ / / |/ _` | __/ _ \
4
+ // \ V V / __/ (_| |\ V /| | (_| | || __/
5
+ // \_/\_/ \___|\__,_| \_/ |_|\__,_|\__\___|
6
+ //
7
+ // Copyright © 2016 - 2025 Weaviate B.V. All rights reserved.
8
+ //
9
+ // CONTACT: hello@weaviate.io
10
+ //
11
+
12
+ package hnsw
13
+
14
+ import (
15
+ "errors"
16
+
17
+ "github.com/weaviate/weaviate/entities/schema/config"
18
+ "github.com/weaviate/weaviate/entities/vectorindex/common"
19
+ )
20
+
21
+ const (
22
+ DefaultRQEnabled = false
23
+ DefaultRQBits = 8
24
+ DefaultRQRescoreLimit = 20
25
+ DefaultBRQRescoreLimit = 512
26
+ )
27
+
28
+ type RQConfig struct {
29
+ Enabled bool `json:"enabled"`
30
+ Bits int16 `json:"bits"`
31
+ RescoreLimit int `json:"rescoreLimit"`
32
+ }
33
+
34
+ func ValidateRQConfig(cfg RQConfig) error {
35
+ if !cfg.Enabled {
36
+ return nil
37
+ }
38
+ if cfg.Bits != 8 && cfg.Bits != 1 {
39
+ return errors.New("RQ bits must be 8 or 1")
40
+ }
41
+
42
+ return nil
43
+ }
44
+
45
+ func parseRQMap(in map[string]interface{}, rq *RQConfig) error {
46
+ rqConfigValue, ok := in["rq"]
47
+ if !ok {
48
+ return nil
49
+ }
50
+
51
+ rqConfigMap, ok := rqConfigValue.(map[string]interface{})
52
+ if !ok {
53
+ return nil
54
+ }
55
+
56
+ if err := common.OptionalBoolFromMap(rqConfigMap, "enabled", func(v bool) {
57
+ rq.Enabled = v
58
+ }); err != nil {
59
+ return err
60
+ }
61
+
62
+ if err := common.OptionalIntFromMap(rqConfigMap, "bits", func(v int) {
63
+ rq.Bits = int16(v)
64
+ }); err != nil {
65
+ return err
66
+ }
67
+
68
+ if err := common.OptionalIntFromMap(rqConfigMap, "rescoreLimit", func(v int) {
69
+ rq.RescoreLimit = v
70
+ }); err != nil {
71
+ return err
72
+ }
73
+
74
+ if rq.Bits == 1 && rqConfigMap["rescoreLimit"] == nil {
75
+ rq.RescoreLimit = DefaultBRQRescoreLimit
76
+ }
77
+
78
+ return nil
79
+ }
80
+
81
+ // GetRQBits returns the bits value for RQ compression, or 0 if not RQ
82
+ func GetRQBits(cfg config.VectorIndexConfig) int16 {
83
+ if hnswUserConfig, ok := cfg.(UserConfig); ok && hnswUserConfig.RQ.Enabled {
84
+ return hnswUserConfig.RQ.Bits
85
+ }
86
+ return 0
87
+ }
platform/dbops/binaries/weaviate-src/entities/vectorindex/hnsw/rq_config_test.go ADDED
@@ -0,0 +1,75 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // _ _
2
+ // __ _____ __ ___ ___ __ _| |_ ___
3
+ // \ \ /\ / / _ \/ _` \ \ / / |/ _` | __/ _ \
4
+ // \ V V / __/ (_| |\ V /| | (_| | || __/
5
+ // \_/\_/ \___|\__,_| \_/ |_|\__,_|\__\___|
6
+ //
7
+ // Copyright © 2016 - 2025 Weaviate B.V. All rights reserved.
8
+ //
9
+ // CONTACT: hello@weaviate.io
10
+ //
11
+
12
+ package hnsw
13
+
14
+ import (
15
+ "testing"
16
+
17
+ "github.com/weaviate/weaviate/entities/schema/config"
18
+ )
19
+
20
+ func TestGetRQBits(t *testing.T) {
21
+ tests := []struct {
22
+ name string
23
+ config config.VectorIndexConfig
24
+ expected int16
25
+ }{
26
+ {
27
+ name: "RQ disabled should return 0",
28
+ config: UserConfig{
29
+ RQ: RQConfig{
30
+ Enabled: false,
31
+ Bits: 8,
32
+ },
33
+ },
34
+ expected: 0,
35
+ },
36
+ {
37
+ name: "RQ enabled with bits=1 should return 1",
38
+ config: UserConfig{
39
+ RQ: RQConfig{
40
+ Enabled: true,
41
+ Bits: 1,
42
+ },
43
+ },
44
+ expected: 1,
45
+ },
46
+ {
47
+ name: "RQ enabled with bits=8 should return 8",
48
+ config: UserConfig{
49
+ RQ: RQConfig{
50
+ Enabled: true,
51
+ Bits: 8,
52
+ },
53
+ },
54
+ expected: 8,
55
+ },
56
+ {
57
+ name: "non-RQ config should return 0",
58
+ config: UserConfig{
59
+ BQ: BQConfig{
60
+ Enabled: true,
61
+ },
62
+ },
63
+ expected: 0,
64
+ },
65
+ }
66
+
67
+ for _, tt := range tests {
68
+ t.Run(tt.name, func(t *testing.T) {
69
+ result := GetRQBits(tt.config)
70
+ if result != tt.expected {
71
+ t.Errorf("GetRQBits() = %v, want %v", result, tt.expected)
72
+ }
73
+ })
74
+ }
75
+ }
platform/dbops/binaries/weaviate-src/entities/vectorindex/hnsw/sq_config.go ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // _ _
2
+ // __ _____ __ ___ ___ __ _| |_ ___
3
+ // \ \ /\ / / _ \/ _` \ \ / / |/ _` | __/ _ \
4
+ // \ V V / __/ (_| |\ V /| | (_| | || __/
5
+ // \_/\_/ \___|\__,_| \_/ |_|\__,_|\__\___|
6
+ //
7
+ // Copyright © 2016 - 2025 Weaviate B.V. All rights reserved.
8
+ //
9
+ // CONTACT: hello@weaviate.io
10
+ //
11
+
12
+ package hnsw
13
+
14
+ import "github.com/weaviate/weaviate/entities/vectorindex/common"
15
+
16
+ const (
17
+ DefaultSQEnabled = false
18
+ DefaultSQTrainingLimit = 100000
19
+ DefaultSQRescoreLimit = 20
20
+ )
21
+
22
+ type SQConfig struct {
23
+ Enabled bool `json:"enabled"`
24
+ TrainingLimit int `json:"trainingLimit"`
25
+ RescoreLimit int `json:"rescoreLimit"`
26
+ }
27
+
28
+ func parseSQMap(in map[string]interface{}, sq *SQConfig) error {
29
+ sqConfigValue, ok := in["sq"]
30
+ if !ok {
31
+ return nil
32
+ }
33
+
34
+ sqConfigMap, ok := sqConfigValue.(map[string]interface{})
35
+ if !ok {
36
+ return nil
37
+ }
38
+
39
+ if err := common.OptionalBoolFromMap(sqConfigMap, "enabled", func(v bool) {
40
+ sq.Enabled = v
41
+ }); err != nil {
42
+ return err
43
+ }
44
+
45
+ if err := common.OptionalIntFromMap(sqConfigMap, "trainingLimit", func(v int) {
46
+ sq.TrainingLimit = v
47
+ }); err != nil {
48
+ return err
49
+ }
50
+
51
+ if err := common.OptionalIntFromMap(sqConfigMap, "rescoreLimit", func(v int) {
52
+ sq.RescoreLimit = v
53
+ }); err != nil {
54
+ return err
55
+ }
56
+
57
+ return nil
58
+ }
platform/dbops/binaries/weaviate-src/entities/verbosity/verbosity.go ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // _ _
2
+ // __ _____ __ ___ ___ __ _| |_ ___
3
+ // \ \ /\ / / _ \/ _` \ \ / / |/ _` | __/ _ \
4
+ // \ V V / __/ (_| |\ V /| | (_| | || __/
5
+ // \_/\_/ \___|\__,_| \_/ |_|\__,_|\__\___|
6
+ //
7
+ // Copyright © 2016 - 2025 Weaviate B.V. All rights reserved.
8
+ //
9
+ // CONTACT: hello@weaviate.io
10
+ //
11
+
12
+ package verbosity
13
+
14
+ import "fmt"
15
+
16
+ const (
17
+ OutputMinimal = "minimal"
18
+ OutputVerbose = "verbose"
19
+ )
20
+
21
+ // ParseOutput extracts the verbosity value from the provided nullable string
22
+ // If `output` is nil, the default selection is "minimal"
23
+ func ParseOutput(output *string) (string, error) {
24
+ if output != nil {
25
+ switch *output {
26
+ case OutputMinimal, OutputVerbose:
27
+ return *output, nil
28
+ default:
29
+ return "", fmt.Errorf(`invalid output: "%s", possible values are: "%s", "%s"`,
30
+ *output, OutputMinimal, OutputVerbose)
31
+ }
32
+ }
33
+ return OutputMinimal, nil
34
+ }
platform/dbops/binaries/weaviate-src/entities/versioned/class.go ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // _ _
2
+ // __ _____ __ ___ ___ __ _| |_ ___
3
+ // \ \ /\ / / _ \/ _` \ \ / / |/ _` | __/ _ \
4
+ // \ V V / __/ (_| |\ V /| | (_| | || __/
5
+ // \_/\_/ \___|\__,_| \_/ |_|\__,_|\__\___|
6
+ //
7
+ // Copyright © 2016 - 2025 Weaviate B.V. All rights reserved.
8
+ //
9
+ // CONTACT: hello@weaviate.io
10
+ //
11
+
12
+ package versioned
13
+
14
+ import "github.com/weaviate/weaviate/entities/models"
15
+
16
+ // Class is a wrapper on top of class created by OpenAPI to be able
17
+ // to inject version to class
18
+ type Class struct {
19
+ *models.Class
20
+ Version uint64
21
+ }
22
+
23
+ type Classes map[string]Class
platform/dbops/binaries/weaviate-src/grpc/generated/protocol/v0/batch.pb.go ADDED
@@ -0,0 +1,149 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Code generated by protoc-gen-go. DO NOT EDIT.
2
+
3
+ package protocol
4
+
5
+ import (
6
+ reflect "reflect"
7
+ sync "sync"
8
+ unsafe "unsafe"
9
+
10
+ protoreflect "google.golang.org/protobuf/reflect/protoreflect"
11
+ protoimpl "google.golang.org/protobuf/runtime/protoimpl"
12
+ )
13
+
14
+ const (
15
+ // Verify that this generated code is sufficiently up-to-date.
16
+ _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
17
+ // Verify that runtime/protoimpl is sufficiently up-to-date.
18
+ _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
19
+ )
20
+
21
+ type BatchObjectsRequest struct {
22
+ state protoimpl.MessageState `protogen:"open.v1"`
23
+ unknownFields protoimpl.UnknownFields
24
+ sizeCache protoimpl.SizeCache
25
+ }
26
+
27
+ func (x *BatchObjectsRequest) Reset() {
28
+ *x = BatchObjectsRequest{}
29
+ mi := &file_v0_batch_proto_msgTypes[0]
30
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
31
+ ms.StoreMessageInfo(mi)
32
+ }
33
+
34
+ func (x *BatchObjectsRequest) String() string {
35
+ return protoimpl.X.MessageStringOf(x)
36
+ }
37
+
38
+ func (*BatchObjectsRequest) ProtoMessage() {}
39
+
40
+ func (x *BatchObjectsRequest) ProtoReflect() protoreflect.Message {
41
+ mi := &file_v0_batch_proto_msgTypes[0]
42
+ if x != nil {
43
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
44
+ if ms.LoadMessageInfo() == nil {
45
+ ms.StoreMessageInfo(mi)
46
+ }
47
+ return ms
48
+ }
49
+ return mi.MessageOf(x)
50
+ }
51
+
52
+ // Deprecated: Use BatchObjectsRequest.ProtoReflect.Descriptor instead.
53
+ func (*BatchObjectsRequest) Descriptor() ([]byte, []int) {
54
+ return file_v0_batch_proto_rawDescGZIP(), []int{0}
55
+ }
56
+
57
+ type BatchObjectsReply struct {
58
+ state protoimpl.MessageState `protogen:"open.v1"`
59
+ unknownFields protoimpl.UnknownFields
60
+ sizeCache protoimpl.SizeCache
61
+ }
62
+
63
+ func (x *BatchObjectsReply) Reset() {
64
+ *x = BatchObjectsReply{}
65
+ mi := &file_v0_batch_proto_msgTypes[1]
66
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
67
+ ms.StoreMessageInfo(mi)
68
+ }
69
+
70
+ func (x *BatchObjectsReply) String() string {
71
+ return protoimpl.X.MessageStringOf(x)
72
+ }
73
+
74
+ func (*BatchObjectsReply) ProtoMessage() {}
75
+
76
+ func (x *BatchObjectsReply) ProtoReflect() protoreflect.Message {
77
+ mi := &file_v0_batch_proto_msgTypes[1]
78
+ if x != nil {
79
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
80
+ if ms.LoadMessageInfo() == nil {
81
+ ms.StoreMessageInfo(mi)
82
+ }
83
+ return ms
84
+ }
85
+ return mi.MessageOf(x)
86
+ }
87
+
88
+ // Deprecated: Use BatchObjectsReply.ProtoReflect.Descriptor instead.
89
+ func (*BatchObjectsReply) Descriptor() ([]byte, []int) {
90
+ return file_v0_batch_proto_rawDescGZIP(), []int{1}
91
+ }
92
+
93
+ var File_v0_batch_proto protoreflect.FileDescriptor
94
+
95
+ const file_v0_batch_proto_rawDesc = "" +
96
+ "\n" +
97
+ "\x0ev0/batch.proto\x12\fweaviategrpc\"\x15\n" +
98
+ "\x13BatchObjectsRequest\"\x13\n" +
99
+ "\x11BatchObjectsReplyBo\n" +
100
+ "#io.weaviate.client.grpc.protocol.v0B\x12WeaviateProtoBatchZ4github.com/weaviate/weaviate/grpc/generated;protocolb\x06proto3"
101
+
102
+ var (
103
+ file_v0_batch_proto_rawDescOnce sync.Once
104
+ file_v0_batch_proto_rawDescData []byte
105
+ )
106
+
107
+ func file_v0_batch_proto_rawDescGZIP() []byte {
108
+ file_v0_batch_proto_rawDescOnce.Do(func() {
109
+ file_v0_batch_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_v0_batch_proto_rawDesc), len(file_v0_batch_proto_rawDesc)))
110
+ })
111
+ return file_v0_batch_proto_rawDescData
112
+ }
113
+
114
+ var file_v0_batch_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
115
+ var file_v0_batch_proto_goTypes = []any{
116
+ (*BatchObjectsRequest)(nil), // 0: weaviategrpc.BatchObjectsRequest
117
+ (*BatchObjectsReply)(nil), // 1: weaviategrpc.BatchObjectsReply
118
+ }
119
+ var file_v0_batch_proto_depIdxs = []int32{
120
+ 0, // [0:0] is the sub-list for method output_type
121
+ 0, // [0:0] is the sub-list for method input_type
122
+ 0, // [0:0] is the sub-list for extension type_name
123
+ 0, // [0:0] is the sub-list for extension extendee
124
+ 0, // [0:0] is the sub-list for field type_name
125
+ }
126
+
127
+ func init() { file_v0_batch_proto_init() }
128
+ func file_v0_batch_proto_init() {
129
+ if File_v0_batch_proto != nil {
130
+ return
131
+ }
132
+ type x struct{}
133
+ out := protoimpl.TypeBuilder{
134
+ File: protoimpl.DescBuilder{
135
+ GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
136
+ RawDescriptor: unsafe.Slice(unsafe.StringData(file_v0_batch_proto_rawDesc), len(file_v0_batch_proto_rawDesc)),
137
+ NumEnums: 0,
138
+ NumMessages: 2,
139
+ NumExtensions: 0,
140
+ NumServices: 0,
141
+ },
142
+ GoTypes: file_v0_batch_proto_goTypes,
143
+ DependencyIndexes: file_v0_batch_proto_depIdxs,
144
+ MessageInfos: file_v0_batch_proto_msgTypes,
145
+ }.Build()
146
+ File_v0_batch_proto = out.File
147
+ file_v0_batch_proto_goTypes = nil
148
+ file_v0_batch_proto_depIdxs = nil
149
+ }
platform/dbops/binaries/weaviate-src/grpc/generated/protocol/v0/search_get.pb.go ADDED
@@ -0,0 +1,149 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Code generated by protoc-gen-go. DO NOT EDIT.
2
+
3
+ package protocol
4
+
5
+ import (
6
+ reflect "reflect"
7
+ sync "sync"
8
+ unsafe "unsafe"
9
+
10
+ protoreflect "google.golang.org/protobuf/reflect/protoreflect"
11
+ protoimpl "google.golang.org/protobuf/runtime/protoimpl"
12
+ )
13
+
14
+ const (
15
+ // Verify that this generated code is sufficiently up-to-date.
16
+ _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
17
+ // Verify that runtime/protoimpl is sufficiently up-to-date.
18
+ _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
19
+ )
20
+
21
+ type SearchRequest struct {
22
+ state protoimpl.MessageState `protogen:"open.v1"`
23
+ unknownFields protoimpl.UnknownFields
24
+ sizeCache protoimpl.SizeCache
25
+ }
26
+
27
+ func (x *SearchRequest) Reset() {
28
+ *x = SearchRequest{}
29
+ mi := &file_v0_search_get_proto_msgTypes[0]
30
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
31
+ ms.StoreMessageInfo(mi)
32
+ }
33
+
34
+ func (x *SearchRequest) String() string {
35
+ return protoimpl.X.MessageStringOf(x)
36
+ }
37
+
38
+ func (*SearchRequest) ProtoMessage() {}
39
+
40
+ func (x *SearchRequest) ProtoReflect() protoreflect.Message {
41
+ mi := &file_v0_search_get_proto_msgTypes[0]
42
+ if x != nil {
43
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
44
+ if ms.LoadMessageInfo() == nil {
45
+ ms.StoreMessageInfo(mi)
46
+ }
47
+ return ms
48
+ }
49
+ return mi.MessageOf(x)
50
+ }
51
+
52
+ // Deprecated: Use SearchRequest.ProtoReflect.Descriptor instead.
53
+ func (*SearchRequest) Descriptor() ([]byte, []int) {
54
+ return file_v0_search_get_proto_rawDescGZIP(), []int{0}
55
+ }
56
+
57
+ type SearchReply struct {
58
+ state protoimpl.MessageState `protogen:"open.v1"`
59
+ unknownFields protoimpl.UnknownFields
60
+ sizeCache protoimpl.SizeCache
61
+ }
62
+
63
+ func (x *SearchReply) Reset() {
64
+ *x = SearchReply{}
65
+ mi := &file_v0_search_get_proto_msgTypes[1]
66
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
67
+ ms.StoreMessageInfo(mi)
68
+ }
69
+
70
+ func (x *SearchReply) String() string {
71
+ return protoimpl.X.MessageStringOf(x)
72
+ }
73
+
74
+ func (*SearchReply) ProtoMessage() {}
75
+
76
+ func (x *SearchReply) ProtoReflect() protoreflect.Message {
77
+ mi := &file_v0_search_get_proto_msgTypes[1]
78
+ if x != nil {
79
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
80
+ if ms.LoadMessageInfo() == nil {
81
+ ms.StoreMessageInfo(mi)
82
+ }
83
+ return ms
84
+ }
85
+ return mi.MessageOf(x)
86
+ }
87
+
88
+ // Deprecated: Use SearchReply.ProtoReflect.Descriptor instead.
89
+ func (*SearchReply) Descriptor() ([]byte, []int) {
90
+ return file_v0_search_get_proto_rawDescGZIP(), []int{1}
91
+ }
92
+
93
+ var File_v0_search_get_proto protoreflect.FileDescriptor
94
+
95
+ const file_v0_search_get_proto_rawDesc = "" +
96
+ "\n" +
97
+ "\x13v0/search_get.proto\x12\fweaviategrpc\"\x0f\n" +
98
+ "\rSearchRequest\"\r\n" +
99
+ "\vSearchReplyBs\n" +
100
+ "#io.weaviate.client.grpc.protocol.v0B\x16WeaviateProtoSearchGetZ4github.com/weaviate/weaviate/grpc/generated;protocolb\x06proto3"
101
+
102
+ var (
103
+ file_v0_search_get_proto_rawDescOnce sync.Once
104
+ file_v0_search_get_proto_rawDescData []byte
105
+ )
106
+
107
+ func file_v0_search_get_proto_rawDescGZIP() []byte {
108
+ file_v0_search_get_proto_rawDescOnce.Do(func() {
109
+ file_v0_search_get_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_v0_search_get_proto_rawDesc), len(file_v0_search_get_proto_rawDesc)))
110
+ })
111
+ return file_v0_search_get_proto_rawDescData
112
+ }
113
+
114
+ var file_v0_search_get_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
115
+ var file_v0_search_get_proto_goTypes = []any{
116
+ (*SearchRequest)(nil), // 0: weaviategrpc.SearchRequest
117
+ (*SearchReply)(nil), // 1: weaviategrpc.SearchReply
118
+ }
119
+ var file_v0_search_get_proto_depIdxs = []int32{
120
+ 0, // [0:0] is the sub-list for method output_type
121
+ 0, // [0:0] is the sub-list for method input_type
122
+ 0, // [0:0] is the sub-list for extension type_name
123
+ 0, // [0:0] is the sub-list for extension extendee
124
+ 0, // [0:0] is the sub-list for field type_name
125
+ }
126
+
127
+ func init() { file_v0_search_get_proto_init() }
128
+ func file_v0_search_get_proto_init() {
129
+ if File_v0_search_get_proto != nil {
130
+ return
131
+ }
132
+ type x struct{}
133
+ out := protoimpl.TypeBuilder{
134
+ File: protoimpl.DescBuilder{
135
+ GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
136
+ RawDescriptor: unsafe.Slice(unsafe.StringData(file_v0_search_get_proto_rawDesc), len(file_v0_search_get_proto_rawDesc)),
137
+ NumEnums: 0,
138
+ NumMessages: 2,
139
+ NumExtensions: 0,
140
+ NumServices: 0,
141
+ },
142
+ GoTypes: file_v0_search_get_proto_goTypes,
143
+ DependencyIndexes: file_v0_search_get_proto_depIdxs,
144
+ MessageInfos: file_v0_search_get_proto_msgTypes,
145
+ }.Build()
146
+ File_v0_search_get_proto = out.File
147
+ file_v0_search_get_proto_goTypes = nil
148
+ file_v0_search_get_proto_depIdxs = nil
149
+ }
platform/dbops/binaries/weaviate-src/grpc/generated/protocol/v0/weaviate.pb.go ADDED
@@ -0,0 +1,71 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Code generated by protoc-gen-go. DO NOT EDIT.
2
+
3
+ package protocol
4
+
5
+ import (
6
+ reflect "reflect"
7
+ unsafe "unsafe"
8
+
9
+ protoreflect "google.golang.org/protobuf/reflect/protoreflect"
10
+ protoimpl "google.golang.org/protobuf/runtime/protoimpl"
11
+ )
12
+
13
+ const (
14
+ // Verify that this generated code is sufficiently up-to-date.
15
+ _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
16
+ // Verify that runtime/protoimpl is sufficiently up-to-date.
17
+ _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
18
+ )
19
+
20
+ var File_v0_weaviate_proto protoreflect.FileDescriptor
21
+
22
+ const file_v0_weaviate_proto_rawDesc = "" +
23
+ "\n" +
24
+ "\x11v0/weaviate.proto\x12\fweaviategrpc\x1a\x0ev0/batch.proto\x1a\x13v0/search_get.proto2\xa4\x01\n" +
25
+ "\bWeaviate\x12B\n" +
26
+ "\x06Search\x12\x1b.weaviategrpc.SearchRequest\x1a\x19.weaviategrpc.SearchReply\"\x00\x12T\n" +
27
+ "\fBatchObjects\x12!.weaviategrpc.BatchObjectsRequest\x1a\x1f.weaviategrpc.BatchObjectsReply\"\x00Bj\n" +
28
+ "#io.weaviate.client.grpc.protocol.v0B\rWeaviateProtoZ4github.com/weaviate/weaviate/grpc/generated;protocolb\x06proto3"
29
+
30
+ var file_v0_weaviate_proto_goTypes = []any{
31
+ (*SearchRequest)(nil), // 0: weaviategrpc.SearchRequest
32
+ (*BatchObjectsRequest)(nil), // 1: weaviategrpc.BatchObjectsRequest
33
+ (*SearchReply)(nil), // 2: weaviategrpc.SearchReply
34
+ (*BatchObjectsReply)(nil), // 3: weaviategrpc.BatchObjectsReply
35
+ }
36
+ var file_v0_weaviate_proto_depIdxs = []int32{
37
+ 0, // 0: weaviategrpc.Weaviate.Search:input_type -> weaviategrpc.SearchRequest
38
+ 1, // 1: weaviategrpc.Weaviate.BatchObjects:input_type -> weaviategrpc.BatchObjectsRequest
39
+ 2, // 2: weaviategrpc.Weaviate.Search:output_type -> weaviategrpc.SearchReply
40
+ 3, // 3: weaviategrpc.Weaviate.BatchObjects:output_type -> weaviategrpc.BatchObjectsReply
41
+ 2, // [2:4] is the sub-list for method output_type
42
+ 0, // [0:2] is the sub-list for method input_type
43
+ 0, // [0:0] is the sub-list for extension type_name
44
+ 0, // [0:0] is the sub-list for extension extendee
45
+ 0, // [0:0] is the sub-list for field type_name
46
+ }
47
+
48
+ func init() { file_v0_weaviate_proto_init() }
49
+ func file_v0_weaviate_proto_init() {
50
+ if File_v0_weaviate_proto != nil {
51
+ return
52
+ }
53
+ file_v0_batch_proto_init()
54
+ file_v0_search_get_proto_init()
55
+ type x struct{}
56
+ out := protoimpl.TypeBuilder{
57
+ File: protoimpl.DescBuilder{
58
+ GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
59
+ RawDescriptor: unsafe.Slice(unsafe.StringData(file_v0_weaviate_proto_rawDesc), len(file_v0_weaviate_proto_rawDesc)),
60
+ NumEnums: 0,
61
+ NumMessages: 0,
62
+ NumExtensions: 0,
63
+ NumServices: 1,
64
+ },
65
+ GoTypes: file_v0_weaviate_proto_goTypes,
66
+ DependencyIndexes: file_v0_weaviate_proto_depIdxs,
67
+ }.Build()
68
+ File_v0_weaviate_proto = out.File
69
+ file_v0_weaviate_proto_goTypes = nil
70
+ file_v0_weaviate_proto_depIdxs = nil
71
+ }
platform/dbops/binaries/weaviate-src/grpc/generated/protocol/v0/weaviate_grpc.pb.go ADDED
@@ -0,0 +1,156 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Code generated by protoc-gen-go-grpc. DO NOT EDIT.
2
+
3
+ package protocol
4
+
5
+ import (
6
+ context "context"
7
+
8
+ grpc "google.golang.org/grpc"
9
+ codes "google.golang.org/grpc/codes"
10
+ status "google.golang.org/grpc/status"
11
+ )
12
+
13
+ // This is a compile-time assertion to ensure that this generated file
14
+ // is compatible with the grpc package it is being compiled against.
15
+ // Requires gRPC-Go v1.64.0 or later.
16
+ const _ = grpc.SupportPackageIsVersion9
17
+
18
+ const (
19
+ Weaviate_Search_FullMethodName = "/weaviategrpc.Weaviate/Search"
20
+ Weaviate_BatchObjects_FullMethodName = "/weaviategrpc.Weaviate/BatchObjects"
21
+ )
22
+
23
+ // WeaviateClient is the client API for Weaviate service.
24
+ //
25
+ // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
26
+ type WeaviateClient interface {
27
+ Search(ctx context.Context, in *SearchRequest, opts ...grpc.CallOption) (*SearchReply, error)
28
+ BatchObjects(ctx context.Context, in *BatchObjectsRequest, opts ...grpc.CallOption) (*BatchObjectsReply, error)
29
+ }
30
+
31
+ type weaviateClient struct {
32
+ cc grpc.ClientConnInterface
33
+ }
34
+
35
+ func NewWeaviateClient(cc grpc.ClientConnInterface) WeaviateClient {
36
+ return &weaviateClient{cc}
37
+ }
38
+
39
+ func (c *weaviateClient) Search(ctx context.Context, in *SearchRequest, opts ...grpc.CallOption) (*SearchReply, error) {
40
+ cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
41
+ out := new(SearchReply)
42
+ err := c.cc.Invoke(ctx, Weaviate_Search_FullMethodName, in, out, cOpts...)
43
+ if err != nil {
44
+ return nil, err
45
+ }
46
+ return out, nil
47
+ }
48
+
49
+ func (c *weaviateClient) BatchObjects(ctx context.Context, in *BatchObjectsRequest, opts ...grpc.CallOption) (*BatchObjectsReply, error) {
50
+ cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
51
+ out := new(BatchObjectsReply)
52
+ err := c.cc.Invoke(ctx, Weaviate_BatchObjects_FullMethodName, in, out, cOpts...)
53
+ if err != nil {
54
+ return nil, err
55
+ }
56
+ return out, nil
57
+ }
58
+
59
+ // WeaviateServer is the server API for Weaviate service.
60
+ // All implementations must embed UnimplementedWeaviateServer
61
+ // for forward compatibility.
62
+ type WeaviateServer interface {
63
+ Search(context.Context, *SearchRequest) (*SearchReply, error)
64
+ BatchObjects(context.Context, *BatchObjectsRequest) (*BatchObjectsReply, error)
65
+ mustEmbedUnimplementedWeaviateServer()
66
+ }
67
+
68
+ // UnimplementedWeaviateServer must be embedded to have
69
+ // forward compatible implementations.
70
+ //
71
+ // NOTE: this should be embedded by value instead of pointer to avoid a nil
72
+ // pointer dereference when methods are called.
73
+ type UnimplementedWeaviateServer struct{}
74
+
75
+ func (UnimplementedWeaviateServer) Search(context.Context, *SearchRequest) (*SearchReply, error) {
76
+ return nil, status.Errorf(codes.Unimplemented, "method Search not implemented")
77
+ }
78
+ func (UnimplementedWeaviateServer) BatchObjects(context.Context, *BatchObjectsRequest) (*BatchObjectsReply, error) {
79
+ return nil, status.Errorf(codes.Unimplemented, "method BatchObjects not implemented")
80
+ }
81
+ func (UnimplementedWeaviateServer) mustEmbedUnimplementedWeaviateServer() {}
82
+ func (UnimplementedWeaviateServer) testEmbeddedByValue() {}
83
+
84
+ // UnsafeWeaviateServer may be embedded to opt out of forward compatibility for this service.
85
+ // Use of this interface is not recommended, as added methods to WeaviateServer will
86
+ // result in compilation errors.
87
+ type UnsafeWeaviateServer interface {
88
+ mustEmbedUnimplementedWeaviateServer()
89
+ }
90
+
91
+ func RegisterWeaviateServer(s grpc.ServiceRegistrar, srv WeaviateServer) {
92
+ // If the following call pancis, it indicates UnimplementedWeaviateServer was
93
+ // embedded by pointer and is nil. This will cause panics if an
94
+ // unimplemented method is ever invoked, so we test this at initialization
95
+ // time to prevent it from happening at runtime later due to I/O.
96
+ if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
97
+ t.testEmbeddedByValue()
98
+ }
99
+ s.RegisterService(&Weaviate_ServiceDesc, srv)
100
+ }
101
+
102
+ func _Weaviate_Search_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
103
+ in := new(SearchRequest)
104
+ if err := dec(in); err != nil {
105
+ return nil, err
106
+ }
107
+ if interceptor == nil {
108
+ return srv.(WeaviateServer).Search(ctx, in)
109
+ }
110
+ info := &grpc.UnaryServerInfo{
111
+ Server: srv,
112
+ FullMethod: Weaviate_Search_FullMethodName,
113
+ }
114
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
115
+ return srv.(WeaviateServer).Search(ctx, req.(*SearchRequest))
116
+ }
117
+ return interceptor(ctx, in, info, handler)
118
+ }
119
+
120
+ func _Weaviate_BatchObjects_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
121
+ in := new(BatchObjectsRequest)
122
+ if err := dec(in); err != nil {
123
+ return nil, err
124
+ }
125
+ if interceptor == nil {
126
+ return srv.(WeaviateServer).BatchObjects(ctx, in)
127
+ }
128
+ info := &grpc.UnaryServerInfo{
129
+ Server: srv,
130
+ FullMethod: Weaviate_BatchObjects_FullMethodName,
131
+ }
132
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
133
+ return srv.(WeaviateServer).BatchObjects(ctx, req.(*BatchObjectsRequest))
134
+ }
135
+ return interceptor(ctx, in, info, handler)
136
+ }
137
+
138
+ // Weaviate_ServiceDesc is the grpc.ServiceDesc for Weaviate service.
139
+ // It's only intended for direct use with grpc.RegisterService,
140
+ // and not to be introspected or modified (even as a copy)
141
+ var Weaviate_ServiceDesc = grpc.ServiceDesc{
142
+ ServiceName: "weaviategrpc.Weaviate",
143
+ HandlerType: (*WeaviateServer)(nil),
144
+ Methods: []grpc.MethodDesc{
145
+ {
146
+ MethodName: "Search",
147
+ Handler: _Weaviate_Search_Handler,
148
+ },
149
+ {
150
+ MethodName: "BatchObjects",
151
+ Handler: _Weaviate_BatchObjects_Handler,
152
+ },
153
+ },
154
+ Streams: []grpc.StreamDesc{},
155
+ Metadata: "v0/weaviate.proto",
156
+ }
platform/dbops/binaries/weaviate-src/grpc/generated/protocol/v1/aggregate.pb.go ADDED
@@ -0,0 +1,2630 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Code generated by protoc-gen-go. DO NOT EDIT.
2
+
3
+ package protocol
4
+
5
+ import (
6
+ reflect "reflect"
7
+ sync "sync"
8
+ unsafe "unsafe"
9
+
10
+ protoreflect "google.golang.org/protobuf/reflect/protoreflect"
11
+ protoimpl "google.golang.org/protobuf/runtime/protoimpl"
12
+ )
13
+
14
+ const (
15
+ // Verify that this generated code is sufficiently up-to-date.
16
+ _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
17
+ // Verify that runtime/protoimpl is sufficiently up-to-date.
18
+ _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
19
+ )
20
+
21
+ type AggregateRequest struct {
22
+ state protoimpl.MessageState `protogen:"open.v1"`
23
+ // required
24
+ Collection string `protobuf:"bytes,1,opt,name=collection,proto3" json:"collection,omitempty"`
25
+ // parameters
26
+ Tenant string `protobuf:"bytes,10,opt,name=tenant,proto3" json:"tenant,omitempty"`
27
+ // what is returned
28
+ ObjectsCount bool `protobuf:"varint,20,opt,name=objects_count,json=objectsCount,proto3" json:"objects_count,omitempty"`
29
+ Aggregations []*AggregateRequest_Aggregation `protobuf:"bytes,21,rep,name=aggregations,proto3" json:"aggregations,omitempty"`
30
+ // affects aggregation results
31
+ ObjectLimit *uint32 `protobuf:"varint,30,opt,name=object_limit,json=objectLimit,proto3,oneof" json:"object_limit,omitempty"`
32
+ GroupBy *AggregateRequest_GroupBy `protobuf:"bytes,31,opt,name=group_by,json=groupBy,proto3,oneof" json:"group_by,omitempty"`
33
+ Limit *uint32 `protobuf:"varint,32,opt,name=limit,proto3,oneof" json:"limit,omitempty"`
34
+ // matches/searches for objects
35
+ Filters *Filters `protobuf:"bytes,40,opt,name=filters,proto3,oneof" json:"filters,omitempty"`
36
+ // Types that are valid to be assigned to Search:
37
+ //
38
+ // *AggregateRequest_Hybrid
39
+ // *AggregateRequest_NearVector
40
+ // *AggregateRequest_NearObject
41
+ // *AggregateRequest_NearText
42
+ // *AggregateRequest_NearImage
43
+ // *AggregateRequest_NearAudio
44
+ // *AggregateRequest_NearVideo
45
+ // *AggregateRequest_NearDepth
46
+ // *AggregateRequest_NearThermal
47
+ // *AggregateRequest_NearImu
48
+ Search isAggregateRequest_Search `protobuf_oneof:"search"`
49
+ unknownFields protoimpl.UnknownFields
50
+ sizeCache protoimpl.SizeCache
51
+ }
52
+
53
+ func (x *AggregateRequest) Reset() {
54
+ *x = AggregateRequest{}
55
+ mi := &file_v1_aggregate_proto_msgTypes[0]
56
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
57
+ ms.StoreMessageInfo(mi)
58
+ }
59
+
60
+ func (x *AggregateRequest) String() string {
61
+ return protoimpl.X.MessageStringOf(x)
62
+ }
63
+
64
+ func (*AggregateRequest) ProtoMessage() {}
65
+
66
+ func (x *AggregateRequest) ProtoReflect() protoreflect.Message {
67
+ mi := &file_v1_aggregate_proto_msgTypes[0]
68
+ if x != nil {
69
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
70
+ if ms.LoadMessageInfo() == nil {
71
+ ms.StoreMessageInfo(mi)
72
+ }
73
+ return ms
74
+ }
75
+ return mi.MessageOf(x)
76
+ }
77
+
78
+ // Deprecated: Use AggregateRequest.ProtoReflect.Descriptor instead.
79
+ func (*AggregateRequest) Descriptor() ([]byte, []int) {
80
+ return file_v1_aggregate_proto_rawDescGZIP(), []int{0}
81
+ }
82
+
83
+ func (x *AggregateRequest) GetCollection() string {
84
+ if x != nil {
85
+ return x.Collection
86
+ }
87
+ return ""
88
+ }
89
+
90
+ func (x *AggregateRequest) GetTenant() string {
91
+ if x != nil {
92
+ return x.Tenant
93
+ }
94
+ return ""
95
+ }
96
+
97
+ func (x *AggregateRequest) GetObjectsCount() bool {
98
+ if x != nil {
99
+ return x.ObjectsCount
100
+ }
101
+ return false
102
+ }
103
+
104
+ func (x *AggregateRequest) GetAggregations() []*AggregateRequest_Aggregation {
105
+ if x != nil {
106
+ return x.Aggregations
107
+ }
108
+ return nil
109
+ }
110
+
111
+ func (x *AggregateRequest) GetObjectLimit() uint32 {
112
+ if x != nil && x.ObjectLimit != nil {
113
+ return *x.ObjectLimit
114
+ }
115
+ return 0
116
+ }
117
+
118
+ func (x *AggregateRequest) GetGroupBy() *AggregateRequest_GroupBy {
119
+ if x != nil {
120
+ return x.GroupBy
121
+ }
122
+ return nil
123
+ }
124
+
125
+ func (x *AggregateRequest) GetLimit() uint32 {
126
+ if x != nil && x.Limit != nil {
127
+ return *x.Limit
128
+ }
129
+ return 0
130
+ }
131
+
132
+ func (x *AggregateRequest) GetFilters() *Filters {
133
+ if x != nil {
134
+ return x.Filters
135
+ }
136
+ return nil
137
+ }
138
+
139
+ func (x *AggregateRequest) GetSearch() isAggregateRequest_Search {
140
+ if x != nil {
141
+ return x.Search
142
+ }
143
+ return nil
144
+ }
145
+
146
+ func (x *AggregateRequest) GetHybrid() *Hybrid {
147
+ if x != nil {
148
+ if x, ok := x.Search.(*AggregateRequest_Hybrid); ok {
149
+ return x.Hybrid
150
+ }
151
+ }
152
+ return nil
153
+ }
154
+
155
+ func (x *AggregateRequest) GetNearVector() *NearVector {
156
+ if x != nil {
157
+ if x, ok := x.Search.(*AggregateRequest_NearVector); ok {
158
+ return x.NearVector
159
+ }
160
+ }
161
+ return nil
162
+ }
163
+
164
+ func (x *AggregateRequest) GetNearObject() *NearObject {
165
+ if x != nil {
166
+ if x, ok := x.Search.(*AggregateRequest_NearObject); ok {
167
+ return x.NearObject
168
+ }
169
+ }
170
+ return nil
171
+ }
172
+
173
+ func (x *AggregateRequest) GetNearText() *NearTextSearch {
174
+ if x != nil {
175
+ if x, ok := x.Search.(*AggregateRequest_NearText); ok {
176
+ return x.NearText
177
+ }
178
+ }
179
+ return nil
180
+ }
181
+
182
+ func (x *AggregateRequest) GetNearImage() *NearImageSearch {
183
+ if x != nil {
184
+ if x, ok := x.Search.(*AggregateRequest_NearImage); ok {
185
+ return x.NearImage
186
+ }
187
+ }
188
+ return nil
189
+ }
190
+
191
+ func (x *AggregateRequest) GetNearAudio() *NearAudioSearch {
192
+ if x != nil {
193
+ if x, ok := x.Search.(*AggregateRequest_NearAudio); ok {
194
+ return x.NearAudio
195
+ }
196
+ }
197
+ return nil
198
+ }
199
+
200
+ func (x *AggregateRequest) GetNearVideo() *NearVideoSearch {
201
+ if x != nil {
202
+ if x, ok := x.Search.(*AggregateRequest_NearVideo); ok {
203
+ return x.NearVideo
204
+ }
205
+ }
206
+ return nil
207
+ }
208
+
209
+ func (x *AggregateRequest) GetNearDepth() *NearDepthSearch {
210
+ if x != nil {
211
+ if x, ok := x.Search.(*AggregateRequest_NearDepth); ok {
212
+ return x.NearDepth
213
+ }
214
+ }
215
+ return nil
216
+ }
217
+
218
+ func (x *AggregateRequest) GetNearThermal() *NearThermalSearch {
219
+ if x != nil {
220
+ if x, ok := x.Search.(*AggregateRequest_NearThermal); ok {
221
+ return x.NearThermal
222
+ }
223
+ }
224
+ return nil
225
+ }
226
+
227
+ func (x *AggregateRequest) GetNearImu() *NearIMUSearch {
228
+ if x != nil {
229
+ if x, ok := x.Search.(*AggregateRequest_NearImu); ok {
230
+ return x.NearImu
231
+ }
232
+ }
233
+ return nil
234
+ }
235
+
236
+ type isAggregateRequest_Search interface {
237
+ isAggregateRequest_Search()
238
+ }
239
+
240
+ type AggregateRequest_Hybrid struct {
241
+ Hybrid *Hybrid `protobuf:"bytes,41,opt,name=hybrid,proto3,oneof"`
242
+ }
243
+
244
+ type AggregateRequest_NearVector struct {
245
+ NearVector *NearVector `protobuf:"bytes,42,opt,name=near_vector,json=nearVector,proto3,oneof"`
246
+ }
247
+
248
+ type AggregateRequest_NearObject struct {
249
+ NearObject *NearObject `protobuf:"bytes,43,opt,name=near_object,json=nearObject,proto3,oneof"`
250
+ }
251
+
252
+ type AggregateRequest_NearText struct {
253
+ NearText *NearTextSearch `protobuf:"bytes,44,opt,name=near_text,json=nearText,proto3,oneof"`
254
+ }
255
+
256
+ type AggregateRequest_NearImage struct {
257
+ NearImage *NearImageSearch `protobuf:"bytes,45,opt,name=near_image,json=nearImage,proto3,oneof"`
258
+ }
259
+
260
+ type AggregateRequest_NearAudio struct {
261
+ NearAudio *NearAudioSearch `protobuf:"bytes,46,opt,name=near_audio,json=nearAudio,proto3,oneof"`
262
+ }
263
+
264
+ type AggregateRequest_NearVideo struct {
265
+ NearVideo *NearVideoSearch `protobuf:"bytes,47,opt,name=near_video,json=nearVideo,proto3,oneof"`
266
+ }
267
+
268
+ type AggregateRequest_NearDepth struct {
269
+ NearDepth *NearDepthSearch `protobuf:"bytes,48,opt,name=near_depth,json=nearDepth,proto3,oneof"`
270
+ }
271
+
272
+ type AggregateRequest_NearThermal struct {
273
+ NearThermal *NearThermalSearch `protobuf:"bytes,49,opt,name=near_thermal,json=nearThermal,proto3,oneof"`
274
+ }
275
+
276
+ type AggregateRequest_NearImu struct {
277
+ NearImu *NearIMUSearch `protobuf:"bytes,50,opt,name=near_imu,json=nearImu,proto3,oneof"`
278
+ }
279
+
280
+ func (*AggregateRequest_Hybrid) isAggregateRequest_Search() {}
281
+
282
+ func (*AggregateRequest_NearVector) isAggregateRequest_Search() {}
283
+
284
+ func (*AggregateRequest_NearObject) isAggregateRequest_Search() {}
285
+
286
+ func (*AggregateRequest_NearText) isAggregateRequest_Search() {}
287
+
288
+ func (*AggregateRequest_NearImage) isAggregateRequest_Search() {}
289
+
290
+ func (*AggregateRequest_NearAudio) isAggregateRequest_Search() {}
291
+
292
+ func (*AggregateRequest_NearVideo) isAggregateRequest_Search() {}
293
+
294
+ func (*AggregateRequest_NearDepth) isAggregateRequest_Search() {}
295
+
296
+ func (*AggregateRequest_NearThermal) isAggregateRequest_Search() {}
297
+
298
+ func (*AggregateRequest_NearImu) isAggregateRequest_Search() {}
299
+
300
+ type AggregateReply struct {
301
+ state protoimpl.MessageState `protogen:"open.v1"`
302
+ Took float32 `protobuf:"fixed32,1,opt,name=took,proto3" json:"took,omitempty"`
303
+ // Types that are valid to be assigned to Result:
304
+ //
305
+ // *AggregateReply_SingleResult
306
+ // *AggregateReply_GroupedResults
307
+ Result isAggregateReply_Result `protobuf_oneof:"result"`
308
+ unknownFields protoimpl.UnknownFields
309
+ sizeCache protoimpl.SizeCache
310
+ }
311
+
312
+ func (x *AggregateReply) Reset() {
313
+ *x = AggregateReply{}
314
+ mi := &file_v1_aggregate_proto_msgTypes[1]
315
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
316
+ ms.StoreMessageInfo(mi)
317
+ }
318
+
319
+ func (x *AggregateReply) String() string {
320
+ return protoimpl.X.MessageStringOf(x)
321
+ }
322
+
323
+ func (*AggregateReply) ProtoMessage() {}
324
+
325
+ func (x *AggregateReply) ProtoReflect() protoreflect.Message {
326
+ mi := &file_v1_aggregate_proto_msgTypes[1]
327
+ if x != nil {
328
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
329
+ if ms.LoadMessageInfo() == nil {
330
+ ms.StoreMessageInfo(mi)
331
+ }
332
+ return ms
333
+ }
334
+ return mi.MessageOf(x)
335
+ }
336
+
337
+ // Deprecated: Use AggregateReply.ProtoReflect.Descriptor instead.
338
+ func (*AggregateReply) Descriptor() ([]byte, []int) {
339
+ return file_v1_aggregate_proto_rawDescGZIP(), []int{1}
340
+ }
341
+
342
+ func (x *AggregateReply) GetTook() float32 {
343
+ if x != nil {
344
+ return x.Took
345
+ }
346
+ return 0
347
+ }
348
+
349
+ func (x *AggregateReply) GetResult() isAggregateReply_Result {
350
+ if x != nil {
351
+ return x.Result
352
+ }
353
+ return nil
354
+ }
355
+
356
+ func (x *AggregateReply) GetSingleResult() *AggregateReply_Single {
357
+ if x != nil {
358
+ if x, ok := x.Result.(*AggregateReply_SingleResult); ok {
359
+ return x.SingleResult
360
+ }
361
+ }
362
+ return nil
363
+ }
364
+
365
+ func (x *AggregateReply) GetGroupedResults() *AggregateReply_Grouped {
366
+ if x != nil {
367
+ if x, ok := x.Result.(*AggregateReply_GroupedResults); ok {
368
+ return x.GroupedResults
369
+ }
370
+ }
371
+ return nil
372
+ }
373
+
374
+ type isAggregateReply_Result interface {
375
+ isAggregateReply_Result()
376
+ }
377
+
378
+ type AggregateReply_SingleResult struct {
379
+ SingleResult *AggregateReply_Single `protobuf:"bytes,2,opt,name=single_result,json=singleResult,proto3,oneof"`
380
+ }
381
+
382
+ type AggregateReply_GroupedResults struct {
383
+ GroupedResults *AggregateReply_Grouped `protobuf:"bytes,3,opt,name=grouped_results,json=groupedResults,proto3,oneof"`
384
+ }
385
+
386
+ func (*AggregateReply_SingleResult) isAggregateReply_Result() {}
387
+
388
+ func (*AggregateReply_GroupedResults) isAggregateReply_Result() {}
389
+
390
+ type AggregateRequest_Aggregation struct {
391
+ state protoimpl.MessageState `protogen:"open.v1"`
392
+ Property string `protobuf:"bytes,1,opt,name=property,proto3" json:"property,omitempty"`
393
+ // Types that are valid to be assigned to Aggregation:
394
+ //
395
+ // *AggregateRequest_Aggregation_Int
396
+ // *AggregateRequest_Aggregation_Number_
397
+ // *AggregateRequest_Aggregation_Text_
398
+ // *AggregateRequest_Aggregation_Boolean_
399
+ // *AggregateRequest_Aggregation_Date_
400
+ // *AggregateRequest_Aggregation_Reference_
401
+ Aggregation isAggregateRequest_Aggregation_Aggregation `protobuf_oneof:"aggregation"`
402
+ unknownFields protoimpl.UnknownFields
403
+ sizeCache protoimpl.SizeCache
404
+ }
405
+
406
+ func (x *AggregateRequest_Aggregation) Reset() {
407
+ *x = AggregateRequest_Aggregation{}
408
+ mi := &file_v1_aggregate_proto_msgTypes[2]
409
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
410
+ ms.StoreMessageInfo(mi)
411
+ }
412
+
413
+ func (x *AggregateRequest_Aggregation) String() string {
414
+ return protoimpl.X.MessageStringOf(x)
415
+ }
416
+
417
+ func (*AggregateRequest_Aggregation) ProtoMessage() {}
418
+
419
+ func (x *AggregateRequest_Aggregation) ProtoReflect() protoreflect.Message {
420
+ mi := &file_v1_aggregate_proto_msgTypes[2]
421
+ if x != nil {
422
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
423
+ if ms.LoadMessageInfo() == nil {
424
+ ms.StoreMessageInfo(mi)
425
+ }
426
+ return ms
427
+ }
428
+ return mi.MessageOf(x)
429
+ }
430
+
431
+ // Deprecated: Use AggregateRequest_Aggregation.ProtoReflect.Descriptor instead.
432
+ func (*AggregateRequest_Aggregation) Descriptor() ([]byte, []int) {
433
+ return file_v1_aggregate_proto_rawDescGZIP(), []int{0, 0}
434
+ }
435
+
436
+ func (x *AggregateRequest_Aggregation) GetProperty() string {
437
+ if x != nil {
438
+ return x.Property
439
+ }
440
+ return ""
441
+ }
442
+
443
+ func (x *AggregateRequest_Aggregation) GetAggregation() isAggregateRequest_Aggregation_Aggregation {
444
+ if x != nil {
445
+ return x.Aggregation
446
+ }
447
+ return nil
448
+ }
449
+
450
+ func (x *AggregateRequest_Aggregation) GetInt() *AggregateRequest_Aggregation_Integer {
451
+ if x != nil {
452
+ if x, ok := x.Aggregation.(*AggregateRequest_Aggregation_Int); ok {
453
+ return x.Int
454
+ }
455
+ }
456
+ return nil
457
+ }
458
+
459
+ func (x *AggregateRequest_Aggregation) GetNumber() *AggregateRequest_Aggregation_Number {
460
+ if x != nil {
461
+ if x, ok := x.Aggregation.(*AggregateRequest_Aggregation_Number_); ok {
462
+ return x.Number
463
+ }
464
+ }
465
+ return nil
466
+ }
467
+
468
+ func (x *AggregateRequest_Aggregation) GetText() *AggregateRequest_Aggregation_Text {
469
+ if x != nil {
470
+ if x, ok := x.Aggregation.(*AggregateRequest_Aggregation_Text_); ok {
471
+ return x.Text
472
+ }
473
+ }
474
+ return nil
475
+ }
476
+
477
+ func (x *AggregateRequest_Aggregation) GetBoolean() *AggregateRequest_Aggregation_Boolean {
478
+ if x != nil {
479
+ if x, ok := x.Aggregation.(*AggregateRequest_Aggregation_Boolean_); ok {
480
+ return x.Boolean
481
+ }
482
+ }
483
+ return nil
484
+ }
485
+
486
+ func (x *AggregateRequest_Aggregation) GetDate() *AggregateRequest_Aggregation_Date {
487
+ if x != nil {
488
+ if x, ok := x.Aggregation.(*AggregateRequest_Aggregation_Date_); ok {
489
+ return x.Date
490
+ }
491
+ }
492
+ return nil
493
+ }
494
+
495
+ func (x *AggregateRequest_Aggregation) GetReference() *AggregateRequest_Aggregation_Reference {
496
+ if x != nil {
497
+ if x, ok := x.Aggregation.(*AggregateRequest_Aggregation_Reference_); ok {
498
+ return x.Reference
499
+ }
500
+ }
501
+ return nil
502
+ }
503
+
504
+ type isAggregateRequest_Aggregation_Aggregation interface {
505
+ isAggregateRequest_Aggregation_Aggregation()
506
+ }
507
+
508
+ type AggregateRequest_Aggregation_Int struct {
509
+ Int *AggregateRequest_Aggregation_Integer `protobuf:"bytes,2,opt,name=int,proto3,oneof"`
510
+ }
511
+
512
+ type AggregateRequest_Aggregation_Number_ struct {
513
+ Number *AggregateRequest_Aggregation_Number `protobuf:"bytes,3,opt,name=number,proto3,oneof"`
514
+ }
515
+
516
+ type AggregateRequest_Aggregation_Text_ struct {
517
+ Text *AggregateRequest_Aggregation_Text `protobuf:"bytes,4,opt,name=text,proto3,oneof"`
518
+ }
519
+
520
+ type AggregateRequest_Aggregation_Boolean_ struct {
521
+ Boolean *AggregateRequest_Aggregation_Boolean `protobuf:"bytes,5,opt,name=boolean,proto3,oneof"`
522
+ }
523
+
524
+ type AggregateRequest_Aggregation_Date_ struct {
525
+ Date *AggregateRequest_Aggregation_Date `protobuf:"bytes,6,opt,name=date,proto3,oneof"`
526
+ }
527
+
528
+ type AggregateRequest_Aggregation_Reference_ struct {
529
+ Reference *AggregateRequest_Aggregation_Reference `protobuf:"bytes,7,opt,name=reference,proto3,oneof"`
530
+ }
531
+
532
+ func (*AggregateRequest_Aggregation_Int) isAggregateRequest_Aggregation_Aggregation() {}
533
+
534
+ func (*AggregateRequest_Aggregation_Number_) isAggregateRequest_Aggregation_Aggregation() {}
535
+
536
+ func (*AggregateRequest_Aggregation_Text_) isAggregateRequest_Aggregation_Aggregation() {}
537
+
538
+ func (*AggregateRequest_Aggregation_Boolean_) isAggregateRequest_Aggregation_Aggregation() {}
539
+
540
+ func (*AggregateRequest_Aggregation_Date_) isAggregateRequest_Aggregation_Aggregation() {}
541
+
542
+ func (*AggregateRequest_Aggregation_Reference_) isAggregateRequest_Aggregation_Aggregation() {}
543
+
544
+ type AggregateRequest_GroupBy struct {
545
+ state protoimpl.MessageState `protogen:"open.v1"`
546
+ Collection string `protobuf:"bytes,1,opt,name=collection,proto3" json:"collection,omitempty"`
547
+ Property string `protobuf:"bytes,2,opt,name=property,proto3" json:"property,omitempty"`
548
+ unknownFields protoimpl.UnknownFields
549
+ sizeCache protoimpl.SizeCache
550
+ }
551
+
552
+ func (x *AggregateRequest_GroupBy) Reset() {
553
+ *x = AggregateRequest_GroupBy{}
554
+ mi := &file_v1_aggregate_proto_msgTypes[3]
555
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
556
+ ms.StoreMessageInfo(mi)
557
+ }
558
+
559
+ func (x *AggregateRequest_GroupBy) String() string {
560
+ return protoimpl.X.MessageStringOf(x)
561
+ }
562
+
563
+ func (*AggregateRequest_GroupBy) ProtoMessage() {}
564
+
565
+ func (x *AggregateRequest_GroupBy) ProtoReflect() protoreflect.Message {
566
+ mi := &file_v1_aggregate_proto_msgTypes[3]
567
+ if x != nil {
568
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
569
+ if ms.LoadMessageInfo() == nil {
570
+ ms.StoreMessageInfo(mi)
571
+ }
572
+ return ms
573
+ }
574
+ return mi.MessageOf(x)
575
+ }
576
+
577
+ // Deprecated: Use AggregateRequest_GroupBy.ProtoReflect.Descriptor instead.
578
+ func (*AggregateRequest_GroupBy) Descriptor() ([]byte, []int) {
579
+ return file_v1_aggregate_proto_rawDescGZIP(), []int{0, 1}
580
+ }
581
+
582
+ func (x *AggregateRequest_GroupBy) GetCollection() string {
583
+ if x != nil {
584
+ return x.Collection
585
+ }
586
+ return ""
587
+ }
588
+
589
+ func (x *AggregateRequest_GroupBy) GetProperty() string {
590
+ if x != nil {
591
+ return x.Property
592
+ }
593
+ return ""
594
+ }
595
+
596
+ type AggregateRequest_Aggregation_Integer struct {
597
+ state protoimpl.MessageState `protogen:"open.v1"`
598
+ Count bool `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"`
599
+ Type bool `protobuf:"varint,2,opt,name=type,proto3" json:"type,omitempty"`
600
+ Sum bool `protobuf:"varint,3,opt,name=sum,proto3" json:"sum,omitempty"`
601
+ Mean bool `protobuf:"varint,4,opt,name=mean,proto3" json:"mean,omitempty"`
602
+ Mode bool `protobuf:"varint,5,opt,name=mode,proto3" json:"mode,omitempty"`
603
+ Median bool `protobuf:"varint,6,opt,name=median,proto3" json:"median,omitempty"`
604
+ Maximum bool `protobuf:"varint,7,opt,name=maximum,proto3" json:"maximum,omitempty"`
605
+ Minimum bool `protobuf:"varint,8,opt,name=minimum,proto3" json:"minimum,omitempty"`
606
+ unknownFields protoimpl.UnknownFields
607
+ sizeCache protoimpl.SizeCache
608
+ }
609
+
610
+ func (x *AggregateRequest_Aggregation_Integer) Reset() {
611
+ *x = AggregateRequest_Aggregation_Integer{}
612
+ mi := &file_v1_aggregate_proto_msgTypes[4]
613
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
614
+ ms.StoreMessageInfo(mi)
615
+ }
616
+
617
+ func (x *AggregateRequest_Aggregation_Integer) String() string {
618
+ return protoimpl.X.MessageStringOf(x)
619
+ }
620
+
621
+ func (*AggregateRequest_Aggregation_Integer) ProtoMessage() {}
622
+
623
+ func (x *AggregateRequest_Aggregation_Integer) ProtoReflect() protoreflect.Message {
624
+ mi := &file_v1_aggregate_proto_msgTypes[4]
625
+ if x != nil {
626
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
627
+ if ms.LoadMessageInfo() == nil {
628
+ ms.StoreMessageInfo(mi)
629
+ }
630
+ return ms
631
+ }
632
+ return mi.MessageOf(x)
633
+ }
634
+
635
+ // Deprecated: Use AggregateRequest_Aggregation_Integer.ProtoReflect.Descriptor instead.
636
+ func (*AggregateRequest_Aggregation_Integer) Descriptor() ([]byte, []int) {
637
+ return file_v1_aggregate_proto_rawDescGZIP(), []int{0, 0, 0}
638
+ }
639
+
640
+ func (x *AggregateRequest_Aggregation_Integer) GetCount() bool {
641
+ if x != nil {
642
+ return x.Count
643
+ }
644
+ return false
645
+ }
646
+
647
+ func (x *AggregateRequest_Aggregation_Integer) GetType() bool {
648
+ if x != nil {
649
+ return x.Type
650
+ }
651
+ return false
652
+ }
653
+
654
+ func (x *AggregateRequest_Aggregation_Integer) GetSum() bool {
655
+ if x != nil {
656
+ return x.Sum
657
+ }
658
+ return false
659
+ }
660
+
661
+ func (x *AggregateRequest_Aggregation_Integer) GetMean() bool {
662
+ if x != nil {
663
+ return x.Mean
664
+ }
665
+ return false
666
+ }
667
+
668
+ func (x *AggregateRequest_Aggregation_Integer) GetMode() bool {
669
+ if x != nil {
670
+ return x.Mode
671
+ }
672
+ return false
673
+ }
674
+
675
+ func (x *AggregateRequest_Aggregation_Integer) GetMedian() bool {
676
+ if x != nil {
677
+ return x.Median
678
+ }
679
+ return false
680
+ }
681
+
682
+ func (x *AggregateRequest_Aggregation_Integer) GetMaximum() bool {
683
+ if x != nil {
684
+ return x.Maximum
685
+ }
686
+ return false
687
+ }
688
+
689
+ func (x *AggregateRequest_Aggregation_Integer) GetMinimum() bool {
690
+ if x != nil {
691
+ return x.Minimum
692
+ }
693
+ return false
694
+ }
695
+
696
+ type AggregateRequest_Aggregation_Number struct {
697
+ state protoimpl.MessageState `protogen:"open.v1"`
698
+ Count bool `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"`
699
+ Type bool `protobuf:"varint,2,opt,name=type,proto3" json:"type,omitempty"`
700
+ Sum bool `protobuf:"varint,3,opt,name=sum,proto3" json:"sum,omitempty"`
701
+ Mean bool `protobuf:"varint,4,opt,name=mean,proto3" json:"mean,omitempty"`
702
+ Mode bool `protobuf:"varint,5,opt,name=mode,proto3" json:"mode,omitempty"`
703
+ Median bool `protobuf:"varint,6,opt,name=median,proto3" json:"median,omitempty"`
704
+ Maximum bool `protobuf:"varint,7,opt,name=maximum,proto3" json:"maximum,omitempty"`
705
+ Minimum bool `protobuf:"varint,8,opt,name=minimum,proto3" json:"minimum,omitempty"`
706
+ unknownFields protoimpl.UnknownFields
707
+ sizeCache protoimpl.SizeCache
708
+ }
709
+
710
+ func (x *AggregateRequest_Aggregation_Number) Reset() {
711
+ *x = AggregateRequest_Aggregation_Number{}
712
+ mi := &file_v1_aggregate_proto_msgTypes[5]
713
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
714
+ ms.StoreMessageInfo(mi)
715
+ }
716
+
717
+ func (x *AggregateRequest_Aggregation_Number) String() string {
718
+ return protoimpl.X.MessageStringOf(x)
719
+ }
720
+
721
+ func (*AggregateRequest_Aggregation_Number) ProtoMessage() {}
722
+
723
+ func (x *AggregateRequest_Aggregation_Number) ProtoReflect() protoreflect.Message {
724
+ mi := &file_v1_aggregate_proto_msgTypes[5]
725
+ if x != nil {
726
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
727
+ if ms.LoadMessageInfo() == nil {
728
+ ms.StoreMessageInfo(mi)
729
+ }
730
+ return ms
731
+ }
732
+ return mi.MessageOf(x)
733
+ }
734
+
735
+ // Deprecated: Use AggregateRequest_Aggregation_Number.ProtoReflect.Descriptor instead.
736
+ func (*AggregateRequest_Aggregation_Number) Descriptor() ([]byte, []int) {
737
+ return file_v1_aggregate_proto_rawDescGZIP(), []int{0, 0, 1}
738
+ }
739
+
740
+ func (x *AggregateRequest_Aggregation_Number) GetCount() bool {
741
+ if x != nil {
742
+ return x.Count
743
+ }
744
+ return false
745
+ }
746
+
747
+ func (x *AggregateRequest_Aggregation_Number) GetType() bool {
748
+ if x != nil {
749
+ return x.Type
750
+ }
751
+ return false
752
+ }
753
+
754
+ func (x *AggregateRequest_Aggregation_Number) GetSum() bool {
755
+ if x != nil {
756
+ return x.Sum
757
+ }
758
+ return false
759
+ }
760
+
761
+ func (x *AggregateRequest_Aggregation_Number) GetMean() bool {
762
+ if x != nil {
763
+ return x.Mean
764
+ }
765
+ return false
766
+ }
767
+
768
+ func (x *AggregateRequest_Aggregation_Number) GetMode() bool {
769
+ if x != nil {
770
+ return x.Mode
771
+ }
772
+ return false
773
+ }
774
+
775
+ func (x *AggregateRequest_Aggregation_Number) GetMedian() bool {
776
+ if x != nil {
777
+ return x.Median
778
+ }
779
+ return false
780
+ }
781
+
782
+ func (x *AggregateRequest_Aggregation_Number) GetMaximum() bool {
783
+ if x != nil {
784
+ return x.Maximum
785
+ }
786
+ return false
787
+ }
788
+
789
+ func (x *AggregateRequest_Aggregation_Number) GetMinimum() bool {
790
+ if x != nil {
791
+ return x.Minimum
792
+ }
793
+ return false
794
+ }
795
+
796
+ type AggregateRequest_Aggregation_Text struct {
797
+ state protoimpl.MessageState `protogen:"open.v1"`
798
+ Count bool `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"`
799
+ Type bool `protobuf:"varint,2,opt,name=type,proto3" json:"type,omitempty"`
800
+ TopOccurences bool `protobuf:"varint,3,opt,name=top_occurences,json=topOccurences,proto3" json:"top_occurences,omitempty"`
801
+ TopOccurencesLimit *uint32 `protobuf:"varint,4,opt,name=top_occurences_limit,json=topOccurencesLimit,proto3,oneof" json:"top_occurences_limit,omitempty"`
802
+ unknownFields protoimpl.UnknownFields
803
+ sizeCache protoimpl.SizeCache
804
+ }
805
+
806
+ func (x *AggregateRequest_Aggregation_Text) Reset() {
807
+ *x = AggregateRequest_Aggregation_Text{}
808
+ mi := &file_v1_aggregate_proto_msgTypes[6]
809
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
810
+ ms.StoreMessageInfo(mi)
811
+ }
812
+
813
+ func (x *AggregateRequest_Aggregation_Text) String() string {
814
+ return protoimpl.X.MessageStringOf(x)
815
+ }
816
+
817
+ func (*AggregateRequest_Aggregation_Text) ProtoMessage() {}
818
+
819
+ func (x *AggregateRequest_Aggregation_Text) ProtoReflect() protoreflect.Message {
820
+ mi := &file_v1_aggregate_proto_msgTypes[6]
821
+ if x != nil {
822
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
823
+ if ms.LoadMessageInfo() == nil {
824
+ ms.StoreMessageInfo(mi)
825
+ }
826
+ return ms
827
+ }
828
+ return mi.MessageOf(x)
829
+ }
830
+
831
+ // Deprecated: Use AggregateRequest_Aggregation_Text.ProtoReflect.Descriptor instead.
832
+ func (*AggregateRequest_Aggregation_Text) Descriptor() ([]byte, []int) {
833
+ return file_v1_aggregate_proto_rawDescGZIP(), []int{0, 0, 2}
834
+ }
835
+
836
+ func (x *AggregateRequest_Aggregation_Text) GetCount() bool {
837
+ if x != nil {
838
+ return x.Count
839
+ }
840
+ return false
841
+ }
842
+
843
+ func (x *AggregateRequest_Aggregation_Text) GetType() bool {
844
+ if x != nil {
845
+ return x.Type
846
+ }
847
+ return false
848
+ }
849
+
850
+ func (x *AggregateRequest_Aggregation_Text) GetTopOccurences() bool {
851
+ if x != nil {
852
+ return x.TopOccurences
853
+ }
854
+ return false
855
+ }
856
+
857
+ func (x *AggregateRequest_Aggregation_Text) GetTopOccurencesLimit() uint32 {
858
+ if x != nil && x.TopOccurencesLimit != nil {
859
+ return *x.TopOccurencesLimit
860
+ }
861
+ return 0
862
+ }
863
+
864
+ type AggregateRequest_Aggregation_Boolean struct {
865
+ state protoimpl.MessageState `protogen:"open.v1"`
866
+ Count bool `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"`
867
+ Type bool `protobuf:"varint,2,opt,name=type,proto3" json:"type,omitempty"`
868
+ TotalTrue bool `protobuf:"varint,3,opt,name=total_true,json=totalTrue,proto3" json:"total_true,omitempty"`
869
+ TotalFalse bool `protobuf:"varint,4,opt,name=total_false,json=totalFalse,proto3" json:"total_false,omitempty"`
870
+ PercentageTrue bool `protobuf:"varint,5,opt,name=percentage_true,json=percentageTrue,proto3" json:"percentage_true,omitempty"`
871
+ PercentageFalse bool `protobuf:"varint,6,opt,name=percentage_false,json=percentageFalse,proto3" json:"percentage_false,omitempty"`
872
+ unknownFields protoimpl.UnknownFields
873
+ sizeCache protoimpl.SizeCache
874
+ }
875
+
876
+ func (x *AggregateRequest_Aggregation_Boolean) Reset() {
877
+ *x = AggregateRequest_Aggregation_Boolean{}
878
+ mi := &file_v1_aggregate_proto_msgTypes[7]
879
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
880
+ ms.StoreMessageInfo(mi)
881
+ }
882
+
883
+ func (x *AggregateRequest_Aggregation_Boolean) String() string {
884
+ return protoimpl.X.MessageStringOf(x)
885
+ }
886
+
887
+ func (*AggregateRequest_Aggregation_Boolean) ProtoMessage() {}
888
+
889
+ func (x *AggregateRequest_Aggregation_Boolean) ProtoReflect() protoreflect.Message {
890
+ mi := &file_v1_aggregate_proto_msgTypes[7]
891
+ if x != nil {
892
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
893
+ if ms.LoadMessageInfo() == nil {
894
+ ms.StoreMessageInfo(mi)
895
+ }
896
+ return ms
897
+ }
898
+ return mi.MessageOf(x)
899
+ }
900
+
901
+ // Deprecated: Use AggregateRequest_Aggregation_Boolean.ProtoReflect.Descriptor instead.
902
+ func (*AggregateRequest_Aggregation_Boolean) Descriptor() ([]byte, []int) {
903
+ return file_v1_aggregate_proto_rawDescGZIP(), []int{0, 0, 3}
904
+ }
905
+
906
+ func (x *AggregateRequest_Aggregation_Boolean) GetCount() bool {
907
+ if x != nil {
908
+ return x.Count
909
+ }
910
+ return false
911
+ }
912
+
913
+ func (x *AggregateRequest_Aggregation_Boolean) GetType() bool {
914
+ if x != nil {
915
+ return x.Type
916
+ }
917
+ return false
918
+ }
919
+
920
+ func (x *AggregateRequest_Aggregation_Boolean) GetTotalTrue() bool {
921
+ if x != nil {
922
+ return x.TotalTrue
923
+ }
924
+ return false
925
+ }
926
+
927
+ func (x *AggregateRequest_Aggregation_Boolean) GetTotalFalse() bool {
928
+ if x != nil {
929
+ return x.TotalFalse
930
+ }
931
+ return false
932
+ }
933
+
934
+ func (x *AggregateRequest_Aggregation_Boolean) GetPercentageTrue() bool {
935
+ if x != nil {
936
+ return x.PercentageTrue
937
+ }
938
+ return false
939
+ }
940
+
941
+ func (x *AggregateRequest_Aggregation_Boolean) GetPercentageFalse() bool {
942
+ if x != nil {
943
+ return x.PercentageFalse
944
+ }
945
+ return false
946
+ }
947
+
948
+ type AggregateRequest_Aggregation_Date struct {
949
+ state protoimpl.MessageState `protogen:"open.v1"`
950
+ Count bool `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"`
951
+ Type bool `protobuf:"varint,2,opt,name=type,proto3" json:"type,omitempty"`
952
+ Median bool `protobuf:"varint,3,opt,name=median,proto3" json:"median,omitempty"`
953
+ Mode bool `protobuf:"varint,4,opt,name=mode,proto3" json:"mode,omitempty"`
954
+ Maximum bool `protobuf:"varint,5,opt,name=maximum,proto3" json:"maximum,omitempty"`
955
+ Minimum bool `protobuf:"varint,6,opt,name=minimum,proto3" json:"minimum,omitempty"`
956
+ unknownFields protoimpl.UnknownFields
957
+ sizeCache protoimpl.SizeCache
958
+ }
959
+
960
+ func (x *AggregateRequest_Aggregation_Date) Reset() {
961
+ *x = AggregateRequest_Aggregation_Date{}
962
+ mi := &file_v1_aggregate_proto_msgTypes[8]
963
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
964
+ ms.StoreMessageInfo(mi)
965
+ }
966
+
967
+ func (x *AggregateRequest_Aggregation_Date) String() string {
968
+ return protoimpl.X.MessageStringOf(x)
969
+ }
970
+
971
+ func (*AggregateRequest_Aggregation_Date) ProtoMessage() {}
972
+
973
+ func (x *AggregateRequest_Aggregation_Date) ProtoReflect() protoreflect.Message {
974
+ mi := &file_v1_aggregate_proto_msgTypes[8]
975
+ if x != nil {
976
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
977
+ if ms.LoadMessageInfo() == nil {
978
+ ms.StoreMessageInfo(mi)
979
+ }
980
+ return ms
981
+ }
982
+ return mi.MessageOf(x)
983
+ }
984
+
985
+ // Deprecated: Use AggregateRequest_Aggregation_Date.ProtoReflect.Descriptor instead.
986
+ func (*AggregateRequest_Aggregation_Date) Descriptor() ([]byte, []int) {
987
+ return file_v1_aggregate_proto_rawDescGZIP(), []int{0, 0, 4}
988
+ }
989
+
990
+ func (x *AggregateRequest_Aggregation_Date) GetCount() bool {
991
+ if x != nil {
992
+ return x.Count
993
+ }
994
+ return false
995
+ }
996
+
997
+ func (x *AggregateRequest_Aggregation_Date) GetType() bool {
998
+ if x != nil {
999
+ return x.Type
1000
+ }
1001
+ return false
1002
+ }
1003
+
1004
+ func (x *AggregateRequest_Aggregation_Date) GetMedian() bool {
1005
+ if x != nil {
1006
+ return x.Median
1007
+ }
1008
+ return false
1009
+ }
1010
+
1011
+ func (x *AggregateRequest_Aggregation_Date) GetMode() bool {
1012
+ if x != nil {
1013
+ return x.Mode
1014
+ }
1015
+ return false
1016
+ }
1017
+
1018
+ func (x *AggregateRequest_Aggregation_Date) GetMaximum() bool {
1019
+ if x != nil {
1020
+ return x.Maximum
1021
+ }
1022
+ return false
1023
+ }
1024
+
1025
+ func (x *AggregateRequest_Aggregation_Date) GetMinimum() bool {
1026
+ if x != nil {
1027
+ return x.Minimum
1028
+ }
1029
+ return false
1030
+ }
1031
+
1032
+ type AggregateRequest_Aggregation_Reference struct {
1033
+ state protoimpl.MessageState `protogen:"open.v1"`
1034
+ Type bool `protobuf:"varint,1,opt,name=type,proto3" json:"type,omitempty"`
1035
+ PointingTo bool `protobuf:"varint,2,opt,name=pointing_to,json=pointingTo,proto3" json:"pointing_to,omitempty"`
1036
+ unknownFields protoimpl.UnknownFields
1037
+ sizeCache protoimpl.SizeCache
1038
+ }
1039
+
1040
+ func (x *AggregateRequest_Aggregation_Reference) Reset() {
1041
+ *x = AggregateRequest_Aggregation_Reference{}
1042
+ mi := &file_v1_aggregate_proto_msgTypes[9]
1043
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
1044
+ ms.StoreMessageInfo(mi)
1045
+ }
1046
+
1047
+ func (x *AggregateRequest_Aggregation_Reference) String() string {
1048
+ return protoimpl.X.MessageStringOf(x)
1049
+ }
1050
+
1051
+ func (*AggregateRequest_Aggregation_Reference) ProtoMessage() {}
1052
+
1053
+ func (x *AggregateRequest_Aggregation_Reference) ProtoReflect() protoreflect.Message {
1054
+ mi := &file_v1_aggregate_proto_msgTypes[9]
1055
+ if x != nil {
1056
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
1057
+ if ms.LoadMessageInfo() == nil {
1058
+ ms.StoreMessageInfo(mi)
1059
+ }
1060
+ return ms
1061
+ }
1062
+ return mi.MessageOf(x)
1063
+ }
1064
+
1065
+ // Deprecated: Use AggregateRequest_Aggregation_Reference.ProtoReflect.Descriptor instead.
1066
+ func (*AggregateRequest_Aggregation_Reference) Descriptor() ([]byte, []int) {
1067
+ return file_v1_aggregate_proto_rawDescGZIP(), []int{0, 0, 5}
1068
+ }
1069
+
1070
+ func (x *AggregateRequest_Aggregation_Reference) GetType() bool {
1071
+ if x != nil {
1072
+ return x.Type
1073
+ }
1074
+ return false
1075
+ }
1076
+
1077
+ func (x *AggregateRequest_Aggregation_Reference) GetPointingTo() bool {
1078
+ if x != nil {
1079
+ return x.PointingTo
1080
+ }
1081
+ return false
1082
+ }
1083
+
1084
+ type AggregateReply_Aggregations struct {
1085
+ state protoimpl.MessageState `protogen:"open.v1"`
1086
+ Aggregations []*AggregateReply_Aggregations_Aggregation `protobuf:"bytes,1,rep,name=aggregations,proto3" json:"aggregations,omitempty"`
1087
+ unknownFields protoimpl.UnknownFields
1088
+ sizeCache protoimpl.SizeCache
1089
+ }
1090
+
1091
+ func (x *AggregateReply_Aggregations) Reset() {
1092
+ *x = AggregateReply_Aggregations{}
1093
+ mi := &file_v1_aggregate_proto_msgTypes[10]
1094
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
1095
+ ms.StoreMessageInfo(mi)
1096
+ }
1097
+
1098
+ func (x *AggregateReply_Aggregations) String() string {
1099
+ return protoimpl.X.MessageStringOf(x)
1100
+ }
1101
+
1102
+ func (*AggregateReply_Aggregations) ProtoMessage() {}
1103
+
1104
+ func (x *AggregateReply_Aggregations) ProtoReflect() protoreflect.Message {
1105
+ mi := &file_v1_aggregate_proto_msgTypes[10]
1106
+ if x != nil {
1107
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
1108
+ if ms.LoadMessageInfo() == nil {
1109
+ ms.StoreMessageInfo(mi)
1110
+ }
1111
+ return ms
1112
+ }
1113
+ return mi.MessageOf(x)
1114
+ }
1115
+
1116
+ // Deprecated: Use AggregateReply_Aggregations.ProtoReflect.Descriptor instead.
1117
+ func (*AggregateReply_Aggregations) Descriptor() ([]byte, []int) {
1118
+ return file_v1_aggregate_proto_rawDescGZIP(), []int{1, 0}
1119
+ }
1120
+
1121
+ func (x *AggregateReply_Aggregations) GetAggregations() []*AggregateReply_Aggregations_Aggregation {
1122
+ if x != nil {
1123
+ return x.Aggregations
1124
+ }
1125
+ return nil
1126
+ }
1127
+
1128
+ type AggregateReply_Single struct {
1129
+ state protoimpl.MessageState `protogen:"open.v1"`
1130
+ ObjectsCount *int64 `protobuf:"varint,1,opt,name=objects_count,json=objectsCount,proto3,oneof" json:"objects_count,omitempty"`
1131
+ Aggregations *AggregateReply_Aggregations `protobuf:"bytes,2,opt,name=aggregations,proto3,oneof" json:"aggregations,omitempty"`
1132
+ unknownFields protoimpl.UnknownFields
1133
+ sizeCache protoimpl.SizeCache
1134
+ }
1135
+
1136
+ func (x *AggregateReply_Single) Reset() {
1137
+ *x = AggregateReply_Single{}
1138
+ mi := &file_v1_aggregate_proto_msgTypes[11]
1139
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
1140
+ ms.StoreMessageInfo(mi)
1141
+ }
1142
+
1143
+ func (x *AggregateReply_Single) String() string {
1144
+ return protoimpl.X.MessageStringOf(x)
1145
+ }
1146
+
1147
+ func (*AggregateReply_Single) ProtoMessage() {}
1148
+
1149
+ func (x *AggregateReply_Single) ProtoReflect() protoreflect.Message {
1150
+ mi := &file_v1_aggregate_proto_msgTypes[11]
1151
+ if x != nil {
1152
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
1153
+ if ms.LoadMessageInfo() == nil {
1154
+ ms.StoreMessageInfo(mi)
1155
+ }
1156
+ return ms
1157
+ }
1158
+ return mi.MessageOf(x)
1159
+ }
1160
+
1161
+ // Deprecated: Use AggregateReply_Single.ProtoReflect.Descriptor instead.
1162
+ func (*AggregateReply_Single) Descriptor() ([]byte, []int) {
1163
+ return file_v1_aggregate_proto_rawDescGZIP(), []int{1, 1}
1164
+ }
1165
+
1166
+ func (x *AggregateReply_Single) GetObjectsCount() int64 {
1167
+ if x != nil && x.ObjectsCount != nil {
1168
+ return *x.ObjectsCount
1169
+ }
1170
+ return 0
1171
+ }
1172
+
1173
+ func (x *AggregateReply_Single) GetAggregations() *AggregateReply_Aggregations {
1174
+ if x != nil {
1175
+ return x.Aggregations
1176
+ }
1177
+ return nil
1178
+ }
1179
+
1180
+ type AggregateReply_Group struct {
1181
+ state protoimpl.MessageState `protogen:"open.v1"`
1182
+ ObjectsCount *int64 `protobuf:"varint,1,opt,name=objects_count,json=objectsCount,proto3,oneof" json:"objects_count,omitempty"`
1183
+ Aggregations *AggregateReply_Aggregations `protobuf:"bytes,2,opt,name=aggregations,proto3,oneof" json:"aggregations,omitempty"`
1184
+ GroupedBy *AggregateReply_Group_GroupedBy `protobuf:"bytes,3,opt,name=grouped_by,json=groupedBy,proto3,oneof" json:"grouped_by,omitempty"`
1185
+ unknownFields protoimpl.UnknownFields
1186
+ sizeCache protoimpl.SizeCache
1187
+ }
1188
+
1189
+ func (x *AggregateReply_Group) Reset() {
1190
+ *x = AggregateReply_Group{}
1191
+ mi := &file_v1_aggregate_proto_msgTypes[12]
1192
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
1193
+ ms.StoreMessageInfo(mi)
1194
+ }
1195
+
1196
+ func (x *AggregateReply_Group) String() string {
1197
+ return protoimpl.X.MessageStringOf(x)
1198
+ }
1199
+
1200
+ func (*AggregateReply_Group) ProtoMessage() {}
1201
+
1202
+ func (x *AggregateReply_Group) ProtoReflect() protoreflect.Message {
1203
+ mi := &file_v1_aggregate_proto_msgTypes[12]
1204
+ if x != nil {
1205
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
1206
+ if ms.LoadMessageInfo() == nil {
1207
+ ms.StoreMessageInfo(mi)
1208
+ }
1209
+ return ms
1210
+ }
1211
+ return mi.MessageOf(x)
1212
+ }
1213
+
1214
+ // Deprecated: Use AggregateReply_Group.ProtoReflect.Descriptor instead.
1215
+ func (*AggregateReply_Group) Descriptor() ([]byte, []int) {
1216
+ return file_v1_aggregate_proto_rawDescGZIP(), []int{1, 2}
1217
+ }
1218
+
1219
+ func (x *AggregateReply_Group) GetObjectsCount() int64 {
1220
+ if x != nil && x.ObjectsCount != nil {
1221
+ return *x.ObjectsCount
1222
+ }
1223
+ return 0
1224
+ }
1225
+
1226
+ func (x *AggregateReply_Group) GetAggregations() *AggregateReply_Aggregations {
1227
+ if x != nil {
1228
+ return x.Aggregations
1229
+ }
1230
+ return nil
1231
+ }
1232
+
1233
+ func (x *AggregateReply_Group) GetGroupedBy() *AggregateReply_Group_GroupedBy {
1234
+ if x != nil {
1235
+ return x.GroupedBy
1236
+ }
1237
+ return nil
1238
+ }
1239
+
1240
+ type AggregateReply_Grouped struct {
1241
+ state protoimpl.MessageState `protogen:"open.v1"`
1242
+ Groups []*AggregateReply_Group `protobuf:"bytes,1,rep,name=groups,proto3" json:"groups,omitempty"`
1243
+ unknownFields protoimpl.UnknownFields
1244
+ sizeCache protoimpl.SizeCache
1245
+ }
1246
+
1247
+ func (x *AggregateReply_Grouped) Reset() {
1248
+ *x = AggregateReply_Grouped{}
1249
+ mi := &file_v1_aggregate_proto_msgTypes[13]
1250
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
1251
+ ms.StoreMessageInfo(mi)
1252
+ }
1253
+
1254
+ func (x *AggregateReply_Grouped) String() string {
1255
+ return protoimpl.X.MessageStringOf(x)
1256
+ }
1257
+
1258
+ func (*AggregateReply_Grouped) ProtoMessage() {}
1259
+
1260
+ func (x *AggregateReply_Grouped) ProtoReflect() protoreflect.Message {
1261
+ mi := &file_v1_aggregate_proto_msgTypes[13]
1262
+ if x != nil {
1263
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
1264
+ if ms.LoadMessageInfo() == nil {
1265
+ ms.StoreMessageInfo(mi)
1266
+ }
1267
+ return ms
1268
+ }
1269
+ return mi.MessageOf(x)
1270
+ }
1271
+
1272
+ // Deprecated: Use AggregateReply_Grouped.ProtoReflect.Descriptor instead.
1273
+ func (*AggregateReply_Grouped) Descriptor() ([]byte, []int) {
1274
+ return file_v1_aggregate_proto_rawDescGZIP(), []int{1, 3}
1275
+ }
1276
+
1277
+ func (x *AggregateReply_Grouped) GetGroups() []*AggregateReply_Group {
1278
+ if x != nil {
1279
+ return x.Groups
1280
+ }
1281
+ return nil
1282
+ }
1283
+
1284
+ type AggregateReply_Aggregations_Aggregation struct {
1285
+ state protoimpl.MessageState `protogen:"open.v1"`
1286
+ Property string `protobuf:"bytes,1,opt,name=property,proto3" json:"property,omitempty"`
1287
+ // Types that are valid to be assigned to Aggregation:
1288
+ //
1289
+ // *AggregateReply_Aggregations_Aggregation_Int
1290
+ // *AggregateReply_Aggregations_Aggregation_Number_
1291
+ // *AggregateReply_Aggregations_Aggregation_Text_
1292
+ // *AggregateReply_Aggregations_Aggregation_Boolean_
1293
+ // *AggregateReply_Aggregations_Aggregation_Date_
1294
+ // *AggregateReply_Aggregations_Aggregation_Reference_
1295
+ Aggregation isAggregateReply_Aggregations_Aggregation_Aggregation `protobuf_oneof:"aggregation"`
1296
+ unknownFields protoimpl.UnknownFields
1297
+ sizeCache protoimpl.SizeCache
1298
+ }
1299
+
1300
+ func (x *AggregateReply_Aggregations_Aggregation) Reset() {
1301
+ *x = AggregateReply_Aggregations_Aggregation{}
1302
+ mi := &file_v1_aggregate_proto_msgTypes[14]
1303
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
1304
+ ms.StoreMessageInfo(mi)
1305
+ }
1306
+
1307
+ func (x *AggregateReply_Aggregations_Aggregation) String() string {
1308
+ return protoimpl.X.MessageStringOf(x)
1309
+ }
1310
+
1311
+ func (*AggregateReply_Aggregations_Aggregation) ProtoMessage() {}
1312
+
1313
+ func (x *AggregateReply_Aggregations_Aggregation) ProtoReflect() protoreflect.Message {
1314
+ mi := &file_v1_aggregate_proto_msgTypes[14]
1315
+ if x != nil {
1316
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
1317
+ if ms.LoadMessageInfo() == nil {
1318
+ ms.StoreMessageInfo(mi)
1319
+ }
1320
+ return ms
1321
+ }
1322
+ return mi.MessageOf(x)
1323
+ }
1324
+
1325
+ // Deprecated: Use AggregateReply_Aggregations_Aggregation.ProtoReflect.Descriptor instead.
1326
+ func (*AggregateReply_Aggregations_Aggregation) Descriptor() ([]byte, []int) {
1327
+ return file_v1_aggregate_proto_rawDescGZIP(), []int{1, 0, 0}
1328
+ }
1329
+
1330
+ func (x *AggregateReply_Aggregations_Aggregation) GetProperty() string {
1331
+ if x != nil {
1332
+ return x.Property
1333
+ }
1334
+ return ""
1335
+ }
1336
+
1337
+ func (x *AggregateReply_Aggregations_Aggregation) GetAggregation() isAggregateReply_Aggregations_Aggregation_Aggregation {
1338
+ if x != nil {
1339
+ return x.Aggregation
1340
+ }
1341
+ return nil
1342
+ }
1343
+
1344
+ func (x *AggregateReply_Aggregations_Aggregation) GetInt() *AggregateReply_Aggregations_Aggregation_Integer {
1345
+ if x != nil {
1346
+ if x, ok := x.Aggregation.(*AggregateReply_Aggregations_Aggregation_Int); ok {
1347
+ return x.Int
1348
+ }
1349
+ }
1350
+ return nil
1351
+ }
1352
+
1353
+ func (x *AggregateReply_Aggregations_Aggregation) GetNumber() *AggregateReply_Aggregations_Aggregation_Number {
1354
+ if x != nil {
1355
+ if x, ok := x.Aggregation.(*AggregateReply_Aggregations_Aggregation_Number_); ok {
1356
+ return x.Number
1357
+ }
1358
+ }
1359
+ return nil
1360
+ }
1361
+
1362
+ func (x *AggregateReply_Aggregations_Aggregation) GetText() *AggregateReply_Aggregations_Aggregation_Text {
1363
+ if x != nil {
1364
+ if x, ok := x.Aggregation.(*AggregateReply_Aggregations_Aggregation_Text_); ok {
1365
+ return x.Text
1366
+ }
1367
+ }
1368
+ return nil
1369
+ }
1370
+
1371
+ func (x *AggregateReply_Aggregations_Aggregation) GetBoolean() *AggregateReply_Aggregations_Aggregation_Boolean {
1372
+ if x != nil {
1373
+ if x, ok := x.Aggregation.(*AggregateReply_Aggregations_Aggregation_Boolean_); ok {
1374
+ return x.Boolean
1375
+ }
1376
+ }
1377
+ return nil
1378
+ }
1379
+
1380
+ func (x *AggregateReply_Aggregations_Aggregation) GetDate() *AggregateReply_Aggregations_Aggregation_Date {
1381
+ if x != nil {
1382
+ if x, ok := x.Aggregation.(*AggregateReply_Aggregations_Aggregation_Date_); ok {
1383
+ return x.Date
1384
+ }
1385
+ }
1386
+ return nil
1387
+ }
1388
+
1389
+ func (x *AggregateReply_Aggregations_Aggregation) GetReference() *AggregateReply_Aggregations_Aggregation_Reference {
1390
+ if x != nil {
1391
+ if x, ok := x.Aggregation.(*AggregateReply_Aggregations_Aggregation_Reference_); ok {
1392
+ return x.Reference
1393
+ }
1394
+ }
1395
+ return nil
1396
+ }
1397
+
1398
+ type isAggregateReply_Aggregations_Aggregation_Aggregation interface {
1399
+ isAggregateReply_Aggregations_Aggregation_Aggregation()
1400
+ }
1401
+
1402
+ type AggregateReply_Aggregations_Aggregation_Int struct {
1403
+ Int *AggregateReply_Aggregations_Aggregation_Integer `protobuf:"bytes,2,opt,name=int,proto3,oneof"`
1404
+ }
1405
+
1406
+ type AggregateReply_Aggregations_Aggregation_Number_ struct {
1407
+ Number *AggregateReply_Aggregations_Aggregation_Number `protobuf:"bytes,3,opt,name=number,proto3,oneof"`
1408
+ }
1409
+
1410
+ type AggregateReply_Aggregations_Aggregation_Text_ struct {
1411
+ Text *AggregateReply_Aggregations_Aggregation_Text `protobuf:"bytes,4,opt,name=text,proto3,oneof"`
1412
+ }
1413
+
1414
+ type AggregateReply_Aggregations_Aggregation_Boolean_ struct {
1415
+ Boolean *AggregateReply_Aggregations_Aggregation_Boolean `protobuf:"bytes,5,opt,name=boolean,proto3,oneof"`
1416
+ }
1417
+
1418
+ type AggregateReply_Aggregations_Aggregation_Date_ struct {
1419
+ Date *AggregateReply_Aggregations_Aggregation_Date `protobuf:"bytes,6,opt,name=date,proto3,oneof"`
1420
+ }
1421
+
1422
+ type AggregateReply_Aggregations_Aggregation_Reference_ struct {
1423
+ Reference *AggregateReply_Aggregations_Aggregation_Reference `protobuf:"bytes,7,opt,name=reference,proto3,oneof"`
1424
+ }
1425
+
1426
+ func (*AggregateReply_Aggregations_Aggregation_Int) isAggregateReply_Aggregations_Aggregation_Aggregation() {
1427
+ }
1428
+
1429
+ func (*AggregateReply_Aggregations_Aggregation_Number_) isAggregateReply_Aggregations_Aggregation_Aggregation() {
1430
+ }
1431
+
1432
+ func (*AggregateReply_Aggregations_Aggregation_Text_) isAggregateReply_Aggregations_Aggregation_Aggregation() {
1433
+ }
1434
+
1435
+ func (*AggregateReply_Aggregations_Aggregation_Boolean_) isAggregateReply_Aggregations_Aggregation_Aggregation() {
1436
+ }
1437
+
1438
+ func (*AggregateReply_Aggregations_Aggregation_Date_) isAggregateReply_Aggregations_Aggregation_Aggregation() {
1439
+ }
1440
+
1441
+ func (*AggregateReply_Aggregations_Aggregation_Reference_) isAggregateReply_Aggregations_Aggregation_Aggregation() {
1442
+ }
1443
+
1444
+ type AggregateReply_Aggregations_Aggregation_Integer struct {
1445
+ state protoimpl.MessageState `protogen:"open.v1"`
1446
+ Count *int64 `protobuf:"varint,1,opt,name=count,proto3,oneof" json:"count,omitempty"`
1447
+ Type *string `protobuf:"bytes,2,opt,name=type,proto3,oneof" json:"type,omitempty"`
1448
+ Mean *float64 `protobuf:"fixed64,3,opt,name=mean,proto3,oneof" json:"mean,omitempty"`
1449
+ Median *float64 `protobuf:"fixed64,4,opt,name=median,proto3,oneof" json:"median,omitempty"`
1450
+ Mode *int64 `protobuf:"varint,5,opt,name=mode,proto3,oneof" json:"mode,omitempty"`
1451
+ Maximum *int64 `protobuf:"varint,6,opt,name=maximum,proto3,oneof" json:"maximum,omitempty"`
1452
+ Minimum *int64 `protobuf:"varint,7,opt,name=minimum,proto3,oneof" json:"minimum,omitempty"`
1453
+ Sum *int64 `protobuf:"varint,8,opt,name=sum,proto3,oneof" json:"sum,omitempty"`
1454
+ unknownFields protoimpl.UnknownFields
1455
+ sizeCache protoimpl.SizeCache
1456
+ }
1457
+
1458
+ func (x *AggregateReply_Aggregations_Aggregation_Integer) Reset() {
1459
+ *x = AggregateReply_Aggregations_Aggregation_Integer{}
1460
+ mi := &file_v1_aggregate_proto_msgTypes[15]
1461
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
1462
+ ms.StoreMessageInfo(mi)
1463
+ }
1464
+
1465
+ func (x *AggregateReply_Aggregations_Aggregation_Integer) String() string {
1466
+ return protoimpl.X.MessageStringOf(x)
1467
+ }
1468
+
1469
+ func (*AggregateReply_Aggregations_Aggregation_Integer) ProtoMessage() {}
1470
+
1471
+ func (x *AggregateReply_Aggregations_Aggregation_Integer) ProtoReflect() protoreflect.Message {
1472
+ mi := &file_v1_aggregate_proto_msgTypes[15]
1473
+ if x != nil {
1474
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
1475
+ if ms.LoadMessageInfo() == nil {
1476
+ ms.StoreMessageInfo(mi)
1477
+ }
1478
+ return ms
1479
+ }
1480
+ return mi.MessageOf(x)
1481
+ }
1482
+
1483
+ // Deprecated: Use AggregateReply_Aggregations_Aggregation_Integer.ProtoReflect.Descriptor instead.
1484
+ func (*AggregateReply_Aggregations_Aggregation_Integer) Descriptor() ([]byte, []int) {
1485
+ return file_v1_aggregate_proto_rawDescGZIP(), []int{1, 0, 0, 0}
1486
+ }
1487
+
1488
+ func (x *AggregateReply_Aggregations_Aggregation_Integer) GetCount() int64 {
1489
+ if x != nil && x.Count != nil {
1490
+ return *x.Count
1491
+ }
1492
+ return 0
1493
+ }
1494
+
1495
+ func (x *AggregateReply_Aggregations_Aggregation_Integer) GetType() string {
1496
+ if x != nil && x.Type != nil {
1497
+ return *x.Type
1498
+ }
1499
+ return ""
1500
+ }
1501
+
1502
+ func (x *AggregateReply_Aggregations_Aggregation_Integer) GetMean() float64 {
1503
+ if x != nil && x.Mean != nil {
1504
+ return *x.Mean
1505
+ }
1506
+ return 0
1507
+ }
1508
+
1509
+ func (x *AggregateReply_Aggregations_Aggregation_Integer) GetMedian() float64 {
1510
+ if x != nil && x.Median != nil {
1511
+ return *x.Median
1512
+ }
1513
+ return 0
1514
+ }
1515
+
1516
+ func (x *AggregateReply_Aggregations_Aggregation_Integer) GetMode() int64 {
1517
+ if x != nil && x.Mode != nil {
1518
+ return *x.Mode
1519
+ }
1520
+ return 0
1521
+ }
1522
+
1523
+ func (x *AggregateReply_Aggregations_Aggregation_Integer) GetMaximum() int64 {
1524
+ if x != nil && x.Maximum != nil {
1525
+ return *x.Maximum
1526
+ }
1527
+ return 0
1528
+ }
1529
+
1530
+ func (x *AggregateReply_Aggregations_Aggregation_Integer) GetMinimum() int64 {
1531
+ if x != nil && x.Minimum != nil {
1532
+ return *x.Minimum
1533
+ }
1534
+ return 0
1535
+ }
1536
+
1537
+ func (x *AggregateReply_Aggregations_Aggregation_Integer) GetSum() int64 {
1538
+ if x != nil && x.Sum != nil {
1539
+ return *x.Sum
1540
+ }
1541
+ return 0
1542
+ }
1543
+
1544
+ type AggregateReply_Aggregations_Aggregation_Number struct {
1545
+ state protoimpl.MessageState `protogen:"open.v1"`
1546
+ Count *int64 `protobuf:"varint,1,opt,name=count,proto3,oneof" json:"count,omitempty"`
1547
+ Type *string `protobuf:"bytes,2,opt,name=type,proto3,oneof" json:"type,omitempty"`
1548
+ Mean *float64 `protobuf:"fixed64,3,opt,name=mean,proto3,oneof" json:"mean,omitempty"`
1549
+ Median *float64 `protobuf:"fixed64,4,opt,name=median,proto3,oneof" json:"median,omitempty"`
1550
+ Mode *float64 `protobuf:"fixed64,5,opt,name=mode,proto3,oneof" json:"mode,omitempty"`
1551
+ Maximum *float64 `protobuf:"fixed64,6,opt,name=maximum,proto3,oneof" json:"maximum,omitempty"`
1552
+ Minimum *float64 `protobuf:"fixed64,7,opt,name=minimum,proto3,oneof" json:"minimum,omitempty"`
1553
+ Sum *float64 `protobuf:"fixed64,8,opt,name=sum,proto3,oneof" json:"sum,omitempty"`
1554
+ unknownFields protoimpl.UnknownFields
1555
+ sizeCache protoimpl.SizeCache
1556
+ }
1557
+
1558
+ func (x *AggregateReply_Aggregations_Aggregation_Number) Reset() {
1559
+ *x = AggregateReply_Aggregations_Aggregation_Number{}
1560
+ mi := &file_v1_aggregate_proto_msgTypes[16]
1561
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
1562
+ ms.StoreMessageInfo(mi)
1563
+ }
1564
+
1565
+ func (x *AggregateReply_Aggregations_Aggregation_Number) String() string {
1566
+ return protoimpl.X.MessageStringOf(x)
1567
+ }
1568
+
1569
+ func (*AggregateReply_Aggregations_Aggregation_Number) ProtoMessage() {}
1570
+
1571
+ func (x *AggregateReply_Aggregations_Aggregation_Number) ProtoReflect() protoreflect.Message {
1572
+ mi := &file_v1_aggregate_proto_msgTypes[16]
1573
+ if x != nil {
1574
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
1575
+ if ms.LoadMessageInfo() == nil {
1576
+ ms.StoreMessageInfo(mi)
1577
+ }
1578
+ return ms
1579
+ }
1580
+ return mi.MessageOf(x)
1581
+ }
1582
+
1583
+ // Deprecated: Use AggregateReply_Aggregations_Aggregation_Number.ProtoReflect.Descriptor instead.
1584
+ func (*AggregateReply_Aggregations_Aggregation_Number) Descriptor() ([]byte, []int) {
1585
+ return file_v1_aggregate_proto_rawDescGZIP(), []int{1, 0, 0, 1}
1586
+ }
1587
+
1588
+ func (x *AggregateReply_Aggregations_Aggregation_Number) GetCount() int64 {
1589
+ if x != nil && x.Count != nil {
1590
+ return *x.Count
1591
+ }
1592
+ return 0
1593
+ }
1594
+
1595
+ func (x *AggregateReply_Aggregations_Aggregation_Number) GetType() string {
1596
+ if x != nil && x.Type != nil {
1597
+ return *x.Type
1598
+ }
1599
+ return ""
1600
+ }
1601
+
1602
+ func (x *AggregateReply_Aggregations_Aggregation_Number) GetMean() float64 {
1603
+ if x != nil && x.Mean != nil {
1604
+ return *x.Mean
1605
+ }
1606
+ return 0
1607
+ }
1608
+
1609
+ func (x *AggregateReply_Aggregations_Aggregation_Number) GetMedian() float64 {
1610
+ if x != nil && x.Median != nil {
1611
+ return *x.Median
1612
+ }
1613
+ return 0
1614
+ }
1615
+
1616
+ func (x *AggregateReply_Aggregations_Aggregation_Number) GetMode() float64 {
1617
+ if x != nil && x.Mode != nil {
1618
+ return *x.Mode
1619
+ }
1620
+ return 0
1621
+ }
1622
+
1623
+ func (x *AggregateReply_Aggregations_Aggregation_Number) GetMaximum() float64 {
1624
+ if x != nil && x.Maximum != nil {
1625
+ return *x.Maximum
1626
+ }
1627
+ return 0
1628
+ }
1629
+
1630
+ func (x *AggregateReply_Aggregations_Aggregation_Number) GetMinimum() float64 {
1631
+ if x != nil && x.Minimum != nil {
1632
+ return *x.Minimum
1633
+ }
1634
+ return 0
1635
+ }
1636
+
1637
+ func (x *AggregateReply_Aggregations_Aggregation_Number) GetSum() float64 {
1638
+ if x != nil && x.Sum != nil {
1639
+ return *x.Sum
1640
+ }
1641
+ return 0
1642
+ }
1643
+
1644
+ type AggregateReply_Aggregations_Aggregation_Text struct {
1645
+ state protoimpl.MessageState `protogen:"open.v1"`
1646
+ Count *int64 `protobuf:"varint,1,opt,name=count,proto3,oneof" json:"count,omitempty"`
1647
+ Type *string `protobuf:"bytes,2,opt,name=type,proto3,oneof" json:"type,omitempty"`
1648
+ TopOccurences *AggregateReply_Aggregations_Aggregation_Text_TopOccurrences `protobuf:"bytes,3,opt,name=top_occurences,json=topOccurences,proto3,oneof" json:"top_occurences,omitempty"`
1649
+ unknownFields protoimpl.UnknownFields
1650
+ sizeCache protoimpl.SizeCache
1651
+ }
1652
+
1653
+ func (x *AggregateReply_Aggregations_Aggregation_Text) Reset() {
1654
+ *x = AggregateReply_Aggregations_Aggregation_Text{}
1655
+ mi := &file_v1_aggregate_proto_msgTypes[17]
1656
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
1657
+ ms.StoreMessageInfo(mi)
1658
+ }
1659
+
1660
+ func (x *AggregateReply_Aggregations_Aggregation_Text) String() string {
1661
+ return protoimpl.X.MessageStringOf(x)
1662
+ }
1663
+
1664
+ func (*AggregateReply_Aggregations_Aggregation_Text) ProtoMessage() {}
1665
+
1666
+ func (x *AggregateReply_Aggregations_Aggregation_Text) ProtoReflect() protoreflect.Message {
1667
+ mi := &file_v1_aggregate_proto_msgTypes[17]
1668
+ if x != nil {
1669
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
1670
+ if ms.LoadMessageInfo() == nil {
1671
+ ms.StoreMessageInfo(mi)
1672
+ }
1673
+ return ms
1674
+ }
1675
+ return mi.MessageOf(x)
1676
+ }
1677
+
1678
+ // Deprecated: Use AggregateReply_Aggregations_Aggregation_Text.ProtoReflect.Descriptor instead.
1679
+ func (*AggregateReply_Aggregations_Aggregation_Text) Descriptor() ([]byte, []int) {
1680
+ return file_v1_aggregate_proto_rawDescGZIP(), []int{1, 0, 0, 2}
1681
+ }
1682
+
1683
+ func (x *AggregateReply_Aggregations_Aggregation_Text) GetCount() int64 {
1684
+ if x != nil && x.Count != nil {
1685
+ return *x.Count
1686
+ }
1687
+ return 0
1688
+ }
1689
+
1690
+ func (x *AggregateReply_Aggregations_Aggregation_Text) GetType() string {
1691
+ if x != nil && x.Type != nil {
1692
+ return *x.Type
1693
+ }
1694
+ return ""
1695
+ }
1696
+
1697
+ func (x *AggregateReply_Aggregations_Aggregation_Text) GetTopOccurences() *AggregateReply_Aggregations_Aggregation_Text_TopOccurrences {
1698
+ if x != nil {
1699
+ return x.TopOccurences
1700
+ }
1701
+ return nil
1702
+ }
1703
+
1704
+ type AggregateReply_Aggregations_Aggregation_Boolean struct {
1705
+ state protoimpl.MessageState `protogen:"open.v1"`
1706
+ Count *int64 `protobuf:"varint,1,opt,name=count,proto3,oneof" json:"count,omitempty"`
1707
+ Type *string `protobuf:"bytes,2,opt,name=type,proto3,oneof" json:"type,omitempty"`
1708
+ TotalTrue *int64 `protobuf:"varint,3,opt,name=total_true,json=totalTrue,proto3,oneof" json:"total_true,omitempty"`
1709
+ TotalFalse *int64 `protobuf:"varint,4,opt,name=total_false,json=totalFalse,proto3,oneof" json:"total_false,omitempty"`
1710
+ PercentageTrue *float64 `protobuf:"fixed64,5,opt,name=percentage_true,json=percentageTrue,proto3,oneof" json:"percentage_true,omitempty"`
1711
+ PercentageFalse *float64 `protobuf:"fixed64,6,opt,name=percentage_false,json=percentageFalse,proto3,oneof" json:"percentage_false,omitempty"`
1712
+ unknownFields protoimpl.UnknownFields
1713
+ sizeCache protoimpl.SizeCache
1714
+ }
1715
+
1716
+ func (x *AggregateReply_Aggregations_Aggregation_Boolean) Reset() {
1717
+ *x = AggregateReply_Aggregations_Aggregation_Boolean{}
1718
+ mi := &file_v1_aggregate_proto_msgTypes[18]
1719
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
1720
+ ms.StoreMessageInfo(mi)
1721
+ }
1722
+
1723
+ func (x *AggregateReply_Aggregations_Aggregation_Boolean) String() string {
1724
+ return protoimpl.X.MessageStringOf(x)
1725
+ }
1726
+
1727
+ func (*AggregateReply_Aggregations_Aggregation_Boolean) ProtoMessage() {}
1728
+
1729
+ func (x *AggregateReply_Aggregations_Aggregation_Boolean) ProtoReflect() protoreflect.Message {
1730
+ mi := &file_v1_aggregate_proto_msgTypes[18]
1731
+ if x != nil {
1732
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
1733
+ if ms.LoadMessageInfo() == nil {
1734
+ ms.StoreMessageInfo(mi)
1735
+ }
1736
+ return ms
1737
+ }
1738
+ return mi.MessageOf(x)
1739
+ }
1740
+
1741
+ // Deprecated: Use AggregateReply_Aggregations_Aggregation_Boolean.ProtoReflect.Descriptor instead.
1742
+ func (*AggregateReply_Aggregations_Aggregation_Boolean) Descriptor() ([]byte, []int) {
1743
+ return file_v1_aggregate_proto_rawDescGZIP(), []int{1, 0, 0, 3}
1744
+ }
1745
+
1746
+ func (x *AggregateReply_Aggregations_Aggregation_Boolean) GetCount() int64 {
1747
+ if x != nil && x.Count != nil {
1748
+ return *x.Count
1749
+ }
1750
+ return 0
1751
+ }
1752
+
1753
+ func (x *AggregateReply_Aggregations_Aggregation_Boolean) GetType() string {
1754
+ if x != nil && x.Type != nil {
1755
+ return *x.Type
1756
+ }
1757
+ return ""
1758
+ }
1759
+
1760
+ func (x *AggregateReply_Aggregations_Aggregation_Boolean) GetTotalTrue() int64 {
1761
+ if x != nil && x.TotalTrue != nil {
1762
+ return *x.TotalTrue
1763
+ }
1764
+ return 0
1765
+ }
1766
+
1767
+ func (x *AggregateReply_Aggregations_Aggregation_Boolean) GetTotalFalse() int64 {
1768
+ if x != nil && x.TotalFalse != nil {
1769
+ return *x.TotalFalse
1770
+ }
1771
+ return 0
1772
+ }
1773
+
1774
+ func (x *AggregateReply_Aggregations_Aggregation_Boolean) GetPercentageTrue() float64 {
1775
+ if x != nil && x.PercentageTrue != nil {
1776
+ return *x.PercentageTrue
1777
+ }
1778
+ return 0
1779
+ }
1780
+
1781
+ func (x *AggregateReply_Aggregations_Aggregation_Boolean) GetPercentageFalse() float64 {
1782
+ if x != nil && x.PercentageFalse != nil {
1783
+ return *x.PercentageFalse
1784
+ }
1785
+ return 0
1786
+ }
1787
+
1788
+ type AggregateReply_Aggregations_Aggregation_Date struct {
1789
+ state protoimpl.MessageState `protogen:"open.v1"`
1790
+ Count *int64 `protobuf:"varint,1,opt,name=count,proto3,oneof" json:"count,omitempty"`
1791
+ Type *string `protobuf:"bytes,2,opt,name=type,proto3,oneof" json:"type,omitempty"`
1792
+ Median *string `protobuf:"bytes,3,opt,name=median,proto3,oneof" json:"median,omitempty"`
1793
+ Mode *string `protobuf:"bytes,4,opt,name=mode,proto3,oneof" json:"mode,omitempty"`
1794
+ Maximum *string `protobuf:"bytes,5,opt,name=maximum,proto3,oneof" json:"maximum,omitempty"`
1795
+ Minimum *string `protobuf:"bytes,6,opt,name=minimum,proto3,oneof" json:"minimum,omitempty"`
1796
+ unknownFields protoimpl.UnknownFields
1797
+ sizeCache protoimpl.SizeCache
1798
+ }
1799
+
1800
+ func (x *AggregateReply_Aggregations_Aggregation_Date) Reset() {
1801
+ *x = AggregateReply_Aggregations_Aggregation_Date{}
1802
+ mi := &file_v1_aggregate_proto_msgTypes[19]
1803
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
1804
+ ms.StoreMessageInfo(mi)
1805
+ }
1806
+
1807
+ func (x *AggregateReply_Aggregations_Aggregation_Date) String() string {
1808
+ return protoimpl.X.MessageStringOf(x)
1809
+ }
1810
+
1811
+ func (*AggregateReply_Aggregations_Aggregation_Date) ProtoMessage() {}
1812
+
1813
+ func (x *AggregateReply_Aggregations_Aggregation_Date) ProtoReflect() protoreflect.Message {
1814
+ mi := &file_v1_aggregate_proto_msgTypes[19]
1815
+ if x != nil {
1816
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
1817
+ if ms.LoadMessageInfo() == nil {
1818
+ ms.StoreMessageInfo(mi)
1819
+ }
1820
+ return ms
1821
+ }
1822
+ return mi.MessageOf(x)
1823
+ }
1824
+
1825
+ // Deprecated: Use AggregateReply_Aggregations_Aggregation_Date.ProtoReflect.Descriptor instead.
1826
+ func (*AggregateReply_Aggregations_Aggregation_Date) Descriptor() ([]byte, []int) {
1827
+ return file_v1_aggregate_proto_rawDescGZIP(), []int{1, 0, 0, 4}
1828
+ }
1829
+
1830
+ func (x *AggregateReply_Aggregations_Aggregation_Date) GetCount() int64 {
1831
+ if x != nil && x.Count != nil {
1832
+ return *x.Count
1833
+ }
1834
+ return 0
1835
+ }
1836
+
1837
+ func (x *AggregateReply_Aggregations_Aggregation_Date) GetType() string {
1838
+ if x != nil && x.Type != nil {
1839
+ return *x.Type
1840
+ }
1841
+ return ""
1842
+ }
1843
+
1844
+ func (x *AggregateReply_Aggregations_Aggregation_Date) GetMedian() string {
1845
+ if x != nil && x.Median != nil {
1846
+ return *x.Median
1847
+ }
1848
+ return ""
1849
+ }
1850
+
1851
+ func (x *AggregateReply_Aggregations_Aggregation_Date) GetMode() string {
1852
+ if x != nil && x.Mode != nil {
1853
+ return *x.Mode
1854
+ }
1855
+ return ""
1856
+ }
1857
+
1858
+ func (x *AggregateReply_Aggregations_Aggregation_Date) GetMaximum() string {
1859
+ if x != nil && x.Maximum != nil {
1860
+ return *x.Maximum
1861
+ }
1862
+ return ""
1863
+ }
1864
+
1865
+ func (x *AggregateReply_Aggregations_Aggregation_Date) GetMinimum() string {
1866
+ if x != nil && x.Minimum != nil {
1867
+ return *x.Minimum
1868
+ }
1869
+ return ""
1870
+ }
1871
+
1872
+ type AggregateReply_Aggregations_Aggregation_Reference struct {
1873
+ state protoimpl.MessageState `protogen:"open.v1"`
1874
+ Type *string `protobuf:"bytes,1,opt,name=type,proto3,oneof" json:"type,omitempty"`
1875
+ // protolint:disable:next REPEATED_FIELD_NAMES_PLURALIZED
1876
+ PointingTo []string `protobuf:"bytes,2,rep,name=pointing_to,json=pointingTo,proto3" json:"pointing_to,omitempty"`
1877
+ unknownFields protoimpl.UnknownFields
1878
+ sizeCache protoimpl.SizeCache
1879
+ }
1880
+
1881
+ func (x *AggregateReply_Aggregations_Aggregation_Reference) Reset() {
1882
+ *x = AggregateReply_Aggregations_Aggregation_Reference{}
1883
+ mi := &file_v1_aggregate_proto_msgTypes[20]
1884
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
1885
+ ms.StoreMessageInfo(mi)
1886
+ }
1887
+
1888
+ func (x *AggregateReply_Aggregations_Aggregation_Reference) String() string {
1889
+ return protoimpl.X.MessageStringOf(x)
1890
+ }
1891
+
1892
+ func (*AggregateReply_Aggregations_Aggregation_Reference) ProtoMessage() {}
1893
+
1894
+ func (x *AggregateReply_Aggregations_Aggregation_Reference) ProtoReflect() protoreflect.Message {
1895
+ mi := &file_v1_aggregate_proto_msgTypes[20]
1896
+ if x != nil {
1897
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
1898
+ if ms.LoadMessageInfo() == nil {
1899
+ ms.StoreMessageInfo(mi)
1900
+ }
1901
+ return ms
1902
+ }
1903
+ return mi.MessageOf(x)
1904
+ }
1905
+
1906
+ // Deprecated: Use AggregateReply_Aggregations_Aggregation_Reference.ProtoReflect.Descriptor instead.
1907
+ func (*AggregateReply_Aggregations_Aggregation_Reference) Descriptor() ([]byte, []int) {
1908
+ return file_v1_aggregate_proto_rawDescGZIP(), []int{1, 0, 0, 5}
1909
+ }
1910
+
1911
+ func (x *AggregateReply_Aggregations_Aggregation_Reference) GetType() string {
1912
+ if x != nil && x.Type != nil {
1913
+ return *x.Type
1914
+ }
1915
+ return ""
1916
+ }
1917
+
1918
+ func (x *AggregateReply_Aggregations_Aggregation_Reference) GetPointingTo() []string {
1919
+ if x != nil {
1920
+ return x.PointingTo
1921
+ }
1922
+ return nil
1923
+ }
1924
+
1925
+ type AggregateReply_Aggregations_Aggregation_Text_TopOccurrences struct {
1926
+ state protoimpl.MessageState `protogen:"open.v1"`
1927
+ Items []*AggregateReply_Aggregations_Aggregation_Text_TopOccurrences_TopOccurrence `protobuf:"bytes,1,rep,name=items,proto3" json:"items,omitempty"`
1928
+ unknownFields protoimpl.UnknownFields
1929
+ sizeCache protoimpl.SizeCache
1930
+ }
1931
+
1932
+ func (x *AggregateReply_Aggregations_Aggregation_Text_TopOccurrences) Reset() {
1933
+ *x = AggregateReply_Aggregations_Aggregation_Text_TopOccurrences{}
1934
+ mi := &file_v1_aggregate_proto_msgTypes[21]
1935
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
1936
+ ms.StoreMessageInfo(mi)
1937
+ }
1938
+
1939
+ func (x *AggregateReply_Aggregations_Aggregation_Text_TopOccurrences) String() string {
1940
+ return protoimpl.X.MessageStringOf(x)
1941
+ }
1942
+
1943
+ func (*AggregateReply_Aggregations_Aggregation_Text_TopOccurrences) ProtoMessage() {}
1944
+
1945
+ func (x *AggregateReply_Aggregations_Aggregation_Text_TopOccurrences) ProtoReflect() protoreflect.Message {
1946
+ mi := &file_v1_aggregate_proto_msgTypes[21]
1947
+ if x != nil {
1948
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
1949
+ if ms.LoadMessageInfo() == nil {
1950
+ ms.StoreMessageInfo(mi)
1951
+ }
1952
+ return ms
1953
+ }
1954
+ return mi.MessageOf(x)
1955
+ }
1956
+
1957
+ // Deprecated: Use AggregateReply_Aggregations_Aggregation_Text_TopOccurrences.ProtoReflect.Descriptor instead.
1958
+ func (*AggregateReply_Aggregations_Aggregation_Text_TopOccurrences) Descriptor() ([]byte, []int) {
1959
+ return file_v1_aggregate_proto_rawDescGZIP(), []int{1, 0, 0, 2, 0}
1960
+ }
1961
+
1962
+ func (x *AggregateReply_Aggregations_Aggregation_Text_TopOccurrences) GetItems() []*AggregateReply_Aggregations_Aggregation_Text_TopOccurrences_TopOccurrence {
1963
+ if x != nil {
1964
+ return x.Items
1965
+ }
1966
+ return nil
1967
+ }
1968
+
1969
+ type AggregateReply_Aggregations_Aggregation_Text_TopOccurrences_TopOccurrence struct {
1970
+ state protoimpl.MessageState `protogen:"open.v1"`
1971
+ Value string `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"`
1972
+ Occurs int64 `protobuf:"varint,2,opt,name=occurs,proto3" json:"occurs,omitempty"`
1973
+ unknownFields protoimpl.UnknownFields
1974
+ sizeCache protoimpl.SizeCache
1975
+ }
1976
+
1977
+ func (x *AggregateReply_Aggregations_Aggregation_Text_TopOccurrences_TopOccurrence) Reset() {
1978
+ *x = AggregateReply_Aggregations_Aggregation_Text_TopOccurrences_TopOccurrence{}
1979
+ mi := &file_v1_aggregate_proto_msgTypes[22]
1980
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
1981
+ ms.StoreMessageInfo(mi)
1982
+ }
1983
+
1984
+ func (x *AggregateReply_Aggregations_Aggregation_Text_TopOccurrences_TopOccurrence) String() string {
1985
+ return protoimpl.X.MessageStringOf(x)
1986
+ }
1987
+
1988
+ func (*AggregateReply_Aggregations_Aggregation_Text_TopOccurrences_TopOccurrence) ProtoMessage() {}
1989
+
1990
+ func (x *AggregateReply_Aggregations_Aggregation_Text_TopOccurrences_TopOccurrence) ProtoReflect() protoreflect.Message {
1991
+ mi := &file_v1_aggregate_proto_msgTypes[22]
1992
+ if x != nil {
1993
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
1994
+ if ms.LoadMessageInfo() == nil {
1995
+ ms.StoreMessageInfo(mi)
1996
+ }
1997
+ return ms
1998
+ }
1999
+ return mi.MessageOf(x)
2000
+ }
2001
+
2002
+ // Deprecated: Use AggregateReply_Aggregations_Aggregation_Text_TopOccurrences_TopOccurrence.ProtoReflect.Descriptor instead.
2003
+ func (*AggregateReply_Aggregations_Aggregation_Text_TopOccurrences_TopOccurrence) Descriptor() ([]byte, []int) {
2004
+ return file_v1_aggregate_proto_rawDescGZIP(), []int{1, 0, 0, 2, 0, 0}
2005
+ }
2006
+
2007
+ func (x *AggregateReply_Aggregations_Aggregation_Text_TopOccurrences_TopOccurrence) GetValue() string {
2008
+ if x != nil {
2009
+ return x.Value
2010
+ }
2011
+ return ""
2012
+ }
2013
+
2014
+ func (x *AggregateReply_Aggregations_Aggregation_Text_TopOccurrences_TopOccurrence) GetOccurs() int64 {
2015
+ if x != nil {
2016
+ return x.Occurs
2017
+ }
2018
+ return 0
2019
+ }
2020
+
2021
+ type AggregateReply_Group_GroupedBy struct {
2022
+ state protoimpl.MessageState `protogen:"open.v1"`
2023
+ // protolint:disable:next REPEATED_FIELD_NAMES_PLURALIZED
2024
+ Path []string `protobuf:"bytes,1,rep,name=path,proto3" json:"path,omitempty"`
2025
+ // Types that are valid to be assigned to Value:
2026
+ //
2027
+ // *AggregateReply_Group_GroupedBy_Text
2028
+ // *AggregateReply_Group_GroupedBy_Int
2029
+ // *AggregateReply_Group_GroupedBy_Boolean
2030
+ // *AggregateReply_Group_GroupedBy_Number
2031
+ // *AggregateReply_Group_GroupedBy_Texts
2032
+ // *AggregateReply_Group_GroupedBy_Ints
2033
+ // *AggregateReply_Group_GroupedBy_Booleans
2034
+ // *AggregateReply_Group_GroupedBy_Numbers
2035
+ // *AggregateReply_Group_GroupedBy_Geo
2036
+ Value isAggregateReply_Group_GroupedBy_Value `protobuf_oneof:"value"`
2037
+ unknownFields protoimpl.UnknownFields
2038
+ sizeCache protoimpl.SizeCache
2039
+ }
2040
+
2041
+ func (x *AggregateReply_Group_GroupedBy) Reset() {
2042
+ *x = AggregateReply_Group_GroupedBy{}
2043
+ mi := &file_v1_aggregate_proto_msgTypes[23]
2044
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
2045
+ ms.StoreMessageInfo(mi)
2046
+ }
2047
+
2048
+ func (x *AggregateReply_Group_GroupedBy) String() string {
2049
+ return protoimpl.X.MessageStringOf(x)
2050
+ }
2051
+
2052
+ func (*AggregateReply_Group_GroupedBy) ProtoMessage() {}
2053
+
2054
+ func (x *AggregateReply_Group_GroupedBy) ProtoReflect() protoreflect.Message {
2055
+ mi := &file_v1_aggregate_proto_msgTypes[23]
2056
+ if x != nil {
2057
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
2058
+ if ms.LoadMessageInfo() == nil {
2059
+ ms.StoreMessageInfo(mi)
2060
+ }
2061
+ return ms
2062
+ }
2063
+ return mi.MessageOf(x)
2064
+ }
2065
+
2066
+ // Deprecated: Use AggregateReply_Group_GroupedBy.ProtoReflect.Descriptor instead.
2067
+ func (*AggregateReply_Group_GroupedBy) Descriptor() ([]byte, []int) {
2068
+ return file_v1_aggregate_proto_rawDescGZIP(), []int{1, 2, 0}
2069
+ }
2070
+
2071
+ func (x *AggregateReply_Group_GroupedBy) GetPath() []string {
2072
+ if x != nil {
2073
+ return x.Path
2074
+ }
2075
+ return nil
2076
+ }
2077
+
2078
+ func (x *AggregateReply_Group_GroupedBy) GetValue() isAggregateReply_Group_GroupedBy_Value {
2079
+ if x != nil {
2080
+ return x.Value
2081
+ }
2082
+ return nil
2083
+ }
2084
+
2085
+ func (x *AggregateReply_Group_GroupedBy) GetText() string {
2086
+ if x != nil {
2087
+ if x, ok := x.Value.(*AggregateReply_Group_GroupedBy_Text); ok {
2088
+ return x.Text
2089
+ }
2090
+ }
2091
+ return ""
2092
+ }
2093
+
2094
+ func (x *AggregateReply_Group_GroupedBy) GetInt() int64 {
2095
+ if x != nil {
2096
+ if x, ok := x.Value.(*AggregateReply_Group_GroupedBy_Int); ok {
2097
+ return x.Int
2098
+ }
2099
+ }
2100
+ return 0
2101
+ }
2102
+
2103
+ func (x *AggregateReply_Group_GroupedBy) GetBoolean() bool {
2104
+ if x != nil {
2105
+ if x, ok := x.Value.(*AggregateReply_Group_GroupedBy_Boolean); ok {
2106
+ return x.Boolean
2107
+ }
2108
+ }
2109
+ return false
2110
+ }
2111
+
2112
+ func (x *AggregateReply_Group_GroupedBy) GetNumber() float64 {
2113
+ if x != nil {
2114
+ if x, ok := x.Value.(*AggregateReply_Group_GroupedBy_Number); ok {
2115
+ return x.Number
2116
+ }
2117
+ }
2118
+ return 0
2119
+ }
2120
+
2121
+ func (x *AggregateReply_Group_GroupedBy) GetTexts() *TextArray {
2122
+ if x != nil {
2123
+ if x, ok := x.Value.(*AggregateReply_Group_GroupedBy_Texts); ok {
2124
+ return x.Texts
2125
+ }
2126
+ }
2127
+ return nil
2128
+ }
2129
+
2130
+ func (x *AggregateReply_Group_GroupedBy) GetInts() *IntArray {
2131
+ if x != nil {
2132
+ if x, ok := x.Value.(*AggregateReply_Group_GroupedBy_Ints); ok {
2133
+ return x.Ints
2134
+ }
2135
+ }
2136
+ return nil
2137
+ }
2138
+
2139
+ func (x *AggregateReply_Group_GroupedBy) GetBooleans() *BooleanArray {
2140
+ if x != nil {
2141
+ if x, ok := x.Value.(*AggregateReply_Group_GroupedBy_Booleans); ok {
2142
+ return x.Booleans
2143
+ }
2144
+ }
2145
+ return nil
2146
+ }
2147
+
2148
+ func (x *AggregateReply_Group_GroupedBy) GetNumbers() *NumberArray {
2149
+ if x != nil {
2150
+ if x, ok := x.Value.(*AggregateReply_Group_GroupedBy_Numbers); ok {
2151
+ return x.Numbers
2152
+ }
2153
+ }
2154
+ return nil
2155
+ }
2156
+
2157
+ func (x *AggregateReply_Group_GroupedBy) GetGeo() *GeoCoordinatesFilter {
2158
+ if x != nil {
2159
+ if x, ok := x.Value.(*AggregateReply_Group_GroupedBy_Geo); ok {
2160
+ return x.Geo
2161
+ }
2162
+ }
2163
+ return nil
2164
+ }
2165
+
2166
+ type isAggregateReply_Group_GroupedBy_Value interface {
2167
+ isAggregateReply_Group_GroupedBy_Value()
2168
+ }
2169
+
2170
+ type AggregateReply_Group_GroupedBy_Text struct {
2171
+ Text string `protobuf:"bytes,2,opt,name=text,proto3,oneof"`
2172
+ }
2173
+
2174
+ type AggregateReply_Group_GroupedBy_Int struct {
2175
+ Int int64 `protobuf:"varint,3,opt,name=int,proto3,oneof"`
2176
+ }
2177
+
2178
+ type AggregateReply_Group_GroupedBy_Boolean struct {
2179
+ Boolean bool `protobuf:"varint,4,opt,name=boolean,proto3,oneof"`
2180
+ }
2181
+
2182
+ type AggregateReply_Group_GroupedBy_Number struct {
2183
+ Number float64 `protobuf:"fixed64,5,opt,name=number,proto3,oneof"`
2184
+ }
2185
+
2186
+ type AggregateReply_Group_GroupedBy_Texts struct {
2187
+ Texts *TextArray `protobuf:"bytes,6,opt,name=texts,proto3,oneof"`
2188
+ }
2189
+
2190
+ type AggregateReply_Group_GroupedBy_Ints struct {
2191
+ Ints *IntArray `protobuf:"bytes,7,opt,name=ints,proto3,oneof"`
2192
+ }
2193
+
2194
+ type AggregateReply_Group_GroupedBy_Booleans struct {
2195
+ Booleans *BooleanArray `protobuf:"bytes,8,opt,name=booleans,proto3,oneof"`
2196
+ }
2197
+
2198
+ type AggregateReply_Group_GroupedBy_Numbers struct {
2199
+ Numbers *NumberArray `protobuf:"bytes,9,opt,name=numbers,proto3,oneof"`
2200
+ }
2201
+
2202
+ type AggregateReply_Group_GroupedBy_Geo struct {
2203
+ Geo *GeoCoordinatesFilter `protobuf:"bytes,10,opt,name=geo,proto3,oneof"`
2204
+ }
2205
+
2206
+ func (*AggregateReply_Group_GroupedBy_Text) isAggregateReply_Group_GroupedBy_Value() {}
2207
+
2208
+ func (*AggregateReply_Group_GroupedBy_Int) isAggregateReply_Group_GroupedBy_Value() {}
2209
+
2210
+ func (*AggregateReply_Group_GroupedBy_Boolean) isAggregateReply_Group_GroupedBy_Value() {}
2211
+
2212
+ func (*AggregateReply_Group_GroupedBy_Number) isAggregateReply_Group_GroupedBy_Value() {}
2213
+
2214
+ func (*AggregateReply_Group_GroupedBy_Texts) isAggregateReply_Group_GroupedBy_Value() {}
2215
+
2216
+ func (*AggregateReply_Group_GroupedBy_Ints) isAggregateReply_Group_GroupedBy_Value() {}
2217
+
2218
+ func (*AggregateReply_Group_GroupedBy_Booleans) isAggregateReply_Group_GroupedBy_Value() {}
2219
+
2220
+ func (*AggregateReply_Group_GroupedBy_Numbers) isAggregateReply_Group_GroupedBy_Value() {}
2221
+
2222
+ func (*AggregateReply_Group_GroupedBy_Geo) isAggregateReply_Group_GroupedBy_Value() {}
2223
+
2224
+ var File_v1_aggregate_proto protoreflect.FileDescriptor
2225
+
2226
+ const file_v1_aggregate_proto_rawDesc = "" +
2227
+ "\n" +
2228
+ "\x12v1/aggregate.proto\x12\vweaviate.v1\x1a\rv1/base.proto\x1a\x14v1/base_search.proto\"\x9d\x14\n" +
2229
+ "\x10AggregateRequest\x12\x1e\n" +
2230
+ "\n" +
2231
+ "collection\x18\x01 \x01(\tR\n" +
2232
+ "collection\x12\x16\n" +
2233
+ "\x06tenant\x18\n" +
2234
+ " \x01(\tR\x06tenant\x12#\n" +
2235
+ "\robjects_count\x18\x14 \x01(\bR\fobjectsCount\x12M\n" +
2236
+ "\faggregations\x18\x15 \x03(\v2).weaviate.v1.AggregateRequest.AggregationR\faggregations\x12&\n" +
2237
+ "\fobject_limit\x18\x1e \x01(\rH\x01R\vobjectLimit\x88\x01\x01\x12E\n" +
2238
+ "\bgroup_by\x18\x1f \x01(\v2%.weaviate.v1.AggregateRequest.GroupByH\x02R\agroupBy\x88\x01\x01\x12\x19\n" +
2239
+ "\x05limit\x18 \x01(\rH\x03R\x05limit\x88\x01\x01\x123\n" +
2240
+ "\afilters\x18( \x01(\v2\x14.weaviate.v1.FiltersH\x04R\afilters\x88\x01\x01\x12-\n" +
2241
+ "\x06hybrid\x18) \x01(\v2\x13.weaviate.v1.HybridH\x00R\x06hybrid\x12:\n" +
2242
+ "\vnear_vector\x18* \x01(\v2\x17.weaviate.v1.NearVectorH\x00R\n" +
2243
+ "nearVector\x12:\n" +
2244
+ "\vnear_object\x18+ \x01(\v2\x17.weaviate.v1.NearObjectH\x00R\n" +
2245
+ "nearObject\x12:\n" +
2246
+ "\tnear_text\x18, \x01(\v2\x1b.weaviate.v1.NearTextSearchH\x00R\bnearText\x12=\n" +
2247
+ "\n" +
2248
+ "near_image\x18- \x01(\v2\x1c.weaviate.v1.NearImageSearchH\x00R\tnearImage\x12=\n" +
2249
+ "\n" +
2250
+ "near_audio\x18. \x01(\v2\x1c.weaviate.v1.NearAudioSearchH\x00R\tnearAudio\x12=\n" +
2251
+ "\n" +
2252
+ "near_video\x18/ \x01(\v2\x1c.weaviate.v1.NearVideoSearchH\x00R\tnearVideo\x12=\n" +
2253
+ "\n" +
2254
+ "near_depth\x180 \x01(\v2\x1c.weaviate.v1.NearDepthSearchH\x00R\tnearDepth\x12C\n" +
2255
+ "\fnear_thermal\x181 \x01(\v2\x1e.weaviate.v1.NearThermalSearchH\x00R\vnearThermal\x127\n" +
2256
+ "\bnear_imu\x182 \x01(\v2\x1a.weaviate.v1.NearIMUSearchH\x00R\anearImu\x1a\xbb\v\n" +
2257
+ "\vAggregation\x12\x1a\n" +
2258
+ "\bproperty\x18\x01 \x01(\tR\bproperty\x12E\n" +
2259
+ "\x03int\x18\x02 \x01(\v21.weaviate.v1.AggregateRequest.Aggregation.IntegerH\x00R\x03int\x12J\n" +
2260
+ "\x06number\x18\x03 \x01(\v20.weaviate.v1.AggregateRequest.Aggregation.NumberH\x00R\x06number\x12D\n" +
2261
+ "\x04text\x18\x04 \x01(\v2..weaviate.v1.AggregateRequest.Aggregation.TextH\x00R\x04text\x12M\n" +
2262
+ "\aboolean\x18\x05 \x01(\v21.weaviate.v1.AggregateRequest.Aggregation.BooleanH\x00R\aboolean\x12D\n" +
2263
+ "\x04date\x18\x06 \x01(\v2..weaviate.v1.AggregateRequest.Aggregation.DateH\x00R\x04date\x12S\n" +
2264
+ "\treference\x18\a \x01(\v23.weaviate.v1.AggregateRequest.Aggregation.ReferenceH\x00R\treference\x1a\xb9\x01\n" +
2265
+ "\aInteger\x12\x14\n" +
2266
+ "\x05count\x18\x01 \x01(\bR\x05count\x12\x12\n" +
2267
+ "\x04type\x18\x02 \x01(\bR\x04type\x12\x10\n" +
2268
+ "\x03sum\x18\x03 \x01(\bR\x03sum\x12\x12\n" +
2269
+ "\x04mean\x18\x04 \x01(\bR\x04mean\x12\x12\n" +
2270
+ "\x04mode\x18\x05 \x01(\bR\x04mode\x12\x16\n" +
2271
+ "\x06median\x18\x06 \x01(\bR\x06median\x12\x18\n" +
2272
+ "\amaximum\x18\a \x01(\bR\amaximum\x12\x18\n" +
2273
+ "\aminimum\x18\b \x01(\bR\aminimum\x1a\xb8\x01\n" +
2274
+ "\x06Number\x12\x14\n" +
2275
+ "\x05count\x18\x01 \x01(\bR\x05count\x12\x12\n" +
2276
+ "\x04type\x18\x02 \x01(\bR\x04type\x12\x10\n" +
2277
+ "\x03sum\x18\x03 \x01(\bR\x03sum\x12\x12\n" +
2278
+ "\x04mean\x18\x04 \x01(\bR\x04mean\x12\x12\n" +
2279
+ "\x04mode\x18\x05 \x01(\bR\x04mode\x12\x16\n" +
2280
+ "\x06median\x18\x06 \x01(\bR\x06median\x12\x18\n" +
2281
+ "\amaximum\x18\a \x01(\bR\amaximum\x12\x18\n" +
2282
+ "\aminimum\x18\b \x01(\bR\aminimum\x1a\xa7\x01\n" +
2283
+ "\x04Text\x12\x14\n" +
2284
+ "\x05count\x18\x01 \x01(\bR\x05count\x12\x12\n" +
2285
+ "\x04type\x18\x02 \x01(\bR\x04type\x12%\n" +
2286
+ "\x0etop_occurences\x18\x03 \x01(\bR\rtopOccurences\x125\n" +
2287
+ "\x14top_occurences_limit\x18\x04 \x01(\rH\x00R\x12topOccurencesLimit\x88\x01\x01B\x17\n" +
2288
+ "\x15_top_occurences_limit\x1a\xc7\x01\n" +
2289
+ "\aBoolean\x12\x14\n" +
2290
+ "\x05count\x18\x01 \x01(\bR\x05count\x12\x12\n" +
2291
+ "\x04type\x18\x02 \x01(\bR\x04type\x12\x1d\n" +
2292
+ "\n" +
2293
+ "total_true\x18\x03 \x01(\bR\ttotalTrue\x12\x1f\n" +
2294
+ "\vtotal_false\x18\x04 \x01(\bR\n" +
2295
+ "totalFalse\x12'\n" +
2296
+ "\x0fpercentage_true\x18\x05 \x01(\bR\x0epercentageTrue\x12)\n" +
2297
+ "\x10percentage_false\x18\x06 \x01(\bR\x0fpercentageFalse\x1a\x90\x01\n" +
2298
+ "\x04Date\x12\x14\n" +
2299
+ "\x05count\x18\x01 \x01(\bR\x05count\x12\x12\n" +
2300
+ "\x04type\x18\x02 \x01(\bR\x04type\x12\x16\n" +
2301
+ "\x06median\x18\x03 \x01(\bR\x06median\x12\x12\n" +
2302
+ "\x04mode\x18\x04 \x01(\bR\x04mode\x12\x18\n" +
2303
+ "\amaximum\x18\x05 \x01(\bR\amaximum\x12\x18\n" +
2304
+ "\aminimum\x18\x06 \x01(\bR\aminimum\x1a@\n" +
2305
+ "\tReference\x12\x12\n" +
2306
+ "\x04type\x18\x01 \x01(\bR\x04type\x12\x1f\n" +
2307
+ "\vpointing_to\x18\x02 \x01(\bR\n" +
2308
+ "pointingToB\r\n" +
2309
+ "\vaggregation\x1aE\n" +
2310
+ "\aGroupBy\x12\x1e\n" +
2311
+ "\n" +
2312
+ "collection\x18\x01 \x01(\tR\n" +
2313
+ "collection\x12\x1a\n" +
2314
+ "\bproperty\x18\x02 \x01(\tR\bpropertyB\b\n" +
2315
+ "\x06searchB\x0f\n" +
2316
+ "\r_object_limitB\v\n" +
2317
+ "\t_group_byB\b\n" +
2318
+ "\x06_limitB\n" +
2319
+ "\n" +
2320
+ "\b_filters\"\x80\x1b\n" +
2321
+ "\x0eAggregateReply\x12\x12\n" +
2322
+ "\x04took\x18\x01 \x01(\x02R\x04took\x12I\n" +
2323
+ "\rsingle_result\x18\x02 \x01(\v2\".weaviate.v1.AggregateReply.SingleH\x00R\fsingleResult\x12N\n" +
2324
+ "\x0fgrouped_results\x18\x03 \x01(\v2#.weaviate.v1.AggregateReply.GroupedH\x00R\x0egroupedResults\x1a\xab\x12\n" +
2325
+ "\fAggregations\x12X\n" +
2326
+ "\faggregations\x18\x01 \x03(\v24.weaviate.v1.AggregateReply.Aggregations.AggregationR\faggregations\x1a\xc0\x11\n" +
2327
+ "\vAggregation\x12\x1a\n" +
2328
+ "\bproperty\x18\x01 \x01(\tR\bproperty\x12P\n" +
2329
+ "\x03int\x18\x02 \x01(\v2<.weaviate.v1.AggregateReply.Aggregations.Aggregation.IntegerH\x00R\x03int\x12U\n" +
2330
+ "\x06number\x18\x03 \x01(\v2;.weaviate.v1.AggregateReply.Aggregations.Aggregation.NumberH\x00R\x06number\x12O\n" +
2331
+ "\x04text\x18\x04 \x01(\v29.weaviate.v1.AggregateReply.Aggregations.Aggregation.TextH\x00R\x04text\x12X\n" +
2332
+ "\aboolean\x18\x05 \x01(\v2<.weaviate.v1.AggregateReply.Aggregations.Aggregation.BooleanH\x00R\aboolean\x12O\n" +
2333
+ "\x04date\x18\x06 \x01(\v29.weaviate.v1.AggregateReply.Aggregations.Aggregation.DateH\x00R\x04date\x12^\n" +
2334
+ "\treference\x18\a \x01(\v2>.weaviate.v1.AggregateReply.Aggregations.Aggregation.ReferenceH\x00R\treference\x1a\xb1\x02\n" +
2335
+ "\aInteger\x12\x19\n" +
2336
+ "\x05count\x18\x01 \x01(\x03H\x00R\x05count\x88\x01\x01\x12\x17\n" +
2337
+ "\x04type\x18\x02 \x01(\tH\x01R\x04type\x88\x01\x01\x12\x17\n" +
2338
+ "\x04mean\x18\x03 \x01(\x01H\x02R\x04mean\x88\x01\x01\x12\x1b\n" +
2339
+ "\x06median\x18\x04 \x01(\x01H\x03R\x06median\x88\x01\x01\x12\x17\n" +
2340
+ "\x04mode\x18\x05 \x01(\x03H\x04R\x04mode\x88\x01\x01\x12\x1d\n" +
2341
+ "\amaximum\x18\x06 \x01(\x03H\x05R\amaximum\x88\x01\x01\x12\x1d\n" +
2342
+ "\aminimum\x18\a \x01(\x03H\x06R\aminimum\x88\x01\x01\x12\x15\n" +
2343
+ "\x03sum\x18\b \x01(\x03H\aR\x03sum\x88\x01\x01B\b\n" +
2344
+ "\x06_countB\a\n" +
2345
+ "\x05_typeB\a\n" +
2346
+ "\x05_meanB\t\n" +
2347
+ "\a_medianB\a\n" +
2348
+ "\x05_modeB\n" +
2349
+ "\n" +
2350
+ "\b_maximumB\n" +
2351
+ "\n" +
2352
+ "\b_minimumB\x06\n" +
2353
+ "\x04_sum\x1a\xb0\x02\n" +
2354
+ "\x06Number\x12\x19\n" +
2355
+ "\x05count\x18\x01 \x01(\x03H\x00R\x05count\x88\x01\x01\x12\x17\n" +
2356
+ "\x04type\x18\x02 \x01(\tH\x01R\x04type\x88\x01\x01\x12\x17\n" +
2357
+ "\x04mean\x18\x03 \x01(\x01H\x02R\x04mean\x88\x01\x01\x12\x1b\n" +
2358
+ "\x06median\x18\x04 \x01(\x01H\x03R\x06median\x88\x01\x01\x12\x17\n" +
2359
+ "\x04mode\x18\x05 \x01(\x01H\x04R\x04mode\x88\x01\x01\x12\x1d\n" +
2360
+ "\amaximum\x18\x06 \x01(\x01H\x05R\amaximum\x88\x01\x01\x12\x1d\n" +
2361
+ "\aminimum\x18\a \x01(\x01H\x06R\aminimum\x88\x01\x01\x12\x15\n" +
2362
+ "\x03sum\x18\b \x01(\x01H\aR\x03sum\x88\x01\x01B\b\n" +
2363
+ "\x06_countB\a\n" +
2364
+ "\x05_typeB\a\n" +
2365
+ "\x05_meanB\t\n" +
2366
+ "\a_medianB\a\n" +
2367
+ "\x05_modeB\n" +
2368
+ "\n" +
2369
+ "\b_maximumB\n" +
2370
+ "\n" +
2371
+ "\b_minimumB\x06\n" +
2372
+ "\x04_sum\x1a\x96\x03\n" +
2373
+ "\x04Text\x12\x19\n" +
2374
+ "\x05count\x18\x01 \x01(\x03H\x00R\x05count\x88\x01\x01\x12\x17\n" +
2375
+ "\x04type\x18\x02 \x01(\tH\x01R\x04type\x88\x01\x01\x12t\n" +
2376
+ "\x0etop_occurences\x18\x03 \x01(\v2H.weaviate.v1.AggregateReply.Aggregations.Aggregation.Text.TopOccurrencesH\x02R\rtopOccurences\x88\x01\x01\x1a\xbd\x01\n" +
2377
+ "\x0eTopOccurrences\x12l\n" +
2378
+ "\x05items\x18\x01 \x03(\v2V.weaviate.v1.AggregateReply.Aggregations.Aggregation.Text.TopOccurrences.TopOccurrenceR\x05items\x1a=\n" +
2379
+ "\rTopOccurrence\x12\x14\n" +
2380
+ "\x05value\x18\x01 \x01(\tR\x05value\x12\x16\n" +
2381
+ "\x06occurs\x18\x02 \x01(\x03R\x06occursB\b\n" +
2382
+ "\x06_countB\a\n" +
2383
+ "\x05_typeB\x11\n" +
2384
+ "\x0f_top_occurences\x1a\xc0\x02\n" +
2385
+ "\aBoolean\x12\x19\n" +
2386
+ "\x05count\x18\x01 \x01(\x03H\x00R\x05count\x88\x01\x01\x12\x17\n" +
2387
+ "\x04type\x18\x02 \x01(\tH\x01R\x04type\x88\x01\x01\x12\"\n" +
2388
+ "\n" +
2389
+ "total_true\x18\x03 \x01(\x03H\x02R\ttotalTrue\x88\x01\x01\x12$\n" +
2390
+ "\vtotal_false\x18\x04 \x01(\x03H\x03R\n" +
2391
+ "totalFalse\x88\x01\x01\x12,\n" +
2392
+ "\x0fpercentage_true\x18\x05 \x01(\x01H\x04R\x0epercentageTrue\x88\x01\x01\x12.\n" +
2393
+ "\x10percentage_false\x18\x06 \x01(\x01H\x05R\x0fpercentageFalse\x88\x01\x01B\b\n" +
2394
+ "\x06_countB\a\n" +
2395
+ "\x05_typeB\r\n" +
2396
+ "\v_total_trueB\x0e\n" +
2397
+ "\f_total_falseB\x12\n" +
2398
+ "\x10_percentage_trueB\x13\n" +
2399
+ "\x11_percentage_false\x1a\xed\x01\n" +
2400
+ "\x04Date\x12\x19\n" +
2401
+ "\x05count\x18\x01 \x01(\x03H\x00R\x05count\x88\x01\x01\x12\x17\n" +
2402
+ "\x04type\x18\x02 \x01(\tH\x01R\x04type\x88\x01\x01\x12\x1b\n" +
2403
+ "\x06median\x18\x03 \x01(\tH\x02R\x06median\x88\x01\x01\x12\x17\n" +
2404
+ "\x04mode\x18\x04 \x01(\tH\x03R\x04mode\x88\x01\x01\x12\x1d\n" +
2405
+ "\amaximum\x18\x05 \x01(\tH\x04R\amaximum\x88\x01\x01\x12\x1d\n" +
2406
+ "\aminimum\x18\x06 \x01(\tH\x05R\aminimum\x88\x01\x01B\b\n" +
2407
+ "\x06_countB\a\n" +
2408
+ "\x05_typeB\t\n" +
2409
+ "\a_medianB\a\n" +
2410
+ "\x05_modeB\n" +
2411
+ "\n" +
2412
+ "\b_maximumB\n" +
2413
+ "\n" +
2414
+ "\b_minimum\x1aN\n" +
2415
+ "\tReference\x12\x17\n" +
2416
+ "\x04type\x18\x01 \x01(\tH\x00R\x04type\x88\x01\x01\x12\x1f\n" +
2417
+ "\vpointing_to\x18\x02 \x03(\tR\n" +
2418
+ "pointingToB\a\n" +
2419
+ "\x05_typeB\r\n" +
2420
+ "\vaggregation\x1a\xa8\x01\n" +
2421
+ "\x06Single\x12(\n" +
2422
+ "\robjects_count\x18\x01 \x01(\x03H\x00R\fobjectsCount\x88\x01\x01\x12Q\n" +
2423
+ "\faggregations\x18\x02 \x01(\v2(.weaviate.v1.AggregateReply.AggregationsH\x01R\faggregations\x88\x01\x01B\x10\n" +
2424
+ "\x0e_objects_countB\x0f\n" +
2425
+ "\r_aggregations\x1a\x95\x05\n" +
2426
+ "\x05Group\x12(\n" +
2427
+ "\robjects_count\x18\x01 \x01(\x03H\x00R\fobjectsCount\x88\x01\x01\x12Q\n" +
2428
+ "\faggregations\x18\x02 \x01(\v2(.weaviate.v1.AggregateReply.AggregationsH\x01R\faggregations\x88\x01\x01\x12O\n" +
2429
+ "\n" +
2430
+ "grouped_by\x18\x03 \x01(\v2+.weaviate.v1.AggregateReply.Group.GroupedByH\x02R\tgroupedBy\x88\x01\x01\x1a\x8b\x03\n" +
2431
+ "\tGroupedBy\x12\x12\n" +
2432
+ "\x04path\x18\x01 \x03(\tR\x04path\x12\x14\n" +
2433
+ "\x04text\x18\x02 \x01(\tH\x00R\x04text\x12\x12\n" +
2434
+ "\x03int\x18\x03 \x01(\x03H\x00R\x03int\x12\x1a\n" +
2435
+ "\aboolean\x18\x04 \x01(\bH\x00R\aboolean\x12\x18\n" +
2436
+ "\x06number\x18\x05 \x01(\x01H\x00R\x06number\x12.\n" +
2437
+ "\x05texts\x18\x06 \x01(\v2\x16.weaviate.v1.TextArrayH\x00R\x05texts\x12+\n" +
2438
+ "\x04ints\x18\a \x01(\v2\x15.weaviate.v1.IntArrayH\x00R\x04ints\x127\n" +
2439
+ "\bbooleans\x18\b \x01(\v2\x19.weaviate.v1.BooleanArrayH\x00R\bbooleans\x124\n" +
2440
+ "\anumbers\x18\t \x01(\v2\x18.weaviate.v1.NumberArrayH\x00R\anumbers\x125\n" +
2441
+ "\x03geo\x18\n" +
2442
+ " \x01(\v2!.weaviate.v1.GeoCoordinatesFilterH\x00R\x03geoB\a\n" +
2443
+ "\x05valueB\x10\n" +
2444
+ "\x0e_objects_countB\x0f\n" +
2445
+ "\r_aggregationsB\r\n" +
2446
+ "\v_grouped_by\x1aD\n" +
2447
+ "\aGrouped\x129\n" +
2448
+ "\x06groups\x18\x01 \x03(\v2!.weaviate.v1.AggregateReply.GroupR\x06groupsB\b\n" +
2449
+ "\x06resultBs\n" +
2450
+ "#io.weaviate.client.grpc.protocol.v1B\x16WeaviateProtoAggregateZ4github.com/weaviate/weaviate/grpc/generated;protocolb\x06proto3"
2451
+
2452
+ var (
2453
+ file_v1_aggregate_proto_rawDescOnce sync.Once
2454
+ file_v1_aggregate_proto_rawDescData []byte
2455
+ )
2456
+
2457
+ func file_v1_aggregate_proto_rawDescGZIP() []byte {
2458
+ file_v1_aggregate_proto_rawDescOnce.Do(func() {
2459
+ file_v1_aggregate_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_v1_aggregate_proto_rawDesc), len(file_v1_aggregate_proto_rawDesc)))
2460
+ })
2461
+ return file_v1_aggregate_proto_rawDescData
2462
+ }
2463
+
2464
+ var file_v1_aggregate_proto_msgTypes = make([]protoimpl.MessageInfo, 24)
2465
+ var file_v1_aggregate_proto_goTypes = []any{
2466
+ (*AggregateRequest)(nil), // 0: weaviate.v1.AggregateRequest
2467
+ (*AggregateReply)(nil), // 1: weaviate.v1.AggregateReply
2468
+ (*AggregateRequest_Aggregation)(nil), // 2: weaviate.v1.AggregateRequest.Aggregation
2469
+ (*AggregateRequest_GroupBy)(nil), // 3: weaviate.v1.AggregateRequest.GroupBy
2470
+ (*AggregateRequest_Aggregation_Integer)(nil), // 4: weaviate.v1.AggregateRequest.Aggregation.Integer
2471
+ (*AggregateRequest_Aggregation_Number)(nil), // 5: weaviate.v1.AggregateRequest.Aggregation.Number
2472
+ (*AggregateRequest_Aggregation_Text)(nil), // 6: weaviate.v1.AggregateRequest.Aggregation.Text
2473
+ (*AggregateRequest_Aggregation_Boolean)(nil), // 7: weaviate.v1.AggregateRequest.Aggregation.Boolean
2474
+ (*AggregateRequest_Aggregation_Date)(nil), // 8: weaviate.v1.AggregateRequest.Aggregation.Date
2475
+ (*AggregateRequest_Aggregation_Reference)(nil), // 9: weaviate.v1.AggregateRequest.Aggregation.Reference
2476
+ (*AggregateReply_Aggregations)(nil), // 10: weaviate.v1.AggregateReply.Aggregations
2477
+ (*AggregateReply_Single)(nil), // 11: weaviate.v1.AggregateReply.Single
2478
+ (*AggregateReply_Group)(nil), // 12: weaviate.v1.AggregateReply.Group
2479
+ (*AggregateReply_Grouped)(nil), // 13: weaviate.v1.AggregateReply.Grouped
2480
+ (*AggregateReply_Aggregations_Aggregation)(nil), // 14: weaviate.v1.AggregateReply.Aggregations.Aggregation
2481
+ (*AggregateReply_Aggregations_Aggregation_Integer)(nil), // 15: weaviate.v1.AggregateReply.Aggregations.Aggregation.Integer
2482
+ (*AggregateReply_Aggregations_Aggregation_Number)(nil), // 16: weaviate.v1.AggregateReply.Aggregations.Aggregation.Number
2483
+ (*AggregateReply_Aggregations_Aggregation_Text)(nil), // 17: weaviate.v1.AggregateReply.Aggregations.Aggregation.Text
2484
+ (*AggregateReply_Aggregations_Aggregation_Boolean)(nil), // 18: weaviate.v1.AggregateReply.Aggregations.Aggregation.Boolean
2485
+ (*AggregateReply_Aggregations_Aggregation_Date)(nil), // 19: weaviate.v1.AggregateReply.Aggregations.Aggregation.Date
2486
+ (*AggregateReply_Aggregations_Aggregation_Reference)(nil), // 20: weaviate.v1.AggregateReply.Aggregations.Aggregation.Reference
2487
+ (*AggregateReply_Aggregations_Aggregation_Text_TopOccurrences)(nil), // 21: weaviate.v1.AggregateReply.Aggregations.Aggregation.Text.TopOccurrences
2488
+ (*AggregateReply_Aggregations_Aggregation_Text_TopOccurrences_TopOccurrence)(nil), // 22: weaviate.v1.AggregateReply.Aggregations.Aggregation.Text.TopOccurrences.TopOccurrence
2489
+ (*AggregateReply_Group_GroupedBy)(nil), // 23: weaviate.v1.AggregateReply.Group.GroupedBy
2490
+ (*Filters)(nil), // 24: weaviate.v1.Filters
2491
+ (*Hybrid)(nil), // 25: weaviate.v1.Hybrid
2492
+ (*NearVector)(nil), // 26: weaviate.v1.NearVector
2493
+ (*NearObject)(nil), // 27: weaviate.v1.NearObject
2494
+ (*NearTextSearch)(nil), // 28: weaviate.v1.NearTextSearch
2495
+ (*NearImageSearch)(nil), // 29: weaviate.v1.NearImageSearch
2496
+ (*NearAudioSearch)(nil), // 30: weaviate.v1.NearAudioSearch
2497
+ (*NearVideoSearch)(nil), // 31: weaviate.v1.NearVideoSearch
2498
+ (*NearDepthSearch)(nil), // 32: weaviate.v1.NearDepthSearch
2499
+ (*NearThermalSearch)(nil), // 33: weaviate.v1.NearThermalSearch
2500
+ (*NearIMUSearch)(nil), // 34: weaviate.v1.NearIMUSearch
2501
+ (*TextArray)(nil), // 35: weaviate.v1.TextArray
2502
+ (*IntArray)(nil), // 36: weaviate.v1.IntArray
2503
+ (*BooleanArray)(nil), // 37: weaviate.v1.BooleanArray
2504
+ (*NumberArray)(nil), // 38: weaviate.v1.NumberArray
2505
+ (*GeoCoordinatesFilter)(nil), // 39: weaviate.v1.GeoCoordinatesFilter
2506
+ }
2507
+ var file_v1_aggregate_proto_depIdxs = []int32{
2508
+ 2, // 0: weaviate.v1.AggregateRequest.aggregations:type_name -> weaviate.v1.AggregateRequest.Aggregation
2509
+ 3, // 1: weaviate.v1.AggregateRequest.group_by:type_name -> weaviate.v1.AggregateRequest.GroupBy
2510
+ 24, // 2: weaviate.v1.AggregateRequest.filters:type_name -> weaviate.v1.Filters
2511
+ 25, // 3: weaviate.v1.AggregateRequest.hybrid:type_name -> weaviate.v1.Hybrid
2512
+ 26, // 4: weaviate.v1.AggregateRequest.near_vector:type_name -> weaviate.v1.NearVector
2513
+ 27, // 5: weaviate.v1.AggregateRequest.near_object:type_name -> weaviate.v1.NearObject
2514
+ 28, // 6: weaviate.v1.AggregateRequest.near_text:type_name -> weaviate.v1.NearTextSearch
2515
+ 29, // 7: weaviate.v1.AggregateRequest.near_image:type_name -> weaviate.v1.NearImageSearch
2516
+ 30, // 8: weaviate.v1.AggregateRequest.near_audio:type_name -> weaviate.v1.NearAudioSearch
2517
+ 31, // 9: weaviate.v1.AggregateRequest.near_video:type_name -> weaviate.v1.NearVideoSearch
2518
+ 32, // 10: weaviate.v1.AggregateRequest.near_depth:type_name -> weaviate.v1.NearDepthSearch
2519
+ 33, // 11: weaviate.v1.AggregateRequest.near_thermal:type_name -> weaviate.v1.NearThermalSearch
2520
+ 34, // 12: weaviate.v1.AggregateRequest.near_imu:type_name -> weaviate.v1.NearIMUSearch
2521
+ 11, // 13: weaviate.v1.AggregateReply.single_result:type_name -> weaviate.v1.AggregateReply.Single
2522
+ 13, // 14: weaviate.v1.AggregateReply.grouped_results:type_name -> weaviate.v1.AggregateReply.Grouped
2523
+ 4, // 15: weaviate.v1.AggregateRequest.Aggregation.int:type_name -> weaviate.v1.AggregateRequest.Aggregation.Integer
2524
+ 5, // 16: weaviate.v1.AggregateRequest.Aggregation.number:type_name -> weaviate.v1.AggregateRequest.Aggregation.Number
2525
+ 6, // 17: weaviate.v1.AggregateRequest.Aggregation.text:type_name -> weaviate.v1.AggregateRequest.Aggregation.Text
2526
+ 7, // 18: weaviate.v1.AggregateRequest.Aggregation.boolean:type_name -> weaviate.v1.AggregateRequest.Aggregation.Boolean
2527
+ 8, // 19: weaviate.v1.AggregateRequest.Aggregation.date:type_name -> weaviate.v1.AggregateRequest.Aggregation.Date
2528
+ 9, // 20: weaviate.v1.AggregateRequest.Aggregation.reference:type_name -> weaviate.v1.AggregateRequest.Aggregation.Reference
2529
+ 14, // 21: weaviate.v1.AggregateReply.Aggregations.aggregations:type_name -> weaviate.v1.AggregateReply.Aggregations.Aggregation
2530
+ 10, // 22: weaviate.v1.AggregateReply.Single.aggregations:type_name -> weaviate.v1.AggregateReply.Aggregations
2531
+ 10, // 23: weaviate.v1.AggregateReply.Group.aggregations:type_name -> weaviate.v1.AggregateReply.Aggregations
2532
+ 23, // 24: weaviate.v1.AggregateReply.Group.grouped_by:type_name -> weaviate.v1.AggregateReply.Group.GroupedBy
2533
+ 12, // 25: weaviate.v1.AggregateReply.Grouped.groups:type_name -> weaviate.v1.AggregateReply.Group
2534
+ 15, // 26: weaviate.v1.AggregateReply.Aggregations.Aggregation.int:type_name -> weaviate.v1.AggregateReply.Aggregations.Aggregation.Integer
2535
+ 16, // 27: weaviate.v1.AggregateReply.Aggregations.Aggregation.number:type_name -> weaviate.v1.AggregateReply.Aggregations.Aggregation.Number
2536
+ 17, // 28: weaviate.v1.AggregateReply.Aggregations.Aggregation.text:type_name -> weaviate.v1.AggregateReply.Aggregations.Aggregation.Text
2537
+ 18, // 29: weaviate.v1.AggregateReply.Aggregations.Aggregation.boolean:type_name -> weaviate.v1.AggregateReply.Aggregations.Aggregation.Boolean
2538
+ 19, // 30: weaviate.v1.AggregateReply.Aggregations.Aggregation.date:type_name -> weaviate.v1.AggregateReply.Aggregations.Aggregation.Date
2539
+ 20, // 31: weaviate.v1.AggregateReply.Aggregations.Aggregation.reference:type_name -> weaviate.v1.AggregateReply.Aggregations.Aggregation.Reference
2540
+ 21, // 32: weaviate.v1.AggregateReply.Aggregations.Aggregation.Text.top_occurences:type_name -> weaviate.v1.AggregateReply.Aggregations.Aggregation.Text.TopOccurrences
2541
+ 22, // 33: weaviate.v1.AggregateReply.Aggregations.Aggregation.Text.TopOccurrences.items:type_name -> weaviate.v1.AggregateReply.Aggregations.Aggregation.Text.TopOccurrences.TopOccurrence
2542
+ 35, // 34: weaviate.v1.AggregateReply.Group.GroupedBy.texts:type_name -> weaviate.v1.TextArray
2543
+ 36, // 35: weaviate.v1.AggregateReply.Group.GroupedBy.ints:type_name -> weaviate.v1.IntArray
2544
+ 37, // 36: weaviate.v1.AggregateReply.Group.GroupedBy.booleans:type_name -> weaviate.v1.BooleanArray
2545
+ 38, // 37: weaviate.v1.AggregateReply.Group.GroupedBy.numbers:type_name -> weaviate.v1.NumberArray
2546
+ 39, // 38: weaviate.v1.AggregateReply.Group.GroupedBy.geo:type_name -> weaviate.v1.GeoCoordinatesFilter
2547
+ 39, // [39:39] is the sub-list for method output_type
2548
+ 39, // [39:39] is the sub-list for method input_type
2549
+ 39, // [39:39] is the sub-list for extension type_name
2550
+ 39, // [39:39] is the sub-list for extension extendee
2551
+ 0, // [0:39] is the sub-list for field type_name
2552
+ }
2553
+
2554
+ func init() { file_v1_aggregate_proto_init() }
2555
+ func file_v1_aggregate_proto_init() {
2556
+ if File_v1_aggregate_proto != nil {
2557
+ return
2558
+ }
2559
+ file_v1_base_proto_init()
2560
+ file_v1_base_search_proto_init()
2561
+ file_v1_aggregate_proto_msgTypes[0].OneofWrappers = []any{
2562
+ (*AggregateRequest_Hybrid)(nil),
2563
+ (*AggregateRequest_NearVector)(nil),
2564
+ (*AggregateRequest_NearObject)(nil),
2565
+ (*AggregateRequest_NearText)(nil),
2566
+ (*AggregateRequest_NearImage)(nil),
2567
+ (*AggregateRequest_NearAudio)(nil),
2568
+ (*AggregateRequest_NearVideo)(nil),
2569
+ (*AggregateRequest_NearDepth)(nil),
2570
+ (*AggregateRequest_NearThermal)(nil),
2571
+ (*AggregateRequest_NearImu)(nil),
2572
+ }
2573
+ file_v1_aggregate_proto_msgTypes[1].OneofWrappers = []any{
2574
+ (*AggregateReply_SingleResult)(nil),
2575
+ (*AggregateReply_GroupedResults)(nil),
2576
+ }
2577
+ file_v1_aggregate_proto_msgTypes[2].OneofWrappers = []any{
2578
+ (*AggregateRequest_Aggregation_Int)(nil),
2579
+ (*AggregateRequest_Aggregation_Number_)(nil),
2580
+ (*AggregateRequest_Aggregation_Text_)(nil),
2581
+ (*AggregateRequest_Aggregation_Boolean_)(nil),
2582
+ (*AggregateRequest_Aggregation_Date_)(nil),
2583
+ (*AggregateRequest_Aggregation_Reference_)(nil),
2584
+ }
2585
+ file_v1_aggregate_proto_msgTypes[6].OneofWrappers = []any{}
2586
+ file_v1_aggregate_proto_msgTypes[11].OneofWrappers = []any{}
2587
+ file_v1_aggregate_proto_msgTypes[12].OneofWrappers = []any{}
2588
+ file_v1_aggregate_proto_msgTypes[14].OneofWrappers = []any{
2589
+ (*AggregateReply_Aggregations_Aggregation_Int)(nil),
2590
+ (*AggregateReply_Aggregations_Aggregation_Number_)(nil),
2591
+ (*AggregateReply_Aggregations_Aggregation_Text_)(nil),
2592
+ (*AggregateReply_Aggregations_Aggregation_Boolean_)(nil),
2593
+ (*AggregateReply_Aggregations_Aggregation_Date_)(nil),
2594
+ (*AggregateReply_Aggregations_Aggregation_Reference_)(nil),
2595
+ }
2596
+ file_v1_aggregate_proto_msgTypes[15].OneofWrappers = []any{}
2597
+ file_v1_aggregate_proto_msgTypes[16].OneofWrappers = []any{}
2598
+ file_v1_aggregate_proto_msgTypes[17].OneofWrappers = []any{}
2599
+ file_v1_aggregate_proto_msgTypes[18].OneofWrappers = []any{}
2600
+ file_v1_aggregate_proto_msgTypes[19].OneofWrappers = []any{}
2601
+ file_v1_aggregate_proto_msgTypes[20].OneofWrappers = []any{}
2602
+ file_v1_aggregate_proto_msgTypes[23].OneofWrappers = []any{
2603
+ (*AggregateReply_Group_GroupedBy_Text)(nil),
2604
+ (*AggregateReply_Group_GroupedBy_Int)(nil),
2605
+ (*AggregateReply_Group_GroupedBy_Boolean)(nil),
2606
+ (*AggregateReply_Group_GroupedBy_Number)(nil),
2607
+ (*AggregateReply_Group_GroupedBy_Texts)(nil),
2608
+ (*AggregateReply_Group_GroupedBy_Ints)(nil),
2609
+ (*AggregateReply_Group_GroupedBy_Booleans)(nil),
2610
+ (*AggregateReply_Group_GroupedBy_Numbers)(nil),
2611
+ (*AggregateReply_Group_GroupedBy_Geo)(nil),
2612
+ }
2613
+ type x struct{}
2614
+ out := protoimpl.TypeBuilder{
2615
+ File: protoimpl.DescBuilder{
2616
+ GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
2617
+ RawDescriptor: unsafe.Slice(unsafe.StringData(file_v1_aggregate_proto_rawDesc), len(file_v1_aggregate_proto_rawDesc)),
2618
+ NumEnums: 0,
2619
+ NumMessages: 24,
2620
+ NumExtensions: 0,
2621
+ NumServices: 0,
2622
+ },
2623
+ GoTypes: file_v1_aggregate_proto_goTypes,
2624
+ DependencyIndexes: file_v1_aggregate_proto_depIdxs,
2625
+ MessageInfos: file_v1_aggregate_proto_msgTypes,
2626
+ }.Build()
2627
+ File_v1_aggregate_proto = out.File
2628
+ file_v1_aggregate_proto_goTypes = nil
2629
+ file_v1_aggregate_proto_depIdxs = nil
2630
+ }
platform/dbops/binaries/weaviate-src/grpc/generated/protocol/v1/base.pb.go ADDED
@@ -0,0 +1,1665 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Code generated by protoc-gen-go. DO NOT EDIT.
2
+
3
+ package protocol
4
+
5
+ import (
6
+ reflect "reflect"
7
+ sync "sync"
8
+ unsafe "unsafe"
9
+
10
+ protoreflect "google.golang.org/protobuf/reflect/protoreflect"
11
+ protoimpl "google.golang.org/protobuf/runtime/protoimpl"
12
+ structpb "google.golang.org/protobuf/types/known/structpb"
13
+ )
14
+
15
+ const (
16
+ // Verify that this generated code is sufficiently up-to-date.
17
+ _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
18
+ // Verify that runtime/protoimpl is sufficiently up-to-date.
19
+ _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
20
+ )
21
+
22
+ type ConsistencyLevel int32
23
+
24
+ const (
25
+ ConsistencyLevel_CONSISTENCY_LEVEL_UNSPECIFIED ConsistencyLevel = 0
26
+ ConsistencyLevel_CONSISTENCY_LEVEL_ONE ConsistencyLevel = 1
27
+ ConsistencyLevel_CONSISTENCY_LEVEL_QUORUM ConsistencyLevel = 2
28
+ ConsistencyLevel_CONSISTENCY_LEVEL_ALL ConsistencyLevel = 3
29
+ )
30
+
31
+ // Enum value maps for ConsistencyLevel.
32
+ var (
33
+ ConsistencyLevel_name = map[int32]string{
34
+ 0: "CONSISTENCY_LEVEL_UNSPECIFIED",
35
+ 1: "CONSISTENCY_LEVEL_ONE",
36
+ 2: "CONSISTENCY_LEVEL_QUORUM",
37
+ 3: "CONSISTENCY_LEVEL_ALL",
38
+ }
39
+ ConsistencyLevel_value = map[string]int32{
40
+ "CONSISTENCY_LEVEL_UNSPECIFIED": 0,
41
+ "CONSISTENCY_LEVEL_ONE": 1,
42
+ "CONSISTENCY_LEVEL_QUORUM": 2,
43
+ "CONSISTENCY_LEVEL_ALL": 3,
44
+ }
45
+ )
46
+
47
+ func (x ConsistencyLevel) Enum() *ConsistencyLevel {
48
+ p := new(ConsistencyLevel)
49
+ *p = x
50
+ return p
51
+ }
52
+
53
+ func (x ConsistencyLevel) String() string {
54
+ return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
55
+ }
56
+
57
+ func (ConsistencyLevel) Descriptor() protoreflect.EnumDescriptor {
58
+ return file_v1_base_proto_enumTypes[0].Descriptor()
59
+ }
60
+
61
+ func (ConsistencyLevel) Type() protoreflect.EnumType {
62
+ return &file_v1_base_proto_enumTypes[0]
63
+ }
64
+
65
+ func (x ConsistencyLevel) Number() protoreflect.EnumNumber {
66
+ return protoreflect.EnumNumber(x)
67
+ }
68
+
69
+ // Deprecated: Use ConsistencyLevel.Descriptor instead.
70
+ func (ConsistencyLevel) EnumDescriptor() ([]byte, []int) {
71
+ return file_v1_base_proto_rawDescGZIP(), []int{0}
72
+ }
73
+
74
+ type Filters_Operator int32
75
+
76
+ const (
77
+ Filters_OPERATOR_UNSPECIFIED Filters_Operator = 0
78
+ Filters_OPERATOR_EQUAL Filters_Operator = 1
79
+ Filters_OPERATOR_NOT_EQUAL Filters_Operator = 2
80
+ Filters_OPERATOR_GREATER_THAN Filters_Operator = 3
81
+ Filters_OPERATOR_GREATER_THAN_EQUAL Filters_Operator = 4
82
+ Filters_OPERATOR_LESS_THAN Filters_Operator = 5
83
+ Filters_OPERATOR_LESS_THAN_EQUAL Filters_Operator = 6
84
+ Filters_OPERATOR_AND Filters_Operator = 7
85
+ Filters_OPERATOR_OR Filters_Operator = 8
86
+ Filters_OPERATOR_WITHIN_GEO_RANGE Filters_Operator = 9
87
+ Filters_OPERATOR_LIKE Filters_Operator = 10
88
+ Filters_OPERATOR_IS_NULL Filters_Operator = 11
89
+ Filters_OPERATOR_CONTAINS_ANY Filters_Operator = 12
90
+ Filters_OPERATOR_CONTAINS_ALL Filters_Operator = 13
91
+ Filters_OPERATOR_CONTAINS_NONE Filters_Operator = 14
92
+ Filters_OPERATOR_NOT Filters_Operator = 15
93
+ )
94
+
95
+ // Enum value maps for Filters_Operator.
96
+ var (
97
+ Filters_Operator_name = map[int32]string{
98
+ 0: "OPERATOR_UNSPECIFIED",
99
+ 1: "OPERATOR_EQUAL",
100
+ 2: "OPERATOR_NOT_EQUAL",
101
+ 3: "OPERATOR_GREATER_THAN",
102
+ 4: "OPERATOR_GREATER_THAN_EQUAL",
103
+ 5: "OPERATOR_LESS_THAN",
104
+ 6: "OPERATOR_LESS_THAN_EQUAL",
105
+ 7: "OPERATOR_AND",
106
+ 8: "OPERATOR_OR",
107
+ 9: "OPERATOR_WITHIN_GEO_RANGE",
108
+ 10: "OPERATOR_LIKE",
109
+ 11: "OPERATOR_IS_NULL",
110
+ 12: "OPERATOR_CONTAINS_ANY",
111
+ 13: "OPERATOR_CONTAINS_ALL",
112
+ 14: "OPERATOR_CONTAINS_NONE",
113
+ 15: "OPERATOR_NOT",
114
+ }
115
+ Filters_Operator_value = map[string]int32{
116
+ "OPERATOR_UNSPECIFIED": 0,
117
+ "OPERATOR_EQUAL": 1,
118
+ "OPERATOR_NOT_EQUAL": 2,
119
+ "OPERATOR_GREATER_THAN": 3,
120
+ "OPERATOR_GREATER_THAN_EQUAL": 4,
121
+ "OPERATOR_LESS_THAN": 5,
122
+ "OPERATOR_LESS_THAN_EQUAL": 6,
123
+ "OPERATOR_AND": 7,
124
+ "OPERATOR_OR": 8,
125
+ "OPERATOR_WITHIN_GEO_RANGE": 9,
126
+ "OPERATOR_LIKE": 10,
127
+ "OPERATOR_IS_NULL": 11,
128
+ "OPERATOR_CONTAINS_ANY": 12,
129
+ "OPERATOR_CONTAINS_ALL": 13,
130
+ "OPERATOR_CONTAINS_NONE": 14,
131
+ "OPERATOR_NOT": 15,
132
+ }
133
+ )
134
+
135
+ func (x Filters_Operator) Enum() *Filters_Operator {
136
+ p := new(Filters_Operator)
137
+ *p = x
138
+ return p
139
+ }
140
+
141
+ func (x Filters_Operator) String() string {
142
+ return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
143
+ }
144
+
145
+ func (Filters_Operator) Descriptor() protoreflect.EnumDescriptor {
146
+ return file_v1_base_proto_enumTypes[1].Descriptor()
147
+ }
148
+
149
+ func (Filters_Operator) Type() protoreflect.EnumType {
150
+ return &file_v1_base_proto_enumTypes[1]
151
+ }
152
+
153
+ func (x Filters_Operator) Number() protoreflect.EnumNumber {
154
+ return protoreflect.EnumNumber(x)
155
+ }
156
+
157
+ // Deprecated: Use Filters_Operator.Descriptor instead.
158
+ func (Filters_Operator) EnumDescriptor() ([]byte, []int) {
159
+ return file_v1_base_proto_rawDescGZIP(), []int{11, 0}
160
+ }
161
+
162
+ type Vectors_VectorType int32
163
+
164
+ const (
165
+ Vectors_VECTOR_TYPE_UNSPECIFIED Vectors_VectorType = 0
166
+ Vectors_VECTOR_TYPE_SINGLE_FP32 Vectors_VectorType = 1
167
+ Vectors_VECTOR_TYPE_MULTI_FP32 Vectors_VectorType = 2
168
+ )
169
+
170
+ // Enum value maps for Vectors_VectorType.
171
+ var (
172
+ Vectors_VectorType_name = map[int32]string{
173
+ 0: "VECTOR_TYPE_UNSPECIFIED",
174
+ 1: "VECTOR_TYPE_SINGLE_FP32",
175
+ 2: "VECTOR_TYPE_MULTI_FP32",
176
+ }
177
+ Vectors_VectorType_value = map[string]int32{
178
+ "VECTOR_TYPE_UNSPECIFIED": 0,
179
+ "VECTOR_TYPE_SINGLE_FP32": 1,
180
+ "VECTOR_TYPE_MULTI_FP32": 2,
181
+ }
182
+ )
183
+
184
+ func (x Vectors_VectorType) Enum() *Vectors_VectorType {
185
+ p := new(Vectors_VectorType)
186
+ *p = x
187
+ return p
188
+ }
189
+
190
+ func (x Vectors_VectorType) String() string {
191
+ return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
192
+ }
193
+
194
+ func (Vectors_VectorType) Descriptor() protoreflect.EnumDescriptor {
195
+ return file_v1_base_proto_enumTypes[2].Descriptor()
196
+ }
197
+
198
+ func (Vectors_VectorType) Type() protoreflect.EnumType {
199
+ return &file_v1_base_proto_enumTypes[2]
200
+ }
201
+
202
+ func (x Vectors_VectorType) Number() protoreflect.EnumNumber {
203
+ return protoreflect.EnumNumber(x)
204
+ }
205
+
206
+ // Deprecated: Use Vectors_VectorType.Descriptor instead.
207
+ func (Vectors_VectorType) EnumDescriptor() ([]byte, []int) {
208
+ return file_v1_base_proto_rawDescGZIP(), []int{17, 0}
209
+ }
210
+
211
+ type NumberArrayProperties struct {
212
+ state protoimpl.MessageState `protogen:"open.v1"`
213
+ // will be removed in the future, use vector_bytes
214
+ // go client 5.4.1 depends on this field. Only remove after go client is deprecated
215
+ //
216
+ // Deprecated: Marked as deprecated in v1/base.proto.
217
+ Values []float64 `protobuf:"fixed64,1,rep,packed,name=values,proto3" json:"values,omitempty"`
218
+ PropName string `protobuf:"bytes,2,opt,name=prop_name,json=propName,proto3" json:"prop_name,omitempty"`
219
+ ValuesBytes []byte `protobuf:"bytes,3,opt,name=values_bytes,json=valuesBytes,proto3" json:"values_bytes,omitempty"`
220
+ unknownFields protoimpl.UnknownFields
221
+ sizeCache protoimpl.SizeCache
222
+ }
223
+
224
+ func (x *NumberArrayProperties) Reset() {
225
+ *x = NumberArrayProperties{}
226
+ mi := &file_v1_base_proto_msgTypes[0]
227
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
228
+ ms.StoreMessageInfo(mi)
229
+ }
230
+
231
+ func (x *NumberArrayProperties) String() string {
232
+ return protoimpl.X.MessageStringOf(x)
233
+ }
234
+
235
+ func (*NumberArrayProperties) ProtoMessage() {}
236
+
237
+ func (x *NumberArrayProperties) ProtoReflect() protoreflect.Message {
238
+ mi := &file_v1_base_proto_msgTypes[0]
239
+ if x != nil {
240
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
241
+ if ms.LoadMessageInfo() == nil {
242
+ ms.StoreMessageInfo(mi)
243
+ }
244
+ return ms
245
+ }
246
+ return mi.MessageOf(x)
247
+ }
248
+
249
+ // Deprecated: Use NumberArrayProperties.ProtoReflect.Descriptor instead.
250
+ func (*NumberArrayProperties) Descriptor() ([]byte, []int) {
251
+ return file_v1_base_proto_rawDescGZIP(), []int{0}
252
+ }
253
+
254
+ // Deprecated: Marked as deprecated in v1/base.proto.
255
+ func (x *NumberArrayProperties) GetValues() []float64 {
256
+ if x != nil {
257
+ return x.Values
258
+ }
259
+ return nil
260
+ }
261
+
262
+ func (x *NumberArrayProperties) GetPropName() string {
263
+ if x != nil {
264
+ return x.PropName
265
+ }
266
+ return ""
267
+ }
268
+
269
+ func (x *NumberArrayProperties) GetValuesBytes() []byte {
270
+ if x != nil {
271
+ return x.ValuesBytes
272
+ }
273
+ return nil
274
+ }
275
+
276
+ type IntArrayProperties struct {
277
+ state protoimpl.MessageState `protogen:"open.v1"`
278
+ Values []int64 `protobuf:"varint,1,rep,packed,name=values,proto3" json:"values,omitempty"`
279
+ PropName string `protobuf:"bytes,2,opt,name=prop_name,json=propName,proto3" json:"prop_name,omitempty"`
280
+ unknownFields protoimpl.UnknownFields
281
+ sizeCache protoimpl.SizeCache
282
+ }
283
+
284
+ func (x *IntArrayProperties) Reset() {
285
+ *x = IntArrayProperties{}
286
+ mi := &file_v1_base_proto_msgTypes[1]
287
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
288
+ ms.StoreMessageInfo(mi)
289
+ }
290
+
291
+ func (x *IntArrayProperties) String() string {
292
+ return protoimpl.X.MessageStringOf(x)
293
+ }
294
+
295
+ func (*IntArrayProperties) ProtoMessage() {}
296
+
297
+ func (x *IntArrayProperties) ProtoReflect() protoreflect.Message {
298
+ mi := &file_v1_base_proto_msgTypes[1]
299
+ if x != nil {
300
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
301
+ if ms.LoadMessageInfo() == nil {
302
+ ms.StoreMessageInfo(mi)
303
+ }
304
+ return ms
305
+ }
306
+ return mi.MessageOf(x)
307
+ }
308
+
309
+ // Deprecated: Use IntArrayProperties.ProtoReflect.Descriptor instead.
310
+ func (*IntArrayProperties) Descriptor() ([]byte, []int) {
311
+ return file_v1_base_proto_rawDescGZIP(), []int{1}
312
+ }
313
+
314
+ func (x *IntArrayProperties) GetValues() []int64 {
315
+ if x != nil {
316
+ return x.Values
317
+ }
318
+ return nil
319
+ }
320
+
321
+ func (x *IntArrayProperties) GetPropName() string {
322
+ if x != nil {
323
+ return x.PropName
324
+ }
325
+ return ""
326
+ }
327
+
328
+ type TextArrayProperties struct {
329
+ state protoimpl.MessageState `protogen:"open.v1"`
330
+ Values []string `protobuf:"bytes,1,rep,name=values,proto3" json:"values,omitempty"`
331
+ PropName string `protobuf:"bytes,2,opt,name=prop_name,json=propName,proto3" json:"prop_name,omitempty"`
332
+ unknownFields protoimpl.UnknownFields
333
+ sizeCache protoimpl.SizeCache
334
+ }
335
+
336
+ func (x *TextArrayProperties) Reset() {
337
+ *x = TextArrayProperties{}
338
+ mi := &file_v1_base_proto_msgTypes[2]
339
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
340
+ ms.StoreMessageInfo(mi)
341
+ }
342
+
343
+ func (x *TextArrayProperties) String() string {
344
+ return protoimpl.X.MessageStringOf(x)
345
+ }
346
+
347
+ func (*TextArrayProperties) ProtoMessage() {}
348
+
349
+ func (x *TextArrayProperties) ProtoReflect() protoreflect.Message {
350
+ mi := &file_v1_base_proto_msgTypes[2]
351
+ if x != nil {
352
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
353
+ if ms.LoadMessageInfo() == nil {
354
+ ms.StoreMessageInfo(mi)
355
+ }
356
+ return ms
357
+ }
358
+ return mi.MessageOf(x)
359
+ }
360
+
361
+ // Deprecated: Use TextArrayProperties.ProtoReflect.Descriptor instead.
362
+ func (*TextArrayProperties) Descriptor() ([]byte, []int) {
363
+ return file_v1_base_proto_rawDescGZIP(), []int{2}
364
+ }
365
+
366
+ func (x *TextArrayProperties) GetValues() []string {
367
+ if x != nil {
368
+ return x.Values
369
+ }
370
+ return nil
371
+ }
372
+
373
+ func (x *TextArrayProperties) GetPropName() string {
374
+ if x != nil {
375
+ return x.PropName
376
+ }
377
+ return ""
378
+ }
379
+
380
+ type BooleanArrayProperties struct {
381
+ state protoimpl.MessageState `protogen:"open.v1"`
382
+ Values []bool `protobuf:"varint,1,rep,packed,name=values,proto3" json:"values,omitempty"`
383
+ PropName string `protobuf:"bytes,2,opt,name=prop_name,json=propName,proto3" json:"prop_name,omitempty"`
384
+ unknownFields protoimpl.UnknownFields
385
+ sizeCache protoimpl.SizeCache
386
+ }
387
+
388
+ func (x *BooleanArrayProperties) Reset() {
389
+ *x = BooleanArrayProperties{}
390
+ mi := &file_v1_base_proto_msgTypes[3]
391
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
392
+ ms.StoreMessageInfo(mi)
393
+ }
394
+
395
+ func (x *BooleanArrayProperties) String() string {
396
+ return protoimpl.X.MessageStringOf(x)
397
+ }
398
+
399
+ func (*BooleanArrayProperties) ProtoMessage() {}
400
+
401
+ func (x *BooleanArrayProperties) ProtoReflect() protoreflect.Message {
402
+ mi := &file_v1_base_proto_msgTypes[3]
403
+ if x != nil {
404
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
405
+ if ms.LoadMessageInfo() == nil {
406
+ ms.StoreMessageInfo(mi)
407
+ }
408
+ return ms
409
+ }
410
+ return mi.MessageOf(x)
411
+ }
412
+
413
+ // Deprecated: Use BooleanArrayProperties.ProtoReflect.Descriptor instead.
414
+ func (*BooleanArrayProperties) Descriptor() ([]byte, []int) {
415
+ return file_v1_base_proto_rawDescGZIP(), []int{3}
416
+ }
417
+
418
+ func (x *BooleanArrayProperties) GetValues() []bool {
419
+ if x != nil {
420
+ return x.Values
421
+ }
422
+ return nil
423
+ }
424
+
425
+ func (x *BooleanArrayProperties) GetPropName() string {
426
+ if x != nil {
427
+ return x.PropName
428
+ }
429
+ return ""
430
+ }
431
+
432
+ type ObjectPropertiesValue struct {
433
+ state protoimpl.MessageState `protogen:"open.v1"`
434
+ NonRefProperties *structpb.Struct `protobuf:"bytes,1,opt,name=non_ref_properties,json=nonRefProperties,proto3" json:"non_ref_properties,omitempty"`
435
+ NumberArrayProperties []*NumberArrayProperties `protobuf:"bytes,2,rep,name=number_array_properties,json=numberArrayProperties,proto3" json:"number_array_properties,omitempty"`
436
+ IntArrayProperties []*IntArrayProperties `protobuf:"bytes,3,rep,name=int_array_properties,json=intArrayProperties,proto3" json:"int_array_properties,omitempty"`
437
+ TextArrayProperties []*TextArrayProperties `protobuf:"bytes,4,rep,name=text_array_properties,json=textArrayProperties,proto3" json:"text_array_properties,omitempty"`
438
+ BooleanArrayProperties []*BooleanArrayProperties `protobuf:"bytes,5,rep,name=boolean_array_properties,json=booleanArrayProperties,proto3" json:"boolean_array_properties,omitempty"`
439
+ ObjectProperties []*ObjectProperties `protobuf:"bytes,6,rep,name=object_properties,json=objectProperties,proto3" json:"object_properties,omitempty"`
440
+ ObjectArrayProperties []*ObjectArrayProperties `protobuf:"bytes,7,rep,name=object_array_properties,json=objectArrayProperties,proto3" json:"object_array_properties,omitempty"`
441
+ EmptyListProps []string `protobuf:"bytes,10,rep,name=empty_list_props,json=emptyListProps,proto3" json:"empty_list_props,omitempty"`
442
+ unknownFields protoimpl.UnknownFields
443
+ sizeCache protoimpl.SizeCache
444
+ }
445
+
446
+ func (x *ObjectPropertiesValue) Reset() {
447
+ *x = ObjectPropertiesValue{}
448
+ mi := &file_v1_base_proto_msgTypes[4]
449
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
450
+ ms.StoreMessageInfo(mi)
451
+ }
452
+
453
+ func (x *ObjectPropertiesValue) String() string {
454
+ return protoimpl.X.MessageStringOf(x)
455
+ }
456
+
457
+ func (*ObjectPropertiesValue) ProtoMessage() {}
458
+
459
+ func (x *ObjectPropertiesValue) ProtoReflect() protoreflect.Message {
460
+ mi := &file_v1_base_proto_msgTypes[4]
461
+ if x != nil {
462
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
463
+ if ms.LoadMessageInfo() == nil {
464
+ ms.StoreMessageInfo(mi)
465
+ }
466
+ return ms
467
+ }
468
+ return mi.MessageOf(x)
469
+ }
470
+
471
+ // Deprecated: Use ObjectPropertiesValue.ProtoReflect.Descriptor instead.
472
+ func (*ObjectPropertiesValue) Descriptor() ([]byte, []int) {
473
+ return file_v1_base_proto_rawDescGZIP(), []int{4}
474
+ }
475
+
476
+ func (x *ObjectPropertiesValue) GetNonRefProperties() *structpb.Struct {
477
+ if x != nil {
478
+ return x.NonRefProperties
479
+ }
480
+ return nil
481
+ }
482
+
483
+ func (x *ObjectPropertiesValue) GetNumberArrayProperties() []*NumberArrayProperties {
484
+ if x != nil {
485
+ return x.NumberArrayProperties
486
+ }
487
+ return nil
488
+ }
489
+
490
+ func (x *ObjectPropertiesValue) GetIntArrayProperties() []*IntArrayProperties {
491
+ if x != nil {
492
+ return x.IntArrayProperties
493
+ }
494
+ return nil
495
+ }
496
+
497
+ func (x *ObjectPropertiesValue) GetTextArrayProperties() []*TextArrayProperties {
498
+ if x != nil {
499
+ return x.TextArrayProperties
500
+ }
501
+ return nil
502
+ }
503
+
504
+ func (x *ObjectPropertiesValue) GetBooleanArrayProperties() []*BooleanArrayProperties {
505
+ if x != nil {
506
+ return x.BooleanArrayProperties
507
+ }
508
+ return nil
509
+ }
510
+
511
+ func (x *ObjectPropertiesValue) GetObjectProperties() []*ObjectProperties {
512
+ if x != nil {
513
+ return x.ObjectProperties
514
+ }
515
+ return nil
516
+ }
517
+
518
+ func (x *ObjectPropertiesValue) GetObjectArrayProperties() []*ObjectArrayProperties {
519
+ if x != nil {
520
+ return x.ObjectArrayProperties
521
+ }
522
+ return nil
523
+ }
524
+
525
+ func (x *ObjectPropertiesValue) GetEmptyListProps() []string {
526
+ if x != nil {
527
+ return x.EmptyListProps
528
+ }
529
+ return nil
530
+ }
531
+
532
+ type ObjectArrayProperties struct {
533
+ state protoimpl.MessageState `protogen:"open.v1"`
534
+ Values []*ObjectPropertiesValue `protobuf:"bytes,1,rep,name=values,proto3" json:"values,omitempty"`
535
+ PropName string `protobuf:"bytes,2,opt,name=prop_name,json=propName,proto3" json:"prop_name,omitempty"`
536
+ unknownFields protoimpl.UnknownFields
537
+ sizeCache protoimpl.SizeCache
538
+ }
539
+
540
+ func (x *ObjectArrayProperties) Reset() {
541
+ *x = ObjectArrayProperties{}
542
+ mi := &file_v1_base_proto_msgTypes[5]
543
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
544
+ ms.StoreMessageInfo(mi)
545
+ }
546
+
547
+ func (x *ObjectArrayProperties) String() string {
548
+ return protoimpl.X.MessageStringOf(x)
549
+ }
550
+
551
+ func (*ObjectArrayProperties) ProtoMessage() {}
552
+
553
+ func (x *ObjectArrayProperties) ProtoReflect() protoreflect.Message {
554
+ mi := &file_v1_base_proto_msgTypes[5]
555
+ if x != nil {
556
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
557
+ if ms.LoadMessageInfo() == nil {
558
+ ms.StoreMessageInfo(mi)
559
+ }
560
+ return ms
561
+ }
562
+ return mi.MessageOf(x)
563
+ }
564
+
565
+ // Deprecated: Use ObjectArrayProperties.ProtoReflect.Descriptor instead.
566
+ func (*ObjectArrayProperties) Descriptor() ([]byte, []int) {
567
+ return file_v1_base_proto_rawDescGZIP(), []int{5}
568
+ }
569
+
570
+ func (x *ObjectArrayProperties) GetValues() []*ObjectPropertiesValue {
571
+ if x != nil {
572
+ return x.Values
573
+ }
574
+ return nil
575
+ }
576
+
577
+ func (x *ObjectArrayProperties) GetPropName() string {
578
+ if x != nil {
579
+ return x.PropName
580
+ }
581
+ return ""
582
+ }
583
+
584
+ type ObjectProperties struct {
585
+ state protoimpl.MessageState `protogen:"open.v1"`
586
+ Value *ObjectPropertiesValue `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"`
587
+ PropName string `protobuf:"bytes,2,opt,name=prop_name,json=propName,proto3" json:"prop_name,omitempty"`
588
+ unknownFields protoimpl.UnknownFields
589
+ sizeCache protoimpl.SizeCache
590
+ }
591
+
592
+ func (x *ObjectProperties) Reset() {
593
+ *x = ObjectProperties{}
594
+ mi := &file_v1_base_proto_msgTypes[6]
595
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
596
+ ms.StoreMessageInfo(mi)
597
+ }
598
+
599
+ func (x *ObjectProperties) String() string {
600
+ return protoimpl.X.MessageStringOf(x)
601
+ }
602
+
603
+ func (*ObjectProperties) ProtoMessage() {}
604
+
605
+ func (x *ObjectProperties) ProtoReflect() protoreflect.Message {
606
+ mi := &file_v1_base_proto_msgTypes[6]
607
+ if x != nil {
608
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
609
+ if ms.LoadMessageInfo() == nil {
610
+ ms.StoreMessageInfo(mi)
611
+ }
612
+ return ms
613
+ }
614
+ return mi.MessageOf(x)
615
+ }
616
+
617
+ // Deprecated: Use ObjectProperties.ProtoReflect.Descriptor instead.
618
+ func (*ObjectProperties) Descriptor() ([]byte, []int) {
619
+ return file_v1_base_proto_rawDescGZIP(), []int{6}
620
+ }
621
+
622
+ func (x *ObjectProperties) GetValue() *ObjectPropertiesValue {
623
+ if x != nil {
624
+ return x.Value
625
+ }
626
+ return nil
627
+ }
628
+
629
+ func (x *ObjectProperties) GetPropName() string {
630
+ if x != nil {
631
+ return x.PropName
632
+ }
633
+ return ""
634
+ }
635
+
636
+ type TextArray struct {
637
+ state protoimpl.MessageState `protogen:"open.v1"`
638
+ Values []string `protobuf:"bytes,1,rep,name=values,proto3" json:"values,omitempty"`
639
+ unknownFields protoimpl.UnknownFields
640
+ sizeCache protoimpl.SizeCache
641
+ }
642
+
643
+ func (x *TextArray) Reset() {
644
+ *x = TextArray{}
645
+ mi := &file_v1_base_proto_msgTypes[7]
646
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
647
+ ms.StoreMessageInfo(mi)
648
+ }
649
+
650
+ func (x *TextArray) String() string {
651
+ return protoimpl.X.MessageStringOf(x)
652
+ }
653
+
654
+ func (*TextArray) ProtoMessage() {}
655
+
656
+ func (x *TextArray) ProtoReflect() protoreflect.Message {
657
+ mi := &file_v1_base_proto_msgTypes[7]
658
+ if x != nil {
659
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
660
+ if ms.LoadMessageInfo() == nil {
661
+ ms.StoreMessageInfo(mi)
662
+ }
663
+ return ms
664
+ }
665
+ return mi.MessageOf(x)
666
+ }
667
+
668
+ // Deprecated: Use TextArray.ProtoReflect.Descriptor instead.
669
+ func (*TextArray) Descriptor() ([]byte, []int) {
670
+ return file_v1_base_proto_rawDescGZIP(), []int{7}
671
+ }
672
+
673
+ func (x *TextArray) GetValues() []string {
674
+ if x != nil {
675
+ return x.Values
676
+ }
677
+ return nil
678
+ }
679
+
680
+ type IntArray struct {
681
+ state protoimpl.MessageState `protogen:"open.v1"`
682
+ Values []int64 `protobuf:"varint,1,rep,packed,name=values,proto3" json:"values,omitempty"`
683
+ unknownFields protoimpl.UnknownFields
684
+ sizeCache protoimpl.SizeCache
685
+ }
686
+
687
+ func (x *IntArray) Reset() {
688
+ *x = IntArray{}
689
+ mi := &file_v1_base_proto_msgTypes[8]
690
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
691
+ ms.StoreMessageInfo(mi)
692
+ }
693
+
694
+ func (x *IntArray) String() string {
695
+ return protoimpl.X.MessageStringOf(x)
696
+ }
697
+
698
+ func (*IntArray) ProtoMessage() {}
699
+
700
+ func (x *IntArray) ProtoReflect() protoreflect.Message {
701
+ mi := &file_v1_base_proto_msgTypes[8]
702
+ if x != nil {
703
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
704
+ if ms.LoadMessageInfo() == nil {
705
+ ms.StoreMessageInfo(mi)
706
+ }
707
+ return ms
708
+ }
709
+ return mi.MessageOf(x)
710
+ }
711
+
712
+ // Deprecated: Use IntArray.ProtoReflect.Descriptor instead.
713
+ func (*IntArray) Descriptor() ([]byte, []int) {
714
+ return file_v1_base_proto_rawDescGZIP(), []int{8}
715
+ }
716
+
717
+ func (x *IntArray) GetValues() []int64 {
718
+ if x != nil {
719
+ return x.Values
720
+ }
721
+ return nil
722
+ }
723
+
724
+ type NumberArray struct {
725
+ state protoimpl.MessageState `protogen:"open.v1"`
726
+ Values []float64 `protobuf:"fixed64,1,rep,packed,name=values,proto3" json:"values,omitempty"`
727
+ unknownFields protoimpl.UnknownFields
728
+ sizeCache protoimpl.SizeCache
729
+ }
730
+
731
+ func (x *NumberArray) Reset() {
732
+ *x = NumberArray{}
733
+ mi := &file_v1_base_proto_msgTypes[9]
734
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
735
+ ms.StoreMessageInfo(mi)
736
+ }
737
+
738
+ func (x *NumberArray) String() string {
739
+ return protoimpl.X.MessageStringOf(x)
740
+ }
741
+
742
+ func (*NumberArray) ProtoMessage() {}
743
+
744
+ func (x *NumberArray) ProtoReflect() protoreflect.Message {
745
+ mi := &file_v1_base_proto_msgTypes[9]
746
+ if x != nil {
747
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
748
+ if ms.LoadMessageInfo() == nil {
749
+ ms.StoreMessageInfo(mi)
750
+ }
751
+ return ms
752
+ }
753
+ return mi.MessageOf(x)
754
+ }
755
+
756
+ // Deprecated: Use NumberArray.ProtoReflect.Descriptor instead.
757
+ func (*NumberArray) Descriptor() ([]byte, []int) {
758
+ return file_v1_base_proto_rawDescGZIP(), []int{9}
759
+ }
760
+
761
+ func (x *NumberArray) GetValues() []float64 {
762
+ if x != nil {
763
+ return x.Values
764
+ }
765
+ return nil
766
+ }
767
+
768
+ type BooleanArray struct {
769
+ state protoimpl.MessageState `protogen:"open.v1"`
770
+ Values []bool `protobuf:"varint,1,rep,packed,name=values,proto3" json:"values,omitempty"`
771
+ unknownFields protoimpl.UnknownFields
772
+ sizeCache protoimpl.SizeCache
773
+ }
774
+
775
+ func (x *BooleanArray) Reset() {
776
+ *x = BooleanArray{}
777
+ mi := &file_v1_base_proto_msgTypes[10]
778
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
779
+ ms.StoreMessageInfo(mi)
780
+ }
781
+
782
+ func (x *BooleanArray) String() string {
783
+ return protoimpl.X.MessageStringOf(x)
784
+ }
785
+
786
+ func (*BooleanArray) ProtoMessage() {}
787
+
788
+ func (x *BooleanArray) ProtoReflect() protoreflect.Message {
789
+ mi := &file_v1_base_proto_msgTypes[10]
790
+ if x != nil {
791
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
792
+ if ms.LoadMessageInfo() == nil {
793
+ ms.StoreMessageInfo(mi)
794
+ }
795
+ return ms
796
+ }
797
+ return mi.MessageOf(x)
798
+ }
799
+
800
+ // Deprecated: Use BooleanArray.ProtoReflect.Descriptor instead.
801
+ func (*BooleanArray) Descriptor() ([]byte, []int) {
802
+ return file_v1_base_proto_rawDescGZIP(), []int{10}
803
+ }
804
+
805
+ func (x *BooleanArray) GetValues() []bool {
806
+ if x != nil {
807
+ return x.Values
808
+ }
809
+ return nil
810
+ }
811
+
812
+ type Filters struct {
813
+ state protoimpl.MessageState `protogen:"open.v1"`
814
+ Operator Filters_Operator `protobuf:"varint,1,opt,name=operator,proto3,enum=weaviate.v1.Filters_Operator" json:"operator,omitempty"`
815
+ // protolint:disable:next REPEATED_FIELD_NAMES_PLURALIZED
816
+ //
817
+ // Deprecated: Marked as deprecated in v1/base.proto.
818
+ On []string `protobuf:"bytes,2,rep,name=on,proto3" json:"on,omitempty"` // will be removed in the future, use path
819
+ Filters []*Filters `protobuf:"bytes,3,rep,name=filters,proto3" json:"filters,omitempty"`
820
+ // Types that are valid to be assigned to TestValue:
821
+ //
822
+ // *Filters_ValueText
823
+ // *Filters_ValueInt
824
+ // *Filters_ValueBoolean
825
+ // *Filters_ValueNumber
826
+ // *Filters_ValueTextArray
827
+ // *Filters_ValueIntArray
828
+ // *Filters_ValueBooleanArray
829
+ // *Filters_ValueNumberArray
830
+ // *Filters_ValueGeo
831
+ TestValue isFilters_TestValue `protobuf_oneof:"test_value"`
832
+ Target *FilterTarget `protobuf:"bytes,20,opt,name=target,proto3" json:"target,omitempty"` // leave space for more filter values
833
+ unknownFields protoimpl.UnknownFields
834
+ sizeCache protoimpl.SizeCache
835
+ }
836
+
837
+ func (x *Filters) Reset() {
838
+ *x = Filters{}
839
+ mi := &file_v1_base_proto_msgTypes[11]
840
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
841
+ ms.StoreMessageInfo(mi)
842
+ }
843
+
844
+ func (x *Filters) String() string {
845
+ return protoimpl.X.MessageStringOf(x)
846
+ }
847
+
848
+ func (*Filters) ProtoMessage() {}
849
+
850
+ func (x *Filters) ProtoReflect() protoreflect.Message {
851
+ mi := &file_v1_base_proto_msgTypes[11]
852
+ if x != nil {
853
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
854
+ if ms.LoadMessageInfo() == nil {
855
+ ms.StoreMessageInfo(mi)
856
+ }
857
+ return ms
858
+ }
859
+ return mi.MessageOf(x)
860
+ }
861
+
862
+ // Deprecated: Use Filters.ProtoReflect.Descriptor instead.
863
+ func (*Filters) Descriptor() ([]byte, []int) {
864
+ return file_v1_base_proto_rawDescGZIP(), []int{11}
865
+ }
866
+
867
+ func (x *Filters) GetOperator() Filters_Operator {
868
+ if x != nil {
869
+ return x.Operator
870
+ }
871
+ return Filters_OPERATOR_UNSPECIFIED
872
+ }
873
+
874
+ // Deprecated: Marked as deprecated in v1/base.proto.
875
+ func (x *Filters) GetOn() []string {
876
+ if x != nil {
877
+ return x.On
878
+ }
879
+ return nil
880
+ }
881
+
882
+ func (x *Filters) GetFilters() []*Filters {
883
+ if x != nil {
884
+ return x.Filters
885
+ }
886
+ return nil
887
+ }
888
+
889
+ func (x *Filters) GetTestValue() isFilters_TestValue {
890
+ if x != nil {
891
+ return x.TestValue
892
+ }
893
+ return nil
894
+ }
895
+
896
+ func (x *Filters) GetValueText() string {
897
+ if x != nil {
898
+ if x, ok := x.TestValue.(*Filters_ValueText); ok {
899
+ return x.ValueText
900
+ }
901
+ }
902
+ return ""
903
+ }
904
+
905
+ func (x *Filters) GetValueInt() int64 {
906
+ if x != nil {
907
+ if x, ok := x.TestValue.(*Filters_ValueInt); ok {
908
+ return x.ValueInt
909
+ }
910
+ }
911
+ return 0
912
+ }
913
+
914
+ func (x *Filters) GetValueBoolean() bool {
915
+ if x != nil {
916
+ if x, ok := x.TestValue.(*Filters_ValueBoolean); ok {
917
+ return x.ValueBoolean
918
+ }
919
+ }
920
+ return false
921
+ }
922
+
923
+ func (x *Filters) GetValueNumber() float64 {
924
+ if x != nil {
925
+ if x, ok := x.TestValue.(*Filters_ValueNumber); ok {
926
+ return x.ValueNumber
927
+ }
928
+ }
929
+ return 0
930
+ }
931
+
932
+ func (x *Filters) GetValueTextArray() *TextArray {
933
+ if x != nil {
934
+ if x, ok := x.TestValue.(*Filters_ValueTextArray); ok {
935
+ return x.ValueTextArray
936
+ }
937
+ }
938
+ return nil
939
+ }
940
+
941
+ func (x *Filters) GetValueIntArray() *IntArray {
942
+ if x != nil {
943
+ if x, ok := x.TestValue.(*Filters_ValueIntArray); ok {
944
+ return x.ValueIntArray
945
+ }
946
+ }
947
+ return nil
948
+ }
949
+
950
+ func (x *Filters) GetValueBooleanArray() *BooleanArray {
951
+ if x != nil {
952
+ if x, ok := x.TestValue.(*Filters_ValueBooleanArray); ok {
953
+ return x.ValueBooleanArray
954
+ }
955
+ }
956
+ return nil
957
+ }
958
+
959
+ func (x *Filters) GetValueNumberArray() *NumberArray {
960
+ if x != nil {
961
+ if x, ok := x.TestValue.(*Filters_ValueNumberArray); ok {
962
+ return x.ValueNumberArray
963
+ }
964
+ }
965
+ return nil
966
+ }
967
+
968
+ func (x *Filters) GetValueGeo() *GeoCoordinatesFilter {
969
+ if x != nil {
970
+ if x, ok := x.TestValue.(*Filters_ValueGeo); ok {
971
+ return x.ValueGeo
972
+ }
973
+ }
974
+ return nil
975
+ }
976
+
977
+ func (x *Filters) GetTarget() *FilterTarget {
978
+ if x != nil {
979
+ return x.Target
980
+ }
981
+ return nil
982
+ }
983
+
984
+ type isFilters_TestValue interface {
985
+ isFilters_TestValue()
986
+ }
987
+
988
+ type Filters_ValueText struct {
989
+ ValueText string `protobuf:"bytes,4,opt,name=value_text,json=valueText,proto3,oneof"`
990
+ }
991
+
992
+ type Filters_ValueInt struct {
993
+ ValueInt int64 `protobuf:"varint,5,opt,name=value_int,json=valueInt,proto3,oneof"`
994
+ }
995
+
996
+ type Filters_ValueBoolean struct {
997
+ ValueBoolean bool `protobuf:"varint,6,opt,name=value_boolean,json=valueBoolean,proto3,oneof"`
998
+ }
999
+
1000
+ type Filters_ValueNumber struct {
1001
+ ValueNumber float64 `protobuf:"fixed64,7,opt,name=value_number,json=valueNumber,proto3,oneof"`
1002
+ }
1003
+
1004
+ type Filters_ValueTextArray struct {
1005
+ ValueTextArray *TextArray `protobuf:"bytes,9,opt,name=value_text_array,json=valueTextArray,proto3,oneof"`
1006
+ }
1007
+
1008
+ type Filters_ValueIntArray struct {
1009
+ ValueIntArray *IntArray `protobuf:"bytes,10,opt,name=value_int_array,json=valueIntArray,proto3,oneof"`
1010
+ }
1011
+
1012
+ type Filters_ValueBooleanArray struct {
1013
+ ValueBooleanArray *BooleanArray `protobuf:"bytes,11,opt,name=value_boolean_array,json=valueBooleanArray,proto3,oneof"`
1014
+ }
1015
+
1016
+ type Filters_ValueNumberArray struct {
1017
+ ValueNumberArray *NumberArray `protobuf:"bytes,12,opt,name=value_number_array,json=valueNumberArray,proto3,oneof"`
1018
+ }
1019
+
1020
+ type Filters_ValueGeo struct {
1021
+ ValueGeo *GeoCoordinatesFilter `protobuf:"bytes,13,opt,name=value_geo,json=valueGeo,proto3,oneof"`
1022
+ }
1023
+
1024
+ func (*Filters_ValueText) isFilters_TestValue() {}
1025
+
1026
+ func (*Filters_ValueInt) isFilters_TestValue() {}
1027
+
1028
+ func (*Filters_ValueBoolean) isFilters_TestValue() {}
1029
+
1030
+ func (*Filters_ValueNumber) isFilters_TestValue() {}
1031
+
1032
+ func (*Filters_ValueTextArray) isFilters_TestValue() {}
1033
+
1034
+ func (*Filters_ValueIntArray) isFilters_TestValue() {}
1035
+
1036
+ func (*Filters_ValueBooleanArray) isFilters_TestValue() {}
1037
+
1038
+ func (*Filters_ValueNumberArray) isFilters_TestValue() {}
1039
+
1040
+ func (*Filters_ValueGeo) isFilters_TestValue() {}
1041
+
1042
+ type FilterReferenceSingleTarget struct {
1043
+ state protoimpl.MessageState `protogen:"open.v1"`
1044
+ On string `protobuf:"bytes,1,opt,name=on,proto3" json:"on,omitempty"`
1045
+ Target *FilterTarget `protobuf:"bytes,2,opt,name=target,proto3" json:"target,omitempty"`
1046
+ unknownFields protoimpl.UnknownFields
1047
+ sizeCache protoimpl.SizeCache
1048
+ }
1049
+
1050
+ func (x *FilterReferenceSingleTarget) Reset() {
1051
+ *x = FilterReferenceSingleTarget{}
1052
+ mi := &file_v1_base_proto_msgTypes[12]
1053
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
1054
+ ms.StoreMessageInfo(mi)
1055
+ }
1056
+
1057
+ func (x *FilterReferenceSingleTarget) String() string {
1058
+ return protoimpl.X.MessageStringOf(x)
1059
+ }
1060
+
1061
+ func (*FilterReferenceSingleTarget) ProtoMessage() {}
1062
+
1063
+ func (x *FilterReferenceSingleTarget) ProtoReflect() protoreflect.Message {
1064
+ mi := &file_v1_base_proto_msgTypes[12]
1065
+ if x != nil {
1066
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
1067
+ if ms.LoadMessageInfo() == nil {
1068
+ ms.StoreMessageInfo(mi)
1069
+ }
1070
+ return ms
1071
+ }
1072
+ return mi.MessageOf(x)
1073
+ }
1074
+
1075
+ // Deprecated: Use FilterReferenceSingleTarget.ProtoReflect.Descriptor instead.
1076
+ func (*FilterReferenceSingleTarget) Descriptor() ([]byte, []int) {
1077
+ return file_v1_base_proto_rawDescGZIP(), []int{12}
1078
+ }
1079
+
1080
+ func (x *FilterReferenceSingleTarget) GetOn() string {
1081
+ if x != nil {
1082
+ return x.On
1083
+ }
1084
+ return ""
1085
+ }
1086
+
1087
+ func (x *FilterReferenceSingleTarget) GetTarget() *FilterTarget {
1088
+ if x != nil {
1089
+ return x.Target
1090
+ }
1091
+ return nil
1092
+ }
1093
+
1094
+ type FilterReferenceMultiTarget struct {
1095
+ state protoimpl.MessageState `protogen:"open.v1"`
1096
+ On string `protobuf:"bytes,1,opt,name=on,proto3" json:"on,omitempty"`
1097
+ Target *FilterTarget `protobuf:"bytes,2,opt,name=target,proto3" json:"target,omitempty"`
1098
+ TargetCollection string `protobuf:"bytes,3,opt,name=target_collection,json=targetCollection,proto3" json:"target_collection,omitempty"`
1099
+ unknownFields protoimpl.UnknownFields
1100
+ sizeCache protoimpl.SizeCache
1101
+ }
1102
+
1103
+ func (x *FilterReferenceMultiTarget) Reset() {
1104
+ *x = FilterReferenceMultiTarget{}
1105
+ mi := &file_v1_base_proto_msgTypes[13]
1106
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
1107
+ ms.StoreMessageInfo(mi)
1108
+ }
1109
+
1110
+ func (x *FilterReferenceMultiTarget) String() string {
1111
+ return protoimpl.X.MessageStringOf(x)
1112
+ }
1113
+
1114
+ func (*FilterReferenceMultiTarget) ProtoMessage() {}
1115
+
1116
+ func (x *FilterReferenceMultiTarget) ProtoReflect() protoreflect.Message {
1117
+ mi := &file_v1_base_proto_msgTypes[13]
1118
+ if x != nil {
1119
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
1120
+ if ms.LoadMessageInfo() == nil {
1121
+ ms.StoreMessageInfo(mi)
1122
+ }
1123
+ return ms
1124
+ }
1125
+ return mi.MessageOf(x)
1126
+ }
1127
+
1128
+ // Deprecated: Use FilterReferenceMultiTarget.ProtoReflect.Descriptor instead.
1129
+ func (*FilterReferenceMultiTarget) Descriptor() ([]byte, []int) {
1130
+ return file_v1_base_proto_rawDescGZIP(), []int{13}
1131
+ }
1132
+
1133
+ func (x *FilterReferenceMultiTarget) GetOn() string {
1134
+ if x != nil {
1135
+ return x.On
1136
+ }
1137
+ return ""
1138
+ }
1139
+
1140
+ func (x *FilterReferenceMultiTarget) GetTarget() *FilterTarget {
1141
+ if x != nil {
1142
+ return x.Target
1143
+ }
1144
+ return nil
1145
+ }
1146
+
1147
+ func (x *FilterReferenceMultiTarget) GetTargetCollection() string {
1148
+ if x != nil {
1149
+ return x.TargetCollection
1150
+ }
1151
+ return ""
1152
+ }
1153
+
1154
+ type FilterReferenceCount struct {
1155
+ state protoimpl.MessageState `protogen:"open.v1"`
1156
+ On string `protobuf:"bytes,1,opt,name=on,proto3" json:"on,omitempty"`
1157
+ unknownFields protoimpl.UnknownFields
1158
+ sizeCache protoimpl.SizeCache
1159
+ }
1160
+
1161
+ func (x *FilterReferenceCount) Reset() {
1162
+ *x = FilterReferenceCount{}
1163
+ mi := &file_v1_base_proto_msgTypes[14]
1164
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
1165
+ ms.StoreMessageInfo(mi)
1166
+ }
1167
+
1168
+ func (x *FilterReferenceCount) String() string {
1169
+ return protoimpl.X.MessageStringOf(x)
1170
+ }
1171
+
1172
+ func (*FilterReferenceCount) ProtoMessage() {}
1173
+
1174
+ func (x *FilterReferenceCount) ProtoReflect() protoreflect.Message {
1175
+ mi := &file_v1_base_proto_msgTypes[14]
1176
+ if x != nil {
1177
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
1178
+ if ms.LoadMessageInfo() == nil {
1179
+ ms.StoreMessageInfo(mi)
1180
+ }
1181
+ return ms
1182
+ }
1183
+ return mi.MessageOf(x)
1184
+ }
1185
+
1186
+ // Deprecated: Use FilterReferenceCount.ProtoReflect.Descriptor instead.
1187
+ func (*FilterReferenceCount) Descriptor() ([]byte, []int) {
1188
+ return file_v1_base_proto_rawDescGZIP(), []int{14}
1189
+ }
1190
+
1191
+ func (x *FilterReferenceCount) GetOn() string {
1192
+ if x != nil {
1193
+ return x.On
1194
+ }
1195
+ return ""
1196
+ }
1197
+
1198
+ type FilterTarget struct {
1199
+ state protoimpl.MessageState `protogen:"open.v1"`
1200
+ // Types that are valid to be assigned to Target:
1201
+ //
1202
+ // *FilterTarget_Property
1203
+ // *FilterTarget_SingleTarget
1204
+ // *FilterTarget_MultiTarget
1205
+ // *FilterTarget_Count
1206
+ Target isFilterTarget_Target `protobuf_oneof:"target"`
1207
+ unknownFields protoimpl.UnknownFields
1208
+ sizeCache protoimpl.SizeCache
1209
+ }
1210
+
1211
+ func (x *FilterTarget) Reset() {
1212
+ *x = FilterTarget{}
1213
+ mi := &file_v1_base_proto_msgTypes[15]
1214
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
1215
+ ms.StoreMessageInfo(mi)
1216
+ }
1217
+
1218
+ func (x *FilterTarget) String() string {
1219
+ return protoimpl.X.MessageStringOf(x)
1220
+ }
1221
+
1222
+ func (*FilterTarget) ProtoMessage() {}
1223
+
1224
+ func (x *FilterTarget) ProtoReflect() protoreflect.Message {
1225
+ mi := &file_v1_base_proto_msgTypes[15]
1226
+ if x != nil {
1227
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
1228
+ if ms.LoadMessageInfo() == nil {
1229
+ ms.StoreMessageInfo(mi)
1230
+ }
1231
+ return ms
1232
+ }
1233
+ return mi.MessageOf(x)
1234
+ }
1235
+
1236
+ // Deprecated: Use FilterTarget.ProtoReflect.Descriptor instead.
1237
+ func (*FilterTarget) Descriptor() ([]byte, []int) {
1238
+ return file_v1_base_proto_rawDescGZIP(), []int{15}
1239
+ }
1240
+
1241
+ func (x *FilterTarget) GetTarget() isFilterTarget_Target {
1242
+ if x != nil {
1243
+ return x.Target
1244
+ }
1245
+ return nil
1246
+ }
1247
+
1248
+ func (x *FilterTarget) GetProperty() string {
1249
+ if x != nil {
1250
+ if x, ok := x.Target.(*FilterTarget_Property); ok {
1251
+ return x.Property
1252
+ }
1253
+ }
1254
+ return ""
1255
+ }
1256
+
1257
+ func (x *FilterTarget) GetSingleTarget() *FilterReferenceSingleTarget {
1258
+ if x != nil {
1259
+ if x, ok := x.Target.(*FilterTarget_SingleTarget); ok {
1260
+ return x.SingleTarget
1261
+ }
1262
+ }
1263
+ return nil
1264
+ }
1265
+
1266
+ func (x *FilterTarget) GetMultiTarget() *FilterReferenceMultiTarget {
1267
+ if x != nil {
1268
+ if x, ok := x.Target.(*FilterTarget_MultiTarget); ok {
1269
+ return x.MultiTarget
1270
+ }
1271
+ }
1272
+ return nil
1273
+ }
1274
+
1275
+ func (x *FilterTarget) GetCount() *FilterReferenceCount {
1276
+ if x != nil {
1277
+ if x, ok := x.Target.(*FilterTarget_Count); ok {
1278
+ return x.Count
1279
+ }
1280
+ }
1281
+ return nil
1282
+ }
1283
+
1284
+ type isFilterTarget_Target interface {
1285
+ isFilterTarget_Target()
1286
+ }
1287
+
1288
+ type FilterTarget_Property struct {
1289
+ Property string `protobuf:"bytes,1,opt,name=property,proto3,oneof"`
1290
+ }
1291
+
1292
+ type FilterTarget_SingleTarget struct {
1293
+ SingleTarget *FilterReferenceSingleTarget `protobuf:"bytes,2,opt,name=single_target,json=singleTarget,proto3,oneof"`
1294
+ }
1295
+
1296
+ type FilterTarget_MultiTarget struct {
1297
+ MultiTarget *FilterReferenceMultiTarget `protobuf:"bytes,3,opt,name=multi_target,json=multiTarget,proto3,oneof"`
1298
+ }
1299
+
1300
+ type FilterTarget_Count struct {
1301
+ Count *FilterReferenceCount `protobuf:"bytes,4,opt,name=count,proto3,oneof"`
1302
+ }
1303
+
1304
+ func (*FilterTarget_Property) isFilterTarget_Target() {}
1305
+
1306
+ func (*FilterTarget_SingleTarget) isFilterTarget_Target() {}
1307
+
1308
+ func (*FilterTarget_MultiTarget) isFilterTarget_Target() {}
1309
+
1310
+ func (*FilterTarget_Count) isFilterTarget_Target() {}
1311
+
1312
+ type GeoCoordinatesFilter struct {
1313
+ state protoimpl.MessageState `protogen:"open.v1"`
1314
+ Latitude float32 `protobuf:"fixed32,1,opt,name=latitude,proto3" json:"latitude,omitempty"`
1315
+ Longitude float32 `protobuf:"fixed32,2,opt,name=longitude,proto3" json:"longitude,omitempty"`
1316
+ Distance float32 `protobuf:"fixed32,3,opt,name=distance,proto3" json:"distance,omitempty"`
1317
+ unknownFields protoimpl.UnknownFields
1318
+ sizeCache protoimpl.SizeCache
1319
+ }
1320
+
1321
+ func (x *GeoCoordinatesFilter) Reset() {
1322
+ *x = GeoCoordinatesFilter{}
1323
+ mi := &file_v1_base_proto_msgTypes[16]
1324
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
1325
+ ms.StoreMessageInfo(mi)
1326
+ }
1327
+
1328
+ func (x *GeoCoordinatesFilter) String() string {
1329
+ return protoimpl.X.MessageStringOf(x)
1330
+ }
1331
+
1332
+ func (*GeoCoordinatesFilter) ProtoMessage() {}
1333
+
1334
+ func (x *GeoCoordinatesFilter) ProtoReflect() protoreflect.Message {
1335
+ mi := &file_v1_base_proto_msgTypes[16]
1336
+ if x != nil {
1337
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
1338
+ if ms.LoadMessageInfo() == nil {
1339
+ ms.StoreMessageInfo(mi)
1340
+ }
1341
+ return ms
1342
+ }
1343
+ return mi.MessageOf(x)
1344
+ }
1345
+
1346
+ // Deprecated: Use GeoCoordinatesFilter.ProtoReflect.Descriptor instead.
1347
+ func (*GeoCoordinatesFilter) Descriptor() ([]byte, []int) {
1348
+ return file_v1_base_proto_rawDescGZIP(), []int{16}
1349
+ }
1350
+
1351
+ func (x *GeoCoordinatesFilter) GetLatitude() float32 {
1352
+ if x != nil {
1353
+ return x.Latitude
1354
+ }
1355
+ return 0
1356
+ }
1357
+
1358
+ func (x *GeoCoordinatesFilter) GetLongitude() float32 {
1359
+ if x != nil {
1360
+ return x.Longitude
1361
+ }
1362
+ return 0
1363
+ }
1364
+
1365
+ func (x *GeoCoordinatesFilter) GetDistance() float32 {
1366
+ if x != nil {
1367
+ return x.Distance
1368
+ }
1369
+ return 0
1370
+ }
1371
+
1372
+ type Vectors struct {
1373
+ state protoimpl.MessageState `protogen:"open.v1"`
1374
+ Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
1375
+ // Deprecated: Marked as deprecated in v1/base.proto.
1376
+ Index uint64 `protobuf:"varint,2,opt,name=index,proto3" json:"index,omitempty"` // for multi-vec
1377
+ VectorBytes []byte `protobuf:"bytes,3,opt,name=vector_bytes,json=vectorBytes,proto3" json:"vector_bytes,omitempty"`
1378
+ Type Vectors_VectorType `protobuf:"varint,4,opt,name=type,proto3,enum=weaviate.v1.Vectors_VectorType" json:"type,omitempty"`
1379
+ unknownFields protoimpl.UnknownFields
1380
+ sizeCache protoimpl.SizeCache
1381
+ }
1382
+
1383
+ func (x *Vectors) Reset() {
1384
+ *x = Vectors{}
1385
+ mi := &file_v1_base_proto_msgTypes[17]
1386
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
1387
+ ms.StoreMessageInfo(mi)
1388
+ }
1389
+
1390
+ func (x *Vectors) String() string {
1391
+ return protoimpl.X.MessageStringOf(x)
1392
+ }
1393
+
1394
+ func (*Vectors) ProtoMessage() {}
1395
+
1396
+ func (x *Vectors) ProtoReflect() protoreflect.Message {
1397
+ mi := &file_v1_base_proto_msgTypes[17]
1398
+ if x != nil {
1399
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
1400
+ if ms.LoadMessageInfo() == nil {
1401
+ ms.StoreMessageInfo(mi)
1402
+ }
1403
+ return ms
1404
+ }
1405
+ return mi.MessageOf(x)
1406
+ }
1407
+
1408
+ // Deprecated: Use Vectors.ProtoReflect.Descriptor instead.
1409
+ func (*Vectors) Descriptor() ([]byte, []int) {
1410
+ return file_v1_base_proto_rawDescGZIP(), []int{17}
1411
+ }
1412
+
1413
+ func (x *Vectors) GetName() string {
1414
+ if x != nil {
1415
+ return x.Name
1416
+ }
1417
+ return ""
1418
+ }
1419
+
1420
+ // Deprecated: Marked as deprecated in v1/base.proto.
1421
+ func (x *Vectors) GetIndex() uint64 {
1422
+ if x != nil {
1423
+ return x.Index
1424
+ }
1425
+ return 0
1426
+ }
1427
+
1428
+ func (x *Vectors) GetVectorBytes() []byte {
1429
+ if x != nil {
1430
+ return x.VectorBytes
1431
+ }
1432
+ return nil
1433
+ }
1434
+
1435
+ func (x *Vectors) GetType() Vectors_VectorType {
1436
+ if x != nil {
1437
+ return x.Type
1438
+ }
1439
+ return Vectors_VECTOR_TYPE_UNSPECIFIED
1440
+ }
1441
+
1442
+ var File_v1_base_proto protoreflect.FileDescriptor
1443
+
1444
+ const file_v1_base_proto_rawDesc = "" +
1445
+ "\n" +
1446
+ "\rv1/base.proto\x12\vweaviate.v1\x1a\x1cgoogle/protobuf/struct.proto\"s\n" +
1447
+ "\x15NumberArrayProperties\x12\x1a\n" +
1448
+ "\x06values\x18\x01 \x03(\x01B\x02\x18\x01R\x06values\x12\x1b\n" +
1449
+ "\tprop_name\x18\x02 \x01(\tR\bpropName\x12!\n" +
1450
+ "\fvalues_bytes\x18\x03 \x01(\fR\vvaluesBytes\"I\n" +
1451
+ "\x12IntArrayProperties\x12\x16\n" +
1452
+ "\x06values\x18\x01 \x03(\x03R\x06values\x12\x1b\n" +
1453
+ "\tprop_name\x18\x02 \x01(\tR\bpropName\"J\n" +
1454
+ "\x13TextArrayProperties\x12\x16\n" +
1455
+ "\x06values\x18\x01 \x03(\tR\x06values\x12\x1b\n" +
1456
+ "\tprop_name\x18\x02 \x01(\tR\bpropName\"M\n" +
1457
+ "\x16BooleanArrayProperties\x12\x16\n" +
1458
+ "\x06values\x18\x01 \x03(\bR\x06values\x12\x1b\n" +
1459
+ "\tprop_name\x18\x02 \x01(\tR\bpropName\"\x94\x05\n" +
1460
+ "\x15ObjectPropertiesValue\x12E\n" +
1461
+ "\x12non_ref_properties\x18\x01 \x01(\v2\x17.google.protobuf.StructR\x10nonRefProperties\x12Z\n" +
1462
+ "\x17number_array_properties\x18\x02 \x03(\v2\".weaviate.v1.NumberArrayPropertiesR\x15numberArrayProperties\x12Q\n" +
1463
+ "\x14int_array_properties\x18\x03 \x03(\v2\x1f.weaviate.v1.IntArrayPropertiesR\x12intArrayProperties\x12T\n" +
1464
+ "\x15text_array_properties\x18\x04 \x03(\v2 .weaviate.v1.TextArrayPropertiesR\x13textArrayProperties\x12]\n" +
1465
+ "\x18boolean_array_properties\x18\x05 \x03(\v2#.weaviate.v1.BooleanArrayPropertiesR\x16booleanArrayProperties\x12J\n" +
1466
+ "\x11object_properties\x18\x06 \x03(\v2\x1d.weaviate.v1.ObjectPropertiesR\x10objectProperties\x12Z\n" +
1467
+ "\x17object_array_properties\x18\a \x03(\v2\".weaviate.v1.ObjectArrayPropertiesR\x15objectArrayProperties\x12(\n" +
1468
+ "\x10empty_list_props\x18\n" +
1469
+ " \x03(\tR\x0eemptyListProps\"p\n" +
1470
+ "\x15ObjectArrayProperties\x12:\n" +
1471
+ "\x06values\x18\x01 \x03(\v2\".weaviate.v1.ObjectPropertiesValueR\x06values\x12\x1b\n" +
1472
+ "\tprop_name\x18\x02 \x01(\tR\bpropName\"i\n" +
1473
+ "\x10ObjectProperties\x128\n" +
1474
+ "\x05value\x18\x01 \x01(\v2\".weaviate.v1.ObjectPropertiesValueR\x05value\x12\x1b\n" +
1475
+ "\tprop_name\x18\x02 \x01(\tR\bpropName\"#\n" +
1476
+ "\tTextArray\x12\x16\n" +
1477
+ "\x06values\x18\x01 \x03(\tR\x06values\"\"\n" +
1478
+ "\bIntArray\x12\x16\n" +
1479
+ "\x06values\x18\x01 \x03(\x03R\x06values\"%\n" +
1480
+ "\vNumberArray\x12\x16\n" +
1481
+ "\x06values\x18\x01 \x03(\x01R\x06values\"&\n" +
1482
+ "\fBooleanArray\x12\x16\n" +
1483
+ "\x06values\x18\x01 \x03(\bR\x06values\"\xc7\b\n" +
1484
+ "\aFilters\x129\n" +
1485
+ "\boperator\x18\x01 \x01(\x0e2\x1d.weaviate.v1.Filters.OperatorR\boperator\x12\x12\n" +
1486
+ "\x02on\x18\x02 \x03(\tB\x02\x18\x01R\x02on\x12.\n" +
1487
+ "\afilters\x18\x03 \x03(\v2\x14.weaviate.v1.FiltersR\afilters\x12\x1f\n" +
1488
+ "\n" +
1489
+ "value_text\x18\x04 \x01(\tH\x00R\tvalueText\x12\x1d\n" +
1490
+ "\tvalue_int\x18\x05 \x01(\x03H\x00R\bvalueInt\x12%\n" +
1491
+ "\rvalue_boolean\x18\x06 \x01(\bH\x00R\fvalueBoolean\x12#\n" +
1492
+ "\fvalue_number\x18\a \x01(\x01H\x00R\vvalueNumber\x12B\n" +
1493
+ "\x10value_text_array\x18\t \x01(\v2\x16.weaviate.v1.TextArrayH\x00R\x0evalueTextArray\x12?\n" +
1494
+ "\x0fvalue_int_array\x18\n" +
1495
+ " \x01(\v2\x15.weaviate.v1.IntArrayH\x00R\rvalueIntArray\x12K\n" +
1496
+ "\x13value_boolean_array\x18\v \x01(\v2\x19.weaviate.v1.BooleanArrayH\x00R\x11valueBooleanArray\x12H\n" +
1497
+ "\x12value_number_array\x18\f \x01(\v2\x18.weaviate.v1.NumberArrayH\x00R\x10valueNumberArray\x12@\n" +
1498
+ "\tvalue_geo\x18\r \x01(\v2!.weaviate.v1.GeoCoordinatesFilterH\x00R\bvalueGeo\x121\n" +
1499
+ "\x06target\x18\x14 \x01(\v2\x19.weaviate.v1.FilterTargetR\x06target\"\x91\x03\n" +
1500
+ "\bOperator\x12\x18\n" +
1501
+ "\x14OPERATOR_UNSPECIFIED\x10\x00\x12\x12\n" +
1502
+ "\x0eOPERATOR_EQUAL\x10\x01\x12\x16\n" +
1503
+ "\x12OPERATOR_NOT_EQUAL\x10\x02\x12\x19\n" +
1504
+ "\x15OPERATOR_GREATER_THAN\x10\x03\x12\x1f\n" +
1505
+ "\x1bOPERATOR_GREATER_THAN_EQUAL\x10\x04\x12\x16\n" +
1506
+ "\x12OPERATOR_LESS_THAN\x10\x05\x12\x1c\n" +
1507
+ "\x18OPERATOR_LESS_THAN_EQUAL\x10\x06\x12\x10\n" +
1508
+ "\fOPERATOR_AND\x10\a\x12\x0f\n" +
1509
+ "\vOPERATOR_OR\x10\b\x12\x1d\n" +
1510
+ "\x19OPERATOR_WITHIN_GEO_RANGE\x10\t\x12\x11\n" +
1511
+ "\rOPERATOR_LIKE\x10\n" +
1512
+ "\x12\x14\n" +
1513
+ "\x10OPERATOR_IS_NULL\x10\v\x12\x19\n" +
1514
+ "\x15OPERATOR_CONTAINS_ANY\x10\f\x12\x19\n" +
1515
+ "\x15OPERATOR_CONTAINS_ALL\x10\r\x12\x1a\n" +
1516
+ "\x16OPERATOR_CONTAINS_NONE\x10\x0e\x12\x10\n" +
1517
+ "\fOPERATOR_NOT\x10\x0fB\f\n" +
1518
+ "\n" +
1519
+ "test_value\"`\n" +
1520
+ "\x1bFilterReferenceSingleTarget\x12\x0e\n" +
1521
+ "\x02on\x18\x01 \x01(\tR\x02on\x121\n" +
1522
+ "\x06target\x18\x02 \x01(\v2\x19.weaviate.v1.FilterTargetR\x06target\"\x8c\x01\n" +
1523
+ "\x1aFilterReferenceMultiTarget\x12\x0e\n" +
1524
+ "\x02on\x18\x01 \x01(\tR\x02on\x121\n" +
1525
+ "\x06target\x18\x02 \x01(\v2\x19.weaviate.v1.FilterTargetR\x06target\x12+\n" +
1526
+ "\x11target_collection\x18\x03 \x01(\tR\x10targetCollection\"&\n" +
1527
+ "\x14FilterReferenceCount\x12\x0e\n" +
1528
+ "\x02on\x18\x01 \x01(\tR\x02on\"\x90\x02\n" +
1529
+ "\fFilterTarget\x12\x1c\n" +
1530
+ "\bproperty\x18\x01 \x01(\tH\x00R\bproperty\x12O\n" +
1531
+ "\rsingle_target\x18\x02 \x01(\v2(.weaviate.v1.FilterReferenceSingleTargetH\x00R\fsingleTarget\x12L\n" +
1532
+ "\fmulti_target\x18\x03 \x01(\v2'.weaviate.v1.FilterReferenceMultiTargetH\x00R\vmultiTarget\x129\n" +
1533
+ "\x05count\x18\x04 \x01(\v2!.weaviate.v1.FilterReferenceCountH\x00R\x05countB\b\n" +
1534
+ "\x06target\"l\n" +
1535
+ "\x14GeoCoordinatesFilter\x12\x1a\n" +
1536
+ "\blatitude\x18\x01 \x01(\x02R\blatitude\x12\x1c\n" +
1537
+ "\tlongitude\x18\x02 \x01(\x02R\tlongitude\x12\x1a\n" +
1538
+ "\bdistance\x18\x03 \x01(\x02R\bdistance\"\xf3\x01\n" +
1539
+ "\aVectors\x12\x12\n" +
1540
+ "\x04name\x18\x01 \x01(\tR\x04name\x12\x18\n" +
1541
+ "\x05index\x18\x02 \x01(\x04B\x02\x18\x01R\x05index\x12!\n" +
1542
+ "\fvector_bytes\x18\x03 \x01(\fR\vvectorBytes\x123\n" +
1543
+ "\x04type\x18\x04 \x01(\x0e2\x1f.weaviate.v1.Vectors.VectorTypeR\x04type\"b\n" +
1544
+ "\n" +
1545
+ "VectorType\x12\x1b\n" +
1546
+ "\x17VECTOR_TYPE_UNSPECIFIED\x10\x00\x12\x1b\n" +
1547
+ "\x17VECTOR_TYPE_SINGLE_FP32\x10\x01\x12\x1a\n" +
1548
+ "\x16VECTOR_TYPE_MULTI_FP32\x10\x02*\x89\x01\n" +
1549
+ "\x10ConsistencyLevel\x12!\n" +
1550
+ "\x1dCONSISTENCY_LEVEL_UNSPECIFIED\x10\x00\x12\x19\n" +
1551
+ "\x15CONSISTENCY_LEVEL_ONE\x10\x01\x12\x1c\n" +
1552
+ "\x18CONSISTENCY_LEVEL_QUORUM\x10\x02\x12\x19\n" +
1553
+ "\x15CONSISTENCY_LEVEL_ALL\x10\x03Bn\n" +
1554
+ "#io.weaviate.client.grpc.protocol.v1B\x11WeaviateProtoBaseZ4github.com/weaviate/weaviate/grpc/generated;protocolb\x06proto3"
1555
+
1556
+ var (
1557
+ file_v1_base_proto_rawDescOnce sync.Once
1558
+ file_v1_base_proto_rawDescData []byte
1559
+ )
1560
+
1561
+ func file_v1_base_proto_rawDescGZIP() []byte {
1562
+ file_v1_base_proto_rawDescOnce.Do(func() {
1563
+ file_v1_base_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_v1_base_proto_rawDesc), len(file_v1_base_proto_rawDesc)))
1564
+ })
1565
+ return file_v1_base_proto_rawDescData
1566
+ }
1567
+
1568
+ var file_v1_base_proto_enumTypes = make([]protoimpl.EnumInfo, 3)
1569
+ var file_v1_base_proto_msgTypes = make([]protoimpl.MessageInfo, 18)
1570
+ var file_v1_base_proto_goTypes = []any{
1571
+ (ConsistencyLevel)(0), // 0: weaviate.v1.ConsistencyLevel
1572
+ (Filters_Operator)(0), // 1: weaviate.v1.Filters.Operator
1573
+ (Vectors_VectorType)(0), // 2: weaviate.v1.Vectors.VectorType
1574
+ (*NumberArrayProperties)(nil), // 3: weaviate.v1.NumberArrayProperties
1575
+ (*IntArrayProperties)(nil), // 4: weaviate.v1.IntArrayProperties
1576
+ (*TextArrayProperties)(nil), // 5: weaviate.v1.TextArrayProperties
1577
+ (*BooleanArrayProperties)(nil), // 6: weaviate.v1.BooleanArrayProperties
1578
+ (*ObjectPropertiesValue)(nil), // 7: weaviate.v1.ObjectPropertiesValue
1579
+ (*ObjectArrayProperties)(nil), // 8: weaviate.v1.ObjectArrayProperties
1580
+ (*ObjectProperties)(nil), // 9: weaviate.v1.ObjectProperties
1581
+ (*TextArray)(nil), // 10: weaviate.v1.TextArray
1582
+ (*IntArray)(nil), // 11: weaviate.v1.IntArray
1583
+ (*NumberArray)(nil), // 12: weaviate.v1.NumberArray
1584
+ (*BooleanArray)(nil), // 13: weaviate.v1.BooleanArray
1585
+ (*Filters)(nil), // 14: weaviate.v1.Filters
1586
+ (*FilterReferenceSingleTarget)(nil), // 15: weaviate.v1.FilterReferenceSingleTarget
1587
+ (*FilterReferenceMultiTarget)(nil), // 16: weaviate.v1.FilterReferenceMultiTarget
1588
+ (*FilterReferenceCount)(nil), // 17: weaviate.v1.FilterReferenceCount
1589
+ (*FilterTarget)(nil), // 18: weaviate.v1.FilterTarget
1590
+ (*GeoCoordinatesFilter)(nil), // 19: weaviate.v1.GeoCoordinatesFilter
1591
+ (*Vectors)(nil), // 20: weaviate.v1.Vectors
1592
+ (*structpb.Struct)(nil), // 21: google.protobuf.Struct
1593
+ }
1594
+ var file_v1_base_proto_depIdxs = []int32{
1595
+ 21, // 0: weaviate.v1.ObjectPropertiesValue.non_ref_properties:type_name -> google.protobuf.Struct
1596
+ 3, // 1: weaviate.v1.ObjectPropertiesValue.number_array_properties:type_name -> weaviate.v1.NumberArrayProperties
1597
+ 4, // 2: weaviate.v1.ObjectPropertiesValue.int_array_properties:type_name -> weaviate.v1.IntArrayProperties
1598
+ 5, // 3: weaviate.v1.ObjectPropertiesValue.text_array_properties:type_name -> weaviate.v1.TextArrayProperties
1599
+ 6, // 4: weaviate.v1.ObjectPropertiesValue.boolean_array_properties:type_name -> weaviate.v1.BooleanArrayProperties
1600
+ 9, // 5: weaviate.v1.ObjectPropertiesValue.object_properties:type_name -> weaviate.v1.ObjectProperties
1601
+ 8, // 6: weaviate.v1.ObjectPropertiesValue.object_array_properties:type_name -> weaviate.v1.ObjectArrayProperties
1602
+ 7, // 7: weaviate.v1.ObjectArrayProperties.values:type_name -> weaviate.v1.ObjectPropertiesValue
1603
+ 7, // 8: weaviate.v1.ObjectProperties.value:type_name -> weaviate.v1.ObjectPropertiesValue
1604
+ 1, // 9: weaviate.v1.Filters.operator:type_name -> weaviate.v1.Filters.Operator
1605
+ 14, // 10: weaviate.v1.Filters.filters:type_name -> weaviate.v1.Filters
1606
+ 10, // 11: weaviate.v1.Filters.value_text_array:type_name -> weaviate.v1.TextArray
1607
+ 11, // 12: weaviate.v1.Filters.value_int_array:type_name -> weaviate.v1.IntArray
1608
+ 13, // 13: weaviate.v1.Filters.value_boolean_array:type_name -> weaviate.v1.BooleanArray
1609
+ 12, // 14: weaviate.v1.Filters.value_number_array:type_name -> weaviate.v1.NumberArray
1610
+ 19, // 15: weaviate.v1.Filters.value_geo:type_name -> weaviate.v1.GeoCoordinatesFilter
1611
+ 18, // 16: weaviate.v1.Filters.target:type_name -> weaviate.v1.FilterTarget
1612
+ 18, // 17: weaviate.v1.FilterReferenceSingleTarget.target:type_name -> weaviate.v1.FilterTarget
1613
+ 18, // 18: weaviate.v1.FilterReferenceMultiTarget.target:type_name -> weaviate.v1.FilterTarget
1614
+ 15, // 19: weaviate.v1.FilterTarget.single_target:type_name -> weaviate.v1.FilterReferenceSingleTarget
1615
+ 16, // 20: weaviate.v1.FilterTarget.multi_target:type_name -> weaviate.v1.FilterReferenceMultiTarget
1616
+ 17, // 21: weaviate.v1.FilterTarget.count:type_name -> weaviate.v1.FilterReferenceCount
1617
+ 2, // 22: weaviate.v1.Vectors.type:type_name -> weaviate.v1.Vectors.VectorType
1618
+ 23, // [23:23] is the sub-list for method output_type
1619
+ 23, // [23:23] is the sub-list for method input_type
1620
+ 23, // [23:23] is the sub-list for extension type_name
1621
+ 23, // [23:23] is the sub-list for extension extendee
1622
+ 0, // [0:23] is the sub-list for field type_name
1623
+ }
1624
+
1625
+ func init() { file_v1_base_proto_init() }
1626
+ func file_v1_base_proto_init() {
1627
+ if File_v1_base_proto != nil {
1628
+ return
1629
+ }
1630
+ file_v1_base_proto_msgTypes[11].OneofWrappers = []any{
1631
+ (*Filters_ValueText)(nil),
1632
+ (*Filters_ValueInt)(nil),
1633
+ (*Filters_ValueBoolean)(nil),
1634
+ (*Filters_ValueNumber)(nil),
1635
+ (*Filters_ValueTextArray)(nil),
1636
+ (*Filters_ValueIntArray)(nil),
1637
+ (*Filters_ValueBooleanArray)(nil),
1638
+ (*Filters_ValueNumberArray)(nil),
1639
+ (*Filters_ValueGeo)(nil),
1640
+ }
1641
+ file_v1_base_proto_msgTypes[15].OneofWrappers = []any{
1642
+ (*FilterTarget_Property)(nil),
1643
+ (*FilterTarget_SingleTarget)(nil),
1644
+ (*FilterTarget_MultiTarget)(nil),
1645
+ (*FilterTarget_Count)(nil),
1646
+ }
1647
+ type x struct{}
1648
+ out := protoimpl.TypeBuilder{
1649
+ File: protoimpl.DescBuilder{
1650
+ GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
1651
+ RawDescriptor: unsafe.Slice(unsafe.StringData(file_v1_base_proto_rawDesc), len(file_v1_base_proto_rawDesc)),
1652
+ NumEnums: 3,
1653
+ NumMessages: 18,
1654
+ NumExtensions: 0,
1655
+ NumServices: 0,
1656
+ },
1657
+ GoTypes: file_v1_base_proto_goTypes,
1658
+ DependencyIndexes: file_v1_base_proto_depIdxs,
1659
+ EnumInfos: file_v1_base_proto_enumTypes,
1660
+ MessageInfos: file_v1_base_proto_msgTypes,
1661
+ }.Build()
1662
+ File_v1_base_proto = out.File
1663
+ file_v1_base_proto_goTypes = nil
1664
+ file_v1_base_proto_depIdxs = nil
1665
+ }
platform/dbops/binaries/weaviate-src/grpc/generated/protocol/v1/base_search.pb.go ADDED
@@ -0,0 +1,1728 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Code generated by protoc-gen-go. DO NOT EDIT.
2
+
3
+ package protocol
4
+
5
+ import (
6
+ reflect "reflect"
7
+ sync "sync"
8
+ unsafe "unsafe"
9
+
10
+ protoreflect "google.golang.org/protobuf/reflect/protoreflect"
11
+ protoimpl "google.golang.org/protobuf/runtime/protoimpl"
12
+ )
13
+
14
+ const (
15
+ // Verify that this generated code is sufficiently up-to-date.
16
+ _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
17
+ // Verify that runtime/protoimpl is sufficiently up-to-date.
18
+ _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
19
+ )
20
+
21
+ type CombinationMethod int32
22
+
23
+ const (
24
+ CombinationMethod_COMBINATION_METHOD_UNSPECIFIED CombinationMethod = 0
25
+ CombinationMethod_COMBINATION_METHOD_TYPE_SUM CombinationMethod = 1
26
+ CombinationMethod_COMBINATION_METHOD_TYPE_MIN CombinationMethod = 2
27
+ CombinationMethod_COMBINATION_METHOD_TYPE_AVERAGE CombinationMethod = 3
28
+ CombinationMethod_COMBINATION_METHOD_TYPE_RELATIVE_SCORE CombinationMethod = 4
29
+ CombinationMethod_COMBINATION_METHOD_TYPE_MANUAL CombinationMethod = 5
30
+ )
31
+
32
+ // Enum value maps for CombinationMethod.
33
+ var (
34
+ CombinationMethod_name = map[int32]string{
35
+ 0: "COMBINATION_METHOD_UNSPECIFIED",
36
+ 1: "COMBINATION_METHOD_TYPE_SUM",
37
+ 2: "COMBINATION_METHOD_TYPE_MIN",
38
+ 3: "COMBINATION_METHOD_TYPE_AVERAGE",
39
+ 4: "COMBINATION_METHOD_TYPE_RELATIVE_SCORE",
40
+ 5: "COMBINATION_METHOD_TYPE_MANUAL",
41
+ }
42
+ CombinationMethod_value = map[string]int32{
43
+ "COMBINATION_METHOD_UNSPECIFIED": 0,
44
+ "COMBINATION_METHOD_TYPE_SUM": 1,
45
+ "COMBINATION_METHOD_TYPE_MIN": 2,
46
+ "COMBINATION_METHOD_TYPE_AVERAGE": 3,
47
+ "COMBINATION_METHOD_TYPE_RELATIVE_SCORE": 4,
48
+ "COMBINATION_METHOD_TYPE_MANUAL": 5,
49
+ }
50
+ )
51
+
52
+ func (x CombinationMethod) Enum() *CombinationMethod {
53
+ p := new(CombinationMethod)
54
+ *p = x
55
+ return p
56
+ }
57
+
58
+ func (x CombinationMethod) String() string {
59
+ return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
60
+ }
61
+
62
+ func (CombinationMethod) Descriptor() protoreflect.EnumDescriptor {
63
+ return file_v1_base_search_proto_enumTypes[0].Descriptor()
64
+ }
65
+
66
+ func (CombinationMethod) Type() protoreflect.EnumType {
67
+ return &file_v1_base_search_proto_enumTypes[0]
68
+ }
69
+
70
+ func (x CombinationMethod) Number() protoreflect.EnumNumber {
71
+ return protoreflect.EnumNumber(x)
72
+ }
73
+
74
+ // Deprecated: Use CombinationMethod.Descriptor instead.
75
+ func (CombinationMethod) EnumDescriptor() ([]byte, []int) {
76
+ return file_v1_base_search_proto_rawDescGZIP(), []int{0}
77
+ }
78
+
79
+ type SearchOperatorOptions_Operator int32
80
+
81
+ const (
82
+ SearchOperatorOptions_OPERATOR_UNSPECIFIED SearchOperatorOptions_Operator = 0
83
+ SearchOperatorOptions_OPERATOR_OR SearchOperatorOptions_Operator = 1
84
+ SearchOperatorOptions_OPERATOR_AND SearchOperatorOptions_Operator = 2
85
+ )
86
+
87
+ // Enum value maps for SearchOperatorOptions_Operator.
88
+ var (
89
+ SearchOperatorOptions_Operator_name = map[int32]string{
90
+ 0: "OPERATOR_UNSPECIFIED",
91
+ 1: "OPERATOR_OR",
92
+ 2: "OPERATOR_AND",
93
+ }
94
+ SearchOperatorOptions_Operator_value = map[string]int32{
95
+ "OPERATOR_UNSPECIFIED": 0,
96
+ "OPERATOR_OR": 1,
97
+ "OPERATOR_AND": 2,
98
+ }
99
+ )
100
+
101
+ func (x SearchOperatorOptions_Operator) Enum() *SearchOperatorOptions_Operator {
102
+ p := new(SearchOperatorOptions_Operator)
103
+ *p = x
104
+ return p
105
+ }
106
+
107
+ func (x SearchOperatorOptions_Operator) String() string {
108
+ return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
109
+ }
110
+
111
+ func (SearchOperatorOptions_Operator) Descriptor() protoreflect.EnumDescriptor {
112
+ return file_v1_base_search_proto_enumTypes[1].Descriptor()
113
+ }
114
+
115
+ func (SearchOperatorOptions_Operator) Type() protoreflect.EnumType {
116
+ return &file_v1_base_search_proto_enumTypes[1]
117
+ }
118
+
119
+ func (x SearchOperatorOptions_Operator) Number() protoreflect.EnumNumber {
120
+ return protoreflect.EnumNumber(x)
121
+ }
122
+
123
+ // Deprecated: Use SearchOperatorOptions_Operator.Descriptor instead.
124
+ func (SearchOperatorOptions_Operator) EnumDescriptor() ([]byte, []int) {
125
+ return file_v1_base_search_proto_rawDescGZIP(), []int{3, 0}
126
+ }
127
+
128
+ type Hybrid_FusionType int32
129
+
130
+ const (
131
+ Hybrid_FUSION_TYPE_UNSPECIFIED Hybrid_FusionType = 0
132
+ Hybrid_FUSION_TYPE_RANKED Hybrid_FusionType = 1
133
+ Hybrid_FUSION_TYPE_RELATIVE_SCORE Hybrid_FusionType = 2
134
+ )
135
+
136
+ // Enum value maps for Hybrid_FusionType.
137
+ var (
138
+ Hybrid_FusionType_name = map[int32]string{
139
+ 0: "FUSION_TYPE_UNSPECIFIED",
140
+ 1: "FUSION_TYPE_RANKED",
141
+ 2: "FUSION_TYPE_RELATIVE_SCORE",
142
+ }
143
+ Hybrid_FusionType_value = map[string]int32{
144
+ "FUSION_TYPE_UNSPECIFIED": 0,
145
+ "FUSION_TYPE_RANKED": 1,
146
+ "FUSION_TYPE_RELATIVE_SCORE": 2,
147
+ }
148
+ )
149
+
150
+ func (x Hybrid_FusionType) Enum() *Hybrid_FusionType {
151
+ p := new(Hybrid_FusionType)
152
+ *p = x
153
+ return p
154
+ }
155
+
156
+ func (x Hybrid_FusionType) String() string {
157
+ return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
158
+ }
159
+
160
+ func (Hybrid_FusionType) Descriptor() protoreflect.EnumDescriptor {
161
+ return file_v1_base_search_proto_enumTypes[2].Descriptor()
162
+ }
163
+
164
+ func (Hybrid_FusionType) Type() protoreflect.EnumType {
165
+ return &file_v1_base_search_proto_enumTypes[2]
166
+ }
167
+
168
+ func (x Hybrid_FusionType) Number() protoreflect.EnumNumber {
169
+ return protoreflect.EnumNumber(x)
170
+ }
171
+
172
+ // Deprecated: Use Hybrid_FusionType.Descriptor instead.
173
+ func (Hybrid_FusionType) EnumDescriptor() ([]byte, []int) {
174
+ return file_v1_base_search_proto_rawDescGZIP(), []int{4, 0}
175
+ }
176
+
177
+ type WeightsForTarget struct {
178
+ state protoimpl.MessageState `protogen:"open.v1"`
179
+ Target string `protobuf:"bytes,1,opt,name=target,proto3" json:"target,omitempty"`
180
+ Weight float32 `protobuf:"fixed32,2,opt,name=weight,proto3" json:"weight,omitempty"`
181
+ unknownFields protoimpl.UnknownFields
182
+ sizeCache protoimpl.SizeCache
183
+ }
184
+
185
+ func (x *WeightsForTarget) Reset() {
186
+ *x = WeightsForTarget{}
187
+ mi := &file_v1_base_search_proto_msgTypes[0]
188
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
189
+ ms.StoreMessageInfo(mi)
190
+ }
191
+
192
+ func (x *WeightsForTarget) String() string {
193
+ return protoimpl.X.MessageStringOf(x)
194
+ }
195
+
196
+ func (*WeightsForTarget) ProtoMessage() {}
197
+
198
+ func (x *WeightsForTarget) ProtoReflect() protoreflect.Message {
199
+ mi := &file_v1_base_search_proto_msgTypes[0]
200
+ if x != nil {
201
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
202
+ if ms.LoadMessageInfo() == nil {
203
+ ms.StoreMessageInfo(mi)
204
+ }
205
+ return ms
206
+ }
207
+ return mi.MessageOf(x)
208
+ }
209
+
210
+ // Deprecated: Use WeightsForTarget.ProtoReflect.Descriptor instead.
211
+ func (*WeightsForTarget) Descriptor() ([]byte, []int) {
212
+ return file_v1_base_search_proto_rawDescGZIP(), []int{0}
213
+ }
214
+
215
+ func (x *WeightsForTarget) GetTarget() string {
216
+ if x != nil {
217
+ return x.Target
218
+ }
219
+ return ""
220
+ }
221
+
222
+ func (x *WeightsForTarget) GetWeight() float32 {
223
+ if x != nil {
224
+ return x.Weight
225
+ }
226
+ return 0
227
+ }
228
+
229
+ type Targets struct {
230
+ state protoimpl.MessageState `protogen:"open.v1"`
231
+ TargetVectors []string `protobuf:"bytes,1,rep,name=target_vectors,json=targetVectors,proto3" json:"target_vectors,omitempty"`
232
+ Combination CombinationMethod `protobuf:"varint,2,opt,name=combination,proto3,enum=weaviate.v1.CombinationMethod" json:"combination,omitempty"`
233
+ WeightsForTargets []*WeightsForTarget `protobuf:"bytes,4,rep,name=weights_for_targets,json=weightsForTargets,proto3" json:"weights_for_targets,omitempty"`
234
+ unknownFields protoimpl.UnknownFields
235
+ sizeCache protoimpl.SizeCache
236
+ }
237
+
238
+ func (x *Targets) Reset() {
239
+ *x = Targets{}
240
+ mi := &file_v1_base_search_proto_msgTypes[1]
241
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
242
+ ms.StoreMessageInfo(mi)
243
+ }
244
+
245
+ func (x *Targets) String() string {
246
+ return protoimpl.X.MessageStringOf(x)
247
+ }
248
+
249
+ func (*Targets) ProtoMessage() {}
250
+
251
+ func (x *Targets) ProtoReflect() protoreflect.Message {
252
+ mi := &file_v1_base_search_proto_msgTypes[1]
253
+ if x != nil {
254
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
255
+ if ms.LoadMessageInfo() == nil {
256
+ ms.StoreMessageInfo(mi)
257
+ }
258
+ return ms
259
+ }
260
+ return mi.MessageOf(x)
261
+ }
262
+
263
+ // Deprecated: Use Targets.ProtoReflect.Descriptor instead.
264
+ func (*Targets) Descriptor() ([]byte, []int) {
265
+ return file_v1_base_search_proto_rawDescGZIP(), []int{1}
266
+ }
267
+
268
+ func (x *Targets) GetTargetVectors() []string {
269
+ if x != nil {
270
+ return x.TargetVectors
271
+ }
272
+ return nil
273
+ }
274
+
275
+ func (x *Targets) GetCombination() CombinationMethod {
276
+ if x != nil {
277
+ return x.Combination
278
+ }
279
+ return CombinationMethod_COMBINATION_METHOD_UNSPECIFIED
280
+ }
281
+
282
+ func (x *Targets) GetWeightsForTargets() []*WeightsForTarget {
283
+ if x != nil {
284
+ return x.WeightsForTargets
285
+ }
286
+ return nil
287
+ }
288
+
289
+ type VectorForTarget struct {
290
+ state protoimpl.MessageState `protogen:"open.v1"`
291
+ Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
292
+ // Deprecated: Marked as deprecated in v1/base_search.proto.
293
+ VectorBytes []byte `protobuf:"bytes,2,opt,name=vector_bytes,json=vectorBytes,proto3" json:"vector_bytes,omitempty"` // deprecated in 1.29.0 - use vectors
294
+ Vectors []*Vectors `protobuf:"bytes,3,rep,name=vectors,proto3" json:"vectors,omitempty"`
295
+ unknownFields protoimpl.UnknownFields
296
+ sizeCache protoimpl.SizeCache
297
+ }
298
+
299
+ func (x *VectorForTarget) Reset() {
300
+ *x = VectorForTarget{}
301
+ mi := &file_v1_base_search_proto_msgTypes[2]
302
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
303
+ ms.StoreMessageInfo(mi)
304
+ }
305
+
306
+ func (x *VectorForTarget) String() string {
307
+ return protoimpl.X.MessageStringOf(x)
308
+ }
309
+
310
+ func (*VectorForTarget) ProtoMessage() {}
311
+
312
+ func (x *VectorForTarget) ProtoReflect() protoreflect.Message {
313
+ mi := &file_v1_base_search_proto_msgTypes[2]
314
+ if x != nil {
315
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
316
+ if ms.LoadMessageInfo() == nil {
317
+ ms.StoreMessageInfo(mi)
318
+ }
319
+ return ms
320
+ }
321
+ return mi.MessageOf(x)
322
+ }
323
+
324
+ // Deprecated: Use VectorForTarget.ProtoReflect.Descriptor instead.
325
+ func (*VectorForTarget) Descriptor() ([]byte, []int) {
326
+ return file_v1_base_search_proto_rawDescGZIP(), []int{2}
327
+ }
328
+
329
+ func (x *VectorForTarget) GetName() string {
330
+ if x != nil {
331
+ return x.Name
332
+ }
333
+ return ""
334
+ }
335
+
336
+ // Deprecated: Marked as deprecated in v1/base_search.proto.
337
+ func (x *VectorForTarget) GetVectorBytes() []byte {
338
+ if x != nil {
339
+ return x.VectorBytes
340
+ }
341
+ return nil
342
+ }
343
+
344
+ func (x *VectorForTarget) GetVectors() []*Vectors {
345
+ if x != nil {
346
+ return x.Vectors
347
+ }
348
+ return nil
349
+ }
350
+
351
+ type SearchOperatorOptions struct {
352
+ state protoimpl.MessageState `protogen:"open.v1"`
353
+ Operator SearchOperatorOptions_Operator `protobuf:"varint,1,opt,name=operator,proto3,enum=weaviate.v1.SearchOperatorOptions_Operator" json:"operator,omitempty"`
354
+ MinimumOrTokensMatch *int32 `protobuf:"varint,2,opt,name=minimum_or_tokens_match,json=minimumOrTokensMatch,proto3,oneof" json:"minimum_or_tokens_match,omitempty"`
355
+ unknownFields protoimpl.UnknownFields
356
+ sizeCache protoimpl.SizeCache
357
+ }
358
+
359
+ func (x *SearchOperatorOptions) Reset() {
360
+ *x = SearchOperatorOptions{}
361
+ mi := &file_v1_base_search_proto_msgTypes[3]
362
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
363
+ ms.StoreMessageInfo(mi)
364
+ }
365
+
366
+ func (x *SearchOperatorOptions) String() string {
367
+ return protoimpl.X.MessageStringOf(x)
368
+ }
369
+
370
+ func (*SearchOperatorOptions) ProtoMessage() {}
371
+
372
+ func (x *SearchOperatorOptions) ProtoReflect() protoreflect.Message {
373
+ mi := &file_v1_base_search_proto_msgTypes[3]
374
+ if x != nil {
375
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
376
+ if ms.LoadMessageInfo() == nil {
377
+ ms.StoreMessageInfo(mi)
378
+ }
379
+ return ms
380
+ }
381
+ return mi.MessageOf(x)
382
+ }
383
+
384
+ // Deprecated: Use SearchOperatorOptions.ProtoReflect.Descriptor instead.
385
+ func (*SearchOperatorOptions) Descriptor() ([]byte, []int) {
386
+ return file_v1_base_search_proto_rawDescGZIP(), []int{3}
387
+ }
388
+
389
+ func (x *SearchOperatorOptions) GetOperator() SearchOperatorOptions_Operator {
390
+ if x != nil {
391
+ return x.Operator
392
+ }
393
+ return SearchOperatorOptions_OPERATOR_UNSPECIFIED
394
+ }
395
+
396
+ func (x *SearchOperatorOptions) GetMinimumOrTokensMatch() int32 {
397
+ if x != nil && x.MinimumOrTokensMatch != nil {
398
+ return *x.MinimumOrTokensMatch
399
+ }
400
+ return 0
401
+ }
402
+
403
+ type Hybrid struct {
404
+ state protoimpl.MessageState `protogen:"open.v1"`
405
+ Query string `protobuf:"bytes,1,opt,name=query,proto3" json:"query,omitempty"`
406
+ Properties []string `protobuf:"bytes,2,rep,name=properties,proto3" json:"properties,omitempty"`
407
+ // protolint:disable:next REPEATED_FIELD_NAMES_PLURALIZED
408
+ //
409
+ // Deprecated: Marked as deprecated in v1/base_search.proto.
410
+ Vector []float32 `protobuf:"fixed32,3,rep,packed,name=vector,proto3" json:"vector,omitempty"` // will be removed in the future, use vectors
411
+ Alpha float32 `protobuf:"fixed32,4,opt,name=alpha,proto3" json:"alpha,omitempty"`
412
+ FusionType Hybrid_FusionType `protobuf:"varint,5,opt,name=fusion_type,json=fusionType,proto3,enum=weaviate.v1.Hybrid_FusionType" json:"fusion_type,omitempty"`
413
+ // Deprecated: Marked as deprecated in v1/base_search.proto.
414
+ VectorBytes []byte `protobuf:"bytes,6,opt,name=vector_bytes,json=vectorBytes,proto3" json:"vector_bytes,omitempty"` // deprecated in 1.29.0 - use vectors
415
+ // Deprecated: Marked as deprecated in v1/base_search.proto.
416
+ TargetVectors []string `protobuf:"bytes,7,rep,name=target_vectors,json=targetVectors,proto3" json:"target_vectors,omitempty"` // deprecated in 1.26 - use targets
417
+ NearText *NearTextSearch `protobuf:"bytes,8,opt,name=near_text,json=nearText,proto3" json:"near_text,omitempty"` // targets in msg is ignored and should not be set for hybrid
418
+ NearVector *NearVector `protobuf:"bytes,9,opt,name=near_vector,json=nearVector,proto3" json:"near_vector,omitempty"` // same as above. Use the target vector in the hybrid message
419
+ Targets *Targets `protobuf:"bytes,10,opt,name=targets,proto3" json:"targets,omitempty"`
420
+ Bm25SearchOperator *SearchOperatorOptions `protobuf:"bytes,11,opt,name=bm25_search_operator,json=bm25SearchOperator,proto3,oneof" json:"bm25_search_operator,omitempty"`
421
+ // only vector distance, but keep it extendable
422
+ //
423
+ // Types that are valid to be assigned to Threshold:
424
+ //
425
+ // *Hybrid_VectorDistance
426
+ Threshold isHybrid_Threshold `protobuf_oneof:"threshold"`
427
+ Vectors []*Vectors `protobuf:"bytes,21,rep,name=vectors,proto3" json:"vectors,omitempty"`
428
+ unknownFields protoimpl.UnknownFields
429
+ sizeCache protoimpl.SizeCache
430
+ }
431
+
432
+ func (x *Hybrid) Reset() {
433
+ *x = Hybrid{}
434
+ mi := &file_v1_base_search_proto_msgTypes[4]
435
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
436
+ ms.StoreMessageInfo(mi)
437
+ }
438
+
439
+ func (x *Hybrid) String() string {
440
+ return protoimpl.X.MessageStringOf(x)
441
+ }
442
+
443
+ func (*Hybrid) ProtoMessage() {}
444
+
445
+ func (x *Hybrid) ProtoReflect() protoreflect.Message {
446
+ mi := &file_v1_base_search_proto_msgTypes[4]
447
+ if x != nil {
448
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
449
+ if ms.LoadMessageInfo() == nil {
450
+ ms.StoreMessageInfo(mi)
451
+ }
452
+ return ms
453
+ }
454
+ return mi.MessageOf(x)
455
+ }
456
+
457
+ // Deprecated: Use Hybrid.ProtoReflect.Descriptor instead.
458
+ func (*Hybrid) Descriptor() ([]byte, []int) {
459
+ return file_v1_base_search_proto_rawDescGZIP(), []int{4}
460
+ }
461
+
462
+ func (x *Hybrid) GetQuery() string {
463
+ if x != nil {
464
+ return x.Query
465
+ }
466
+ return ""
467
+ }
468
+
469
+ func (x *Hybrid) GetProperties() []string {
470
+ if x != nil {
471
+ return x.Properties
472
+ }
473
+ return nil
474
+ }
475
+
476
+ // Deprecated: Marked as deprecated in v1/base_search.proto.
477
+ func (x *Hybrid) GetVector() []float32 {
478
+ if x != nil {
479
+ return x.Vector
480
+ }
481
+ return nil
482
+ }
483
+
484
+ func (x *Hybrid) GetAlpha() float32 {
485
+ if x != nil {
486
+ return x.Alpha
487
+ }
488
+ return 0
489
+ }
490
+
491
+ func (x *Hybrid) GetFusionType() Hybrid_FusionType {
492
+ if x != nil {
493
+ return x.FusionType
494
+ }
495
+ return Hybrid_FUSION_TYPE_UNSPECIFIED
496
+ }
497
+
498
+ // Deprecated: Marked as deprecated in v1/base_search.proto.
499
+ func (x *Hybrid) GetVectorBytes() []byte {
500
+ if x != nil {
501
+ return x.VectorBytes
502
+ }
503
+ return nil
504
+ }
505
+
506
+ // Deprecated: Marked as deprecated in v1/base_search.proto.
507
+ func (x *Hybrid) GetTargetVectors() []string {
508
+ if x != nil {
509
+ return x.TargetVectors
510
+ }
511
+ return nil
512
+ }
513
+
514
+ func (x *Hybrid) GetNearText() *NearTextSearch {
515
+ if x != nil {
516
+ return x.NearText
517
+ }
518
+ return nil
519
+ }
520
+
521
+ func (x *Hybrid) GetNearVector() *NearVector {
522
+ if x != nil {
523
+ return x.NearVector
524
+ }
525
+ return nil
526
+ }
527
+
528
+ func (x *Hybrid) GetTargets() *Targets {
529
+ if x != nil {
530
+ return x.Targets
531
+ }
532
+ return nil
533
+ }
534
+
535
+ func (x *Hybrid) GetBm25SearchOperator() *SearchOperatorOptions {
536
+ if x != nil {
537
+ return x.Bm25SearchOperator
538
+ }
539
+ return nil
540
+ }
541
+
542
+ func (x *Hybrid) GetThreshold() isHybrid_Threshold {
543
+ if x != nil {
544
+ return x.Threshold
545
+ }
546
+ return nil
547
+ }
548
+
549
+ func (x *Hybrid) GetVectorDistance() float32 {
550
+ if x != nil {
551
+ if x, ok := x.Threshold.(*Hybrid_VectorDistance); ok {
552
+ return x.VectorDistance
553
+ }
554
+ }
555
+ return 0
556
+ }
557
+
558
+ func (x *Hybrid) GetVectors() []*Vectors {
559
+ if x != nil {
560
+ return x.Vectors
561
+ }
562
+ return nil
563
+ }
564
+
565
+ type isHybrid_Threshold interface {
566
+ isHybrid_Threshold()
567
+ }
568
+
569
+ type Hybrid_VectorDistance struct {
570
+ VectorDistance float32 `protobuf:"fixed32,20,opt,name=vector_distance,json=vectorDistance,proto3,oneof"`
571
+ }
572
+
573
+ func (*Hybrid_VectorDistance) isHybrid_Threshold() {}
574
+
575
+ type NearVector struct {
576
+ state protoimpl.MessageState `protogen:"open.v1"`
577
+ // protolint:disable:next REPEATED_FIELD_NAMES_PLURALIZED
578
+ //
579
+ // Deprecated: Marked as deprecated in v1/base_search.proto.
580
+ Vector []float32 `protobuf:"fixed32,1,rep,packed,name=vector,proto3" json:"vector,omitempty"` // will be removed in the future, use vectors
581
+ Certainty *float64 `protobuf:"fixed64,2,opt,name=certainty,proto3,oneof" json:"certainty,omitempty"`
582
+ Distance *float64 `protobuf:"fixed64,3,opt,name=distance,proto3,oneof" json:"distance,omitempty"`
583
+ // Deprecated: Marked as deprecated in v1/base_search.proto.
584
+ VectorBytes []byte `protobuf:"bytes,4,opt,name=vector_bytes,json=vectorBytes,proto3" json:"vector_bytes,omitempty"` // deprecated in 1.29.0 - use vectors
585
+ // Deprecated: Marked as deprecated in v1/base_search.proto.
586
+ TargetVectors []string `protobuf:"bytes,5,rep,name=target_vectors,json=targetVectors,proto3" json:"target_vectors,omitempty"` // deprecated in 1.26 - use targets
587
+ Targets *Targets `protobuf:"bytes,6,opt,name=targets,proto3" json:"targets,omitempty"`
588
+ // Deprecated: Marked as deprecated in v1/base_search.proto.
589
+ VectorPerTarget map[string][]byte `protobuf:"bytes,7,rep,name=vector_per_target,json=vectorPerTarget,proto3" json:"vector_per_target,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` // deprecated in 1.26.2 - use vector_for_targets
590
+ VectorForTargets []*VectorForTarget `protobuf:"bytes,8,rep,name=vector_for_targets,json=vectorForTargets,proto3" json:"vector_for_targets,omitempty"`
591
+ Vectors []*Vectors `protobuf:"bytes,9,rep,name=vectors,proto3" json:"vectors,omitempty"`
592
+ unknownFields protoimpl.UnknownFields
593
+ sizeCache protoimpl.SizeCache
594
+ }
595
+
596
+ func (x *NearVector) Reset() {
597
+ *x = NearVector{}
598
+ mi := &file_v1_base_search_proto_msgTypes[5]
599
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
600
+ ms.StoreMessageInfo(mi)
601
+ }
602
+
603
+ func (x *NearVector) String() string {
604
+ return protoimpl.X.MessageStringOf(x)
605
+ }
606
+
607
+ func (*NearVector) ProtoMessage() {}
608
+
609
+ func (x *NearVector) ProtoReflect() protoreflect.Message {
610
+ mi := &file_v1_base_search_proto_msgTypes[5]
611
+ if x != nil {
612
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
613
+ if ms.LoadMessageInfo() == nil {
614
+ ms.StoreMessageInfo(mi)
615
+ }
616
+ return ms
617
+ }
618
+ return mi.MessageOf(x)
619
+ }
620
+
621
+ // Deprecated: Use NearVector.ProtoReflect.Descriptor instead.
622
+ func (*NearVector) Descriptor() ([]byte, []int) {
623
+ return file_v1_base_search_proto_rawDescGZIP(), []int{5}
624
+ }
625
+
626
+ // Deprecated: Marked as deprecated in v1/base_search.proto.
627
+ func (x *NearVector) GetVector() []float32 {
628
+ if x != nil {
629
+ return x.Vector
630
+ }
631
+ return nil
632
+ }
633
+
634
+ func (x *NearVector) GetCertainty() float64 {
635
+ if x != nil && x.Certainty != nil {
636
+ return *x.Certainty
637
+ }
638
+ return 0
639
+ }
640
+
641
+ func (x *NearVector) GetDistance() float64 {
642
+ if x != nil && x.Distance != nil {
643
+ return *x.Distance
644
+ }
645
+ return 0
646
+ }
647
+
648
+ // Deprecated: Marked as deprecated in v1/base_search.proto.
649
+ func (x *NearVector) GetVectorBytes() []byte {
650
+ if x != nil {
651
+ return x.VectorBytes
652
+ }
653
+ return nil
654
+ }
655
+
656
+ // Deprecated: Marked as deprecated in v1/base_search.proto.
657
+ func (x *NearVector) GetTargetVectors() []string {
658
+ if x != nil {
659
+ return x.TargetVectors
660
+ }
661
+ return nil
662
+ }
663
+
664
+ func (x *NearVector) GetTargets() *Targets {
665
+ if x != nil {
666
+ return x.Targets
667
+ }
668
+ return nil
669
+ }
670
+
671
+ // Deprecated: Marked as deprecated in v1/base_search.proto.
672
+ func (x *NearVector) GetVectorPerTarget() map[string][]byte {
673
+ if x != nil {
674
+ return x.VectorPerTarget
675
+ }
676
+ return nil
677
+ }
678
+
679
+ func (x *NearVector) GetVectorForTargets() []*VectorForTarget {
680
+ if x != nil {
681
+ return x.VectorForTargets
682
+ }
683
+ return nil
684
+ }
685
+
686
+ func (x *NearVector) GetVectors() []*Vectors {
687
+ if x != nil {
688
+ return x.Vectors
689
+ }
690
+ return nil
691
+ }
692
+
693
+ type NearObject struct {
694
+ state protoimpl.MessageState `protogen:"open.v1"`
695
+ Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
696
+ Certainty *float64 `protobuf:"fixed64,2,opt,name=certainty,proto3,oneof" json:"certainty,omitempty"`
697
+ Distance *float64 `protobuf:"fixed64,3,opt,name=distance,proto3,oneof" json:"distance,omitempty"`
698
+ // Deprecated: Marked as deprecated in v1/base_search.proto.
699
+ TargetVectors []string `protobuf:"bytes,4,rep,name=target_vectors,json=targetVectors,proto3" json:"target_vectors,omitempty"` // deprecated in 1.26 - use targets
700
+ Targets *Targets `protobuf:"bytes,5,opt,name=targets,proto3" json:"targets,omitempty"`
701
+ unknownFields protoimpl.UnknownFields
702
+ sizeCache protoimpl.SizeCache
703
+ }
704
+
705
+ func (x *NearObject) Reset() {
706
+ *x = NearObject{}
707
+ mi := &file_v1_base_search_proto_msgTypes[6]
708
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
709
+ ms.StoreMessageInfo(mi)
710
+ }
711
+
712
+ func (x *NearObject) String() string {
713
+ return protoimpl.X.MessageStringOf(x)
714
+ }
715
+
716
+ func (*NearObject) ProtoMessage() {}
717
+
718
+ func (x *NearObject) ProtoReflect() protoreflect.Message {
719
+ mi := &file_v1_base_search_proto_msgTypes[6]
720
+ if x != nil {
721
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
722
+ if ms.LoadMessageInfo() == nil {
723
+ ms.StoreMessageInfo(mi)
724
+ }
725
+ return ms
726
+ }
727
+ return mi.MessageOf(x)
728
+ }
729
+
730
+ // Deprecated: Use NearObject.ProtoReflect.Descriptor instead.
731
+ func (*NearObject) Descriptor() ([]byte, []int) {
732
+ return file_v1_base_search_proto_rawDescGZIP(), []int{6}
733
+ }
734
+
735
+ func (x *NearObject) GetId() string {
736
+ if x != nil {
737
+ return x.Id
738
+ }
739
+ return ""
740
+ }
741
+
742
+ func (x *NearObject) GetCertainty() float64 {
743
+ if x != nil && x.Certainty != nil {
744
+ return *x.Certainty
745
+ }
746
+ return 0
747
+ }
748
+
749
+ func (x *NearObject) GetDistance() float64 {
750
+ if x != nil && x.Distance != nil {
751
+ return *x.Distance
752
+ }
753
+ return 0
754
+ }
755
+
756
+ // Deprecated: Marked as deprecated in v1/base_search.proto.
757
+ func (x *NearObject) GetTargetVectors() []string {
758
+ if x != nil {
759
+ return x.TargetVectors
760
+ }
761
+ return nil
762
+ }
763
+
764
+ func (x *NearObject) GetTargets() *Targets {
765
+ if x != nil {
766
+ return x.Targets
767
+ }
768
+ return nil
769
+ }
770
+
771
+ type NearTextSearch struct {
772
+ state protoimpl.MessageState `protogen:"open.v1"`
773
+ // protolint:disable:next REPEATED_FIELD_NAMES_PLURALIZED
774
+ Query []string `protobuf:"bytes,1,rep,name=query,proto3" json:"query,omitempty"`
775
+ Certainty *float64 `protobuf:"fixed64,2,opt,name=certainty,proto3,oneof" json:"certainty,omitempty"`
776
+ Distance *float64 `protobuf:"fixed64,3,opt,name=distance,proto3,oneof" json:"distance,omitempty"`
777
+ MoveTo *NearTextSearch_Move `protobuf:"bytes,4,opt,name=move_to,json=moveTo,proto3,oneof" json:"move_to,omitempty"`
778
+ MoveAway *NearTextSearch_Move `protobuf:"bytes,5,opt,name=move_away,json=moveAway,proto3,oneof" json:"move_away,omitempty"`
779
+ // Deprecated: Marked as deprecated in v1/base_search.proto.
780
+ TargetVectors []string `protobuf:"bytes,6,rep,name=target_vectors,json=targetVectors,proto3" json:"target_vectors,omitempty"` // deprecated in 1.26 - use targets
781
+ Targets *Targets `protobuf:"bytes,7,opt,name=targets,proto3" json:"targets,omitempty"`
782
+ unknownFields protoimpl.UnknownFields
783
+ sizeCache protoimpl.SizeCache
784
+ }
785
+
786
+ func (x *NearTextSearch) Reset() {
787
+ *x = NearTextSearch{}
788
+ mi := &file_v1_base_search_proto_msgTypes[7]
789
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
790
+ ms.StoreMessageInfo(mi)
791
+ }
792
+
793
+ func (x *NearTextSearch) String() string {
794
+ return protoimpl.X.MessageStringOf(x)
795
+ }
796
+
797
+ func (*NearTextSearch) ProtoMessage() {}
798
+
799
+ func (x *NearTextSearch) ProtoReflect() protoreflect.Message {
800
+ mi := &file_v1_base_search_proto_msgTypes[7]
801
+ if x != nil {
802
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
803
+ if ms.LoadMessageInfo() == nil {
804
+ ms.StoreMessageInfo(mi)
805
+ }
806
+ return ms
807
+ }
808
+ return mi.MessageOf(x)
809
+ }
810
+
811
+ // Deprecated: Use NearTextSearch.ProtoReflect.Descriptor instead.
812
+ func (*NearTextSearch) Descriptor() ([]byte, []int) {
813
+ return file_v1_base_search_proto_rawDescGZIP(), []int{7}
814
+ }
815
+
816
+ func (x *NearTextSearch) GetQuery() []string {
817
+ if x != nil {
818
+ return x.Query
819
+ }
820
+ return nil
821
+ }
822
+
823
+ func (x *NearTextSearch) GetCertainty() float64 {
824
+ if x != nil && x.Certainty != nil {
825
+ return *x.Certainty
826
+ }
827
+ return 0
828
+ }
829
+
830
+ func (x *NearTextSearch) GetDistance() float64 {
831
+ if x != nil && x.Distance != nil {
832
+ return *x.Distance
833
+ }
834
+ return 0
835
+ }
836
+
837
+ func (x *NearTextSearch) GetMoveTo() *NearTextSearch_Move {
838
+ if x != nil {
839
+ return x.MoveTo
840
+ }
841
+ return nil
842
+ }
843
+
844
+ func (x *NearTextSearch) GetMoveAway() *NearTextSearch_Move {
845
+ if x != nil {
846
+ return x.MoveAway
847
+ }
848
+ return nil
849
+ }
850
+
851
+ // Deprecated: Marked as deprecated in v1/base_search.proto.
852
+ func (x *NearTextSearch) GetTargetVectors() []string {
853
+ if x != nil {
854
+ return x.TargetVectors
855
+ }
856
+ return nil
857
+ }
858
+
859
+ func (x *NearTextSearch) GetTargets() *Targets {
860
+ if x != nil {
861
+ return x.Targets
862
+ }
863
+ return nil
864
+ }
865
+
866
+ type NearImageSearch struct {
867
+ state protoimpl.MessageState `protogen:"open.v1"`
868
+ Image string `protobuf:"bytes,1,opt,name=image,proto3" json:"image,omitempty"`
869
+ Certainty *float64 `protobuf:"fixed64,2,opt,name=certainty,proto3,oneof" json:"certainty,omitempty"`
870
+ Distance *float64 `protobuf:"fixed64,3,opt,name=distance,proto3,oneof" json:"distance,omitempty"`
871
+ // Deprecated: Marked as deprecated in v1/base_search.proto.
872
+ TargetVectors []string `protobuf:"bytes,4,rep,name=target_vectors,json=targetVectors,proto3" json:"target_vectors,omitempty"` // deprecated in 1.26 - use targets
873
+ Targets *Targets `protobuf:"bytes,5,opt,name=targets,proto3" json:"targets,omitempty"`
874
+ unknownFields protoimpl.UnknownFields
875
+ sizeCache protoimpl.SizeCache
876
+ }
877
+
878
+ func (x *NearImageSearch) Reset() {
879
+ *x = NearImageSearch{}
880
+ mi := &file_v1_base_search_proto_msgTypes[8]
881
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
882
+ ms.StoreMessageInfo(mi)
883
+ }
884
+
885
+ func (x *NearImageSearch) String() string {
886
+ return protoimpl.X.MessageStringOf(x)
887
+ }
888
+
889
+ func (*NearImageSearch) ProtoMessage() {}
890
+
891
+ func (x *NearImageSearch) ProtoReflect() protoreflect.Message {
892
+ mi := &file_v1_base_search_proto_msgTypes[8]
893
+ if x != nil {
894
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
895
+ if ms.LoadMessageInfo() == nil {
896
+ ms.StoreMessageInfo(mi)
897
+ }
898
+ return ms
899
+ }
900
+ return mi.MessageOf(x)
901
+ }
902
+
903
+ // Deprecated: Use NearImageSearch.ProtoReflect.Descriptor instead.
904
+ func (*NearImageSearch) Descriptor() ([]byte, []int) {
905
+ return file_v1_base_search_proto_rawDescGZIP(), []int{8}
906
+ }
907
+
908
+ func (x *NearImageSearch) GetImage() string {
909
+ if x != nil {
910
+ return x.Image
911
+ }
912
+ return ""
913
+ }
914
+
915
+ func (x *NearImageSearch) GetCertainty() float64 {
916
+ if x != nil && x.Certainty != nil {
917
+ return *x.Certainty
918
+ }
919
+ return 0
920
+ }
921
+
922
+ func (x *NearImageSearch) GetDistance() float64 {
923
+ if x != nil && x.Distance != nil {
924
+ return *x.Distance
925
+ }
926
+ return 0
927
+ }
928
+
929
+ // Deprecated: Marked as deprecated in v1/base_search.proto.
930
+ func (x *NearImageSearch) GetTargetVectors() []string {
931
+ if x != nil {
932
+ return x.TargetVectors
933
+ }
934
+ return nil
935
+ }
936
+
937
+ func (x *NearImageSearch) GetTargets() *Targets {
938
+ if x != nil {
939
+ return x.Targets
940
+ }
941
+ return nil
942
+ }
943
+
944
+ type NearAudioSearch struct {
945
+ state protoimpl.MessageState `protogen:"open.v1"`
946
+ Audio string `protobuf:"bytes,1,opt,name=audio,proto3" json:"audio,omitempty"`
947
+ Certainty *float64 `protobuf:"fixed64,2,opt,name=certainty,proto3,oneof" json:"certainty,omitempty"`
948
+ Distance *float64 `protobuf:"fixed64,3,opt,name=distance,proto3,oneof" json:"distance,omitempty"`
949
+ // Deprecated: Marked as deprecated in v1/base_search.proto.
950
+ TargetVectors []string `protobuf:"bytes,4,rep,name=target_vectors,json=targetVectors,proto3" json:"target_vectors,omitempty"` // deprecated in 1.26 - use targets
951
+ Targets *Targets `protobuf:"bytes,5,opt,name=targets,proto3" json:"targets,omitempty"`
952
+ unknownFields protoimpl.UnknownFields
953
+ sizeCache protoimpl.SizeCache
954
+ }
955
+
956
+ func (x *NearAudioSearch) Reset() {
957
+ *x = NearAudioSearch{}
958
+ mi := &file_v1_base_search_proto_msgTypes[9]
959
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
960
+ ms.StoreMessageInfo(mi)
961
+ }
962
+
963
+ func (x *NearAudioSearch) String() string {
964
+ return protoimpl.X.MessageStringOf(x)
965
+ }
966
+
967
+ func (*NearAudioSearch) ProtoMessage() {}
968
+
969
+ func (x *NearAudioSearch) ProtoReflect() protoreflect.Message {
970
+ mi := &file_v1_base_search_proto_msgTypes[9]
971
+ if x != nil {
972
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
973
+ if ms.LoadMessageInfo() == nil {
974
+ ms.StoreMessageInfo(mi)
975
+ }
976
+ return ms
977
+ }
978
+ return mi.MessageOf(x)
979
+ }
980
+
981
+ // Deprecated: Use NearAudioSearch.ProtoReflect.Descriptor instead.
982
+ func (*NearAudioSearch) Descriptor() ([]byte, []int) {
983
+ return file_v1_base_search_proto_rawDescGZIP(), []int{9}
984
+ }
985
+
986
+ func (x *NearAudioSearch) GetAudio() string {
987
+ if x != nil {
988
+ return x.Audio
989
+ }
990
+ return ""
991
+ }
992
+
993
+ func (x *NearAudioSearch) GetCertainty() float64 {
994
+ if x != nil && x.Certainty != nil {
995
+ return *x.Certainty
996
+ }
997
+ return 0
998
+ }
999
+
1000
+ func (x *NearAudioSearch) GetDistance() float64 {
1001
+ if x != nil && x.Distance != nil {
1002
+ return *x.Distance
1003
+ }
1004
+ return 0
1005
+ }
1006
+
1007
+ // Deprecated: Marked as deprecated in v1/base_search.proto.
1008
+ func (x *NearAudioSearch) GetTargetVectors() []string {
1009
+ if x != nil {
1010
+ return x.TargetVectors
1011
+ }
1012
+ return nil
1013
+ }
1014
+
1015
+ func (x *NearAudioSearch) GetTargets() *Targets {
1016
+ if x != nil {
1017
+ return x.Targets
1018
+ }
1019
+ return nil
1020
+ }
1021
+
1022
+ type NearVideoSearch struct {
1023
+ state protoimpl.MessageState `protogen:"open.v1"`
1024
+ Video string `protobuf:"bytes,1,opt,name=video,proto3" json:"video,omitempty"`
1025
+ Certainty *float64 `protobuf:"fixed64,2,opt,name=certainty,proto3,oneof" json:"certainty,omitempty"`
1026
+ Distance *float64 `protobuf:"fixed64,3,opt,name=distance,proto3,oneof" json:"distance,omitempty"`
1027
+ // Deprecated: Marked as deprecated in v1/base_search.proto.
1028
+ TargetVectors []string `protobuf:"bytes,4,rep,name=target_vectors,json=targetVectors,proto3" json:"target_vectors,omitempty"` // deprecated in 1.26 - use targets
1029
+ Targets *Targets `protobuf:"bytes,5,opt,name=targets,proto3" json:"targets,omitempty"`
1030
+ unknownFields protoimpl.UnknownFields
1031
+ sizeCache protoimpl.SizeCache
1032
+ }
1033
+
1034
+ func (x *NearVideoSearch) Reset() {
1035
+ *x = NearVideoSearch{}
1036
+ mi := &file_v1_base_search_proto_msgTypes[10]
1037
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
1038
+ ms.StoreMessageInfo(mi)
1039
+ }
1040
+
1041
+ func (x *NearVideoSearch) String() string {
1042
+ return protoimpl.X.MessageStringOf(x)
1043
+ }
1044
+
1045
+ func (*NearVideoSearch) ProtoMessage() {}
1046
+
1047
+ func (x *NearVideoSearch) ProtoReflect() protoreflect.Message {
1048
+ mi := &file_v1_base_search_proto_msgTypes[10]
1049
+ if x != nil {
1050
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
1051
+ if ms.LoadMessageInfo() == nil {
1052
+ ms.StoreMessageInfo(mi)
1053
+ }
1054
+ return ms
1055
+ }
1056
+ return mi.MessageOf(x)
1057
+ }
1058
+
1059
+ // Deprecated: Use NearVideoSearch.ProtoReflect.Descriptor instead.
1060
+ func (*NearVideoSearch) Descriptor() ([]byte, []int) {
1061
+ return file_v1_base_search_proto_rawDescGZIP(), []int{10}
1062
+ }
1063
+
1064
+ func (x *NearVideoSearch) GetVideo() string {
1065
+ if x != nil {
1066
+ return x.Video
1067
+ }
1068
+ return ""
1069
+ }
1070
+
1071
+ func (x *NearVideoSearch) GetCertainty() float64 {
1072
+ if x != nil && x.Certainty != nil {
1073
+ return *x.Certainty
1074
+ }
1075
+ return 0
1076
+ }
1077
+
1078
+ func (x *NearVideoSearch) GetDistance() float64 {
1079
+ if x != nil && x.Distance != nil {
1080
+ return *x.Distance
1081
+ }
1082
+ return 0
1083
+ }
1084
+
1085
+ // Deprecated: Marked as deprecated in v1/base_search.proto.
1086
+ func (x *NearVideoSearch) GetTargetVectors() []string {
1087
+ if x != nil {
1088
+ return x.TargetVectors
1089
+ }
1090
+ return nil
1091
+ }
1092
+
1093
+ func (x *NearVideoSearch) GetTargets() *Targets {
1094
+ if x != nil {
1095
+ return x.Targets
1096
+ }
1097
+ return nil
1098
+ }
1099
+
1100
+ type NearDepthSearch struct {
1101
+ state protoimpl.MessageState `protogen:"open.v1"`
1102
+ Depth string `protobuf:"bytes,1,opt,name=depth,proto3" json:"depth,omitempty"`
1103
+ Certainty *float64 `protobuf:"fixed64,2,opt,name=certainty,proto3,oneof" json:"certainty,omitempty"`
1104
+ Distance *float64 `protobuf:"fixed64,3,opt,name=distance,proto3,oneof" json:"distance,omitempty"`
1105
+ // Deprecated: Marked as deprecated in v1/base_search.proto.
1106
+ TargetVectors []string `protobuf:"bytes,4,rep,name=target_vectors,json=targetVectors,proto3" json:"target_vectors,omitempty"` // deprecated in 1.26 - use targets
1107
+ Targets *Targets `protobuf:"bytes,5,opt,name=targets,proto3" json:"targets,omitempty"`
1108
+ unknownFields protoimpl.UnknownFields
1109
+ sizeCache protoimpl.SizeCache
1110
+ }
1111
+
1112
+ func (x *NearDepthSearch) Reset() {
1113
+ *x = NearDepthSearch{}
1114
+ mi := &file_v1_base_search_proto_msgTypes[11]
1115
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
1116
+ ms.StoreMessageInfo(mi)
1117
+ }
1118
+
1119
+ func (x *NearDepthSearch) String() string {
1120
+ return protoimpl.X.MessageStringOf(x)
1121
+ }
1122
+
1123
+ func (*NearDepthSearch) ProtoMessage() {}
1124
+
1125
+ func (x *NearDepthSearch) ProtoReflect() protoreflect.Message {
1126
+ mi := &file_v1_base_search_proto_msgTypes[11]
1127
+ if x != nil {
1128
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
1129
+ if ms.LoadMessageInfo() == nil {
1130
+ ms.StoreMessageInfo(mi)
1131
+ }
1132
+ return ms
1133
+ }
1134
+ return mi.MessageOf(x)
1135
+ }
1136
+
1137
+ // Deprecated: Use NearDepthSearch.ProtoReflect.Descriptor instead.
1138
+ func (*NearDepthSearch) Descriptor() ([]byte, []int) {
1139
+ return file_v1_base_search_proto_rawDescGZIP(), []int{11}
1140
+ }
1141
+
1142
+ func (x *NearDepthSearch) GetDepth() string {
1143
+ if x != nil {
1144
+ return x.Depth
1145
+ }
1146
+ return ""
1147
+ }
1148
+
1149
+ func (x *NearDepthSearch) GetCertainty() float64 {
1150
+ if x != nil && x.Certainty != nil {
1151
+ return *x.Certainty
1152
+ }
1153
+ return 0
1154
+ }
1155
+
1156
+ func (x *NearDepthSearch) GetDistance() float64 {
1157
+ if x != nil && x.Distance != nil {
1158
+ return *x.Distance
1159
+ }
1160
+ return 0
1161
+ }
1162
+
1163
+ // Deprecated: Marked as deprecated in v1/base_search.proto.
1164
+ func (x *NearDepthSearch) GetTargetVectors() []string {
1165
+ if x != nil {
1166
+ return x.TargetVectors
1167
+ }
1168
+ return nil
1169
+ }
1170
+
1171
+ func (x *NearDepthSearch) GetTargets() *Targets {
1172
+ if x != nil {
1173
+ return x.Targets
1174
+ }
1175
+ return nil
1176
+ }
1177
+
1178
+ type NearThermalSearch struct {
1179
+ state protoimpl.MessageState `protogen:"open.v1"`
1180
+ Thermal string `protobuf:"bytes,1,opt,name=thermal,proto3" json:"thermal,omitempty"`
1181
+ Certainty *float64 `protobuf:"fixed64,2,opt,name=certainty,proto3,oneof" json:"certainty,omitempty"`
1182
+ Distance *float64 `protobuf:"fixed64,3,opt,name=distance,proto3,oneof" json:"distance,omitempty"`
1183
+ // Deprecated: Marked as deprecated in v1/base_search.proto.
1184
+ TargetVectors []string `protobuf:"bytes,4,rep,name=target_vectors,json=targetVectors,proto3" json:"target_vectors,omitempty"` // deprecated in 1.26 - use targets
1185
+ Targets *Targets `protobuf:"bytes,5,opt,name=targets,proto3" json:"targets,omitempty"`
1186
+ unknownFields protoimpl.UnknownFields
1187
+ sizeCache protoimpl.SizeCache
1188
+ }
1189
+
1190
+ func (x *NearThermalSearch) Reset() {
1191
+ *x = NearThermalSearch{}
1192
+ mi := &file_v1_base_search_proto_msgTypes[12]
1193
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
1194
+ ms.StoreMessageInfo(mi)
1195
+ }
1196
+
1197
+ func (x *NearThermalSearch) String() string {
1198
+ return protoimpl.X.MessageStringOf(x)
1199
+ }
1200
+
1201
+ func (*NearThermalSearch) ProtoMessage() {}
1202
+
1203
+ func (x *NearThermalSearch) ProtoReflect() protoreflect.Message {
1204
+ mi := &file_v1_base_search_proto_msgTypes[12]
1205
+ if x != nil {
1206
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
1207
+ if ms.LoadMessageInfo() == nil {
1208
+ ms.StoreMessageInfo(mi)
1209
+ }
1210
+ return ms
1211
+ }
1212
+ return mi.MessageOf(x)
1213
+ }
1214
+
1215
+ // Deprecated: Use NearThermalSearch.ProtoReflect.Descriptor instead.
1216
+ func (*NearThermalSearch) Descriptor() ([]byte, []int) {
1217
+ return file_v1_base_search_proto_rawDescGZIP(), []int{12}
1218
+ }
1219
+
1220
+ func (x *NearThermalSearch) GetThermal() string {
1221
+ if x != nil {
1222
+ return x.Thermal
1223
+ }
1224
+ return ""
1225
+ }
1226
+
1227
+ func (x *NearThermalSearch) GetCertainty() float64 {
1228
+ if x != nil && x.Certainty != nil {
1229
+ return *x.Certainty
1230
+ }
1231
+ return 0
1232
+ }
1233
+
1234
+ func (x *NearThermalSearch) GetDistance() float64 {
1235
+ if x != nil && x.Distance != nil {
1236
+ return *x.Distance
1237
+ }
1238
+ return 0
1239
+ }
1240
+
1241
+ // Deprecated: Marked as deprecated in v1/base_search.proto.
1242
+ func (x *NearThermalSearch) GetTargetVectors() []string {
1243
+ if x != nil {
1244
+ return x.TargetVectors
1245
+ }
1246
+ return nil
1247
+ }
1248
+
1249
+ func (x *NearThermalSearch) GetTargets() *Targets {
1250
+ if x != nil {
1251
+ return x.Targets
1252
+ }
1253
+ return nil
1254
+ }
1255
+
1256
+ type NearIMUSearch struct {
1257
+ state protoimpl.MessageState `protogen:"open.v1"`
1258
+ Imu string `protobuf:"bytes,1,opt,name=imu,proto3" json:"imu,omitempty"`
1259
+ Certainty *float64 `protobuf:"fixed64,2,opt,name=certainty,proto3,oneof" json:"certainty,omitempty"`
1260
+ Distance *float64 `protobuf:"fixed64,3,opt,name=distance,proto3,oneof" json:"distance,omitempty"`
1261
+ // Deprecated: Marked as deprecated in v1/base_search.proto.
1262
+ TargetVectors []string `protobuf:"bytes,4,rep,name=target_vectors,json=targetVectors,proto3" json:"target_vectors,omitempty"` // deprecated in 1.26 - use targets
1263
+ Targets *Targets `protobuf:"bytes,5,opt,name=targets,proto3" json:"targets,omitempty"`
1264
+ unknownFields protoimpl.UnknownFields
1265
+ sizeCache protoimpl.SizeCache
1266
+ }
1267
+
1268
+ func (x *NearIMUSearch) Reset() {
1269
+ *x = NearIMUSearch{}
1270
+ mi := &file_v1_base_search_proto_msgTypes[13]
1271
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
1272
+ ms.StoreMessageInfo(mi)
1273
+ }
1274
+
1275
+ func (x *NearIMUSearch) String() string {
1276
+ return protoimpl.X.MessageStringOf(x)
1277
+ }
1278
+
1279
+ func (*NearIMUSearch) ProtoMessage() {}
1280
+
1281
+ func (x *NearIMUSearch) ProtoReflect() protoreflect.Message {
1282
+ mi := &file_v1_base_search_proto_msgTypes[13]
1283
+ if x != nil {
1284
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
1285
+ if ms.LoadMessageInfo() == nil {
1286
+ ms.StoreMessageInfo(mi)
1287
+ }
1288
+ return ms
1289
+ }
1290
+ return mi.MessageOf(x)
1291
+ }
1292
+
1293
+ // Deprecated: Use NearIMUSearch.ProtoReflect.Descriptor instead.
1294
+ func (*NearIMUSearch) Descriptor() ([]byte, []int) {
1295
+ return file_v1_base_search_proto_rawDescGZIP(), []int{13}
1296
+ }
1297
+
1298
+ func (x *NearIMUSearch) GetImu() string {
1299
+ if x != nil {
1300
+ return x.Imu
1301
+ }
1302
+ return ""
1303
+ }
1304
+
1305
+ func (x *NearIMUSearch) GetCertainty() float64 {
1306
+ if x != nil && x.Certainty != nil {
1307
+ return *x.Certainty
1308
+ }
1309
+ return 0
1310
+ }
1311
+
1312
+ func (x *NearIMUSearch) GetDistance() float64 {
1313
+ if x != nil && x.Distance != nil {
1314
+ return *x.Distance
1315
+ }
1316
+ return 0
1317
+ }
1318
+
1319
+ // Deprecated: Marked as deprecated in v1/base_search.proto.
1320
+ func (x *NearIMUSearch) GetTargetVectors() []string {
1321
+ if x != nil {
1322
+ return x.TargetVectors
1323
+ }
1324
+ return nil
1325
+ }
1326
+
1327
+ func (x *NearIMUSearch) GetTargets() *Targets {
1328
+ if x != nil {
1329
+ return x.Targets
1330
+ }
1331
+ return nil
1332
+ }
1333
+
1334
+ type BM25 struct {
1335
+ state protoimpl.MessageState `protogen:"open.v1"`
1336
+ Query string `protobuf:"bytes,1,opt,name=query,proto3" json:"query,omitempty"`
1337
+ Properties []string `protobuf:"bytes,2,rep,name=properties,proto3" json:"properties,omitempty"`
1338
+ SearchOperator *SearchOperatorOptions `protobuf:"bytes,3,opt,name=search_operator,json=searchOperator,proto3,oneof" json:"search_operator,omitempty"`
1339
+ unknownFields protoimpl.UnknownFields
1340
+ sizeCache protoimpl.SizeCache
1341
+ }
1342
+
1343
+ func (x *BM25) Reset() {
1344
+ *x = BM25{}
1345
+ mi := &file_v1_base_search_proto_msgTypes[14]
1346
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
1347
+ ms.StoreMessageInfo(mi)
1348
+ }
1349
+
1350
+ func (x *BM25) String() string {
1351
+ return protoimpl.X.MessageStringOf(x)
1352
+ }
1353
+
1354
+ func (*BM25) ProtoMessage() {}
1355
+
1356
+ func (x *BM25) ProtoReflect() protoreflect.Message {
1357
+ mi := &file_v1_base_search_proto_msgTypes[14]
1358
+ if x != nil {
1359
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
1360
+ if ms.LoadMessageInfo() == nil {
1361
+ ms.StoreMessageInfo(mi)
1362
+ }
1363
+ return ms
1364
+ }
1365
+ return mi.MessageOf(x)
1366
+ }
1367
+
1368
+ // Deprecated: Use BM25.ProtoReflect.Descriptor instead.
1369
+ func (*BM25) Descriptor() ([]byte, []int) {
1370
+ return file_v1_base_search_proto_rawDescGZIP(), []int{14}
1371
+ }
1372
+
1373
+ func (x *BM25) GetQuery() string {
1374
+ if x != nil {
1375
+ return x.Query
1376
+ }
1377
+ return ""
1378
+ }
1379
+
1380
+ func (x *BM25) GetProperties() []string {
1381
+ if x != nil {
1382
+ return x.Properties
1383
+ }
1384
+ return nil
1385
+ }
1386
+
1387
+ func (x *BM25) GetSearchOperator() *SearchOperatorOptions {
1388
+ if x != nil {
1389
+ return x.SearchOperator
1390
+ }
1391
+ return nil
1392
+ }
1393
+
1394
+ type NearTextSearch_Move struct {
1395
+ state protoimpl.MessageState `protogen:"open.v1"`
1396
+ Force float32 `protobuf:"fixed32,1,opt,name=force,proto3" json:"force,omitempty"`
1397
+ Concepts []string `protobuf:"bytes,2,rep,name=concepts,proto3" json:"concepts,omitempty"`
1398
+ Uuids []string `protobuf:"bytes,3,rep,name=uuids,proto3" json:"uuids,omitempty"`
1399
+ unknownFields protoimpl.UnknownFields
1400
+ sizeCache protoimpl.SizeCache
1401
+ }
1402
+
1403
+ func (x *NearTextSearch_Move) Reset() {
1404
+ *x = NearTextSearch_Move{}
1405
+ mi := &file_v1_base_search_proto_msgTypes[16]
1406
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
1407
+ ms.StoreMessageInfo(mi)
1408
+ }
1409
+
1410
+ func (x *NearTextSearch_Move) String() string {
1411
+ return protoimpl.X.MessageStringOf(x)
1412
+ }
1413
+
1414
+ func (*NearTextSearch_Move) ProtoMessage() {}
1415
+
1416
+ func (x *NearTextSearch_Move) ProtoReflect() protoreflect.Message {
1417
+ mi := &file_v1_base_search_proto_msgTypes[16]
1418
+ if x != nil {
1419
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
1420
+ if ms.LoadMessageInfo() == nil {
1421
+ ms.StoreMessageInfo(mi)
1422
+ }
1423
+ return ms
1424
+ }
1425
+ return mi.MessageOf(x)
1426
+ }
1427
+
1428
+ // Deprecated: Use NearTextSearch_Move.ProtoReflect.Descriptor instead.
1429
+ func (*NearTextSearch_Move) Descriptor() ([]byte, []int) {
1430
+ return file_v1_base_search_proto_rawDescGZIP(), []int{7, 0}
1431
+ }
1432
+
1433
+ func (x *NearTextSearch_Move) GetForce() float32 {
1434
+ if x != nil {
1435
+ return x.Force
1436
+ }
1437
+ return 0
1438
+ }
1439
+
1440
+ func (x *NearTextSearch_Move) GetConcepts() []string {
1441
+ if x != nil {
1442
+ return x.Concepts
1443
+ }
1444
+ return nil
1445
+ }
1446
+
1447
+ func (x *NearTextSearch_Move) GetUuids() []string {
1448
+ if x != nil {
1449
+ return x.Uuids
1450
+ }
1451
+ return nil
1452
+ }
1453
+
1454
+ var File_v1_base_search_proto protoreflect.FileDescriptor
1455
+
1456
+ const file_v1_base_search_proto_rawDesc = "" +
1457
+ "\n" +
1458
+ "\x14v1/base_search.proto\x12\vweaviate.v1\x1a\rv1/base.proto\"B\n" +
1459
+ "\x10WeightsForTarget\x12\x16\n" +
1460
+ "\x06target\x18\x01 \x01(\tR\x06target\x12\x16\n" +
1461
+ "\x06weight\x18\x02 \x01(\x02R\x06weight\"\xc7\x01\n" +
1462
+ "\aTargets\x12%\n" +
1463
+ "\x0etarget_vectors\x18\x01 \x03(\tR\rtargetVectors\x12@\n" +
1464
+ "\vcombination\x18\x02 \x01(\x0e2\x1e.weaviate.v1.CombinationMethodR\vcombination\x12M\n" +
1465
+ "\x13weights_for_targets\x18\x04 \x03(\v2\x1d.weaviate.v1.WeightsForTargetR\x11weightsForTargetsJ\x04\b\x03\x10\x04\"|\n" +
1466
+ "\x0fVectorForTarget\x12\x12\n" +
1467
+ "\x04name\x18\x01 \x01(\tR\x04name\x12%\n" +
1468
+ "\fvector_bytes\x18\x02 \x01(\fB\x02\x18\x01R\vvectorBytes\x12.\n" +
1469
+ "\avectors\x18\x03 \x03(\v2\x14.weaviate.v1.VectorsR\avectors\"\x81\x02\n" +
1470
+ "\x15SearchOperatorOptions\x12G\n" +
1471
+ "\boperator\x18\x01 \x01(\x0e2+.weaviate.v1.SearchOperatorOptions.OperatorR\boperator\x12:\n" +
1472
+ "\x17minimum_or_tokens_match\x18\x02 \x01(\x05H\x00R\x14minimumOrTokensMatch\x88\x01\x01\"G\n" +
1473
+ "\bOperator\x12\x18\n" +
1474
+ "\x14OPERATOR_UNSPECIFIED\x10\x00\x12\x0f\n" +
1475
+ "\vOPERATOR_OR\x10\x01\x12\x10\n" +
1476
+ "\fOPERATOR_AND\x10\x02B\x1a\n" +
1477
+ "\x18_minimum_or_tokens_match\"\xe6\x05\n" +
1478
+ "\x06Hybrid\x12\x14\n" +
1479
+ "\x05query\x18\x01 \x01(\tR\x05query\x12\x1e\n" +
1480
+ "\n" +
1481
+ "properties\x18\x02 \x03(\tR\n" +
1482
+ "properties\x12\x1a\n" +
1483
+ "\x06vector\x18\x03 \x03(\x02B\x02\x18\x01R\x06vector\x12\x14\n" +
1484
+ "\x05alpha\x18\x04 \x01(\x02R\x05alpha\x12?\n" +
1485
+ "\vfusion_type\x18\x05 \x01(\x0e2\x1e.weaviate.v1.Hybrid.FusionTypeR\n" +
1486
+ "fusionType\x12%\n" +
1487
+ "\fvector_bytes\x18\x06 \x01(\fB\x02\x18\x01R\vvectorBytes\x12)\n" +
1488
+ "\x0etarget_vectors\x18\a \x03(\tB\x02\x18\x01R\rtargetVectors\x128\n" +
1489
+ "\tnear_text\x18\b \x01(\v2\x1b.weaviate.v1.NearTextSearchR\bnearText\x128\n" +
1490
+ "\vnear_vector\x18\t \x01(\v2\x17.weaviate.v1.NearVectorR\n" +
1491
+ "nearVector\x12.\n" +
1492
+ "\atargets\x18\n" +
1493
+ " \x01(\v2\x14.weaviate.v1.TargetsR\atargets\x12Y\n" +
1494
+ "\x14bm25_search_operator\x18\v \x01(\v2\".weaviate.v1.SearchOperatorOptionsH\x01R\x12bm25SearchOperator\x88\x01\x01\x12)\n" +
1495
+ "\x0fvector_distance\x18\x14 \x01(\x02H\x00R\x0evectorDistance\x12.\n" +
1496
+ "\avectors\x18\x15 \x03(\v2\x14.weaviate.v1.VectorsR\avectors\"a\n" +
1497
+ "\n" +
1498
+ "FusionType\x12\x1b\n" +
1499
+ "\x17FUSION_TYPE_UNSPECIFIED\x10\x00\x12\x16\n" +
1500
+ "\x12FUSION_TYPE_RANKED\x10\x01\x12\x1e\n" +
1501
+ "\x1aFUSION_TYPE_RELATIVE_SCORE\x10\x02B\v\n" +
1502
+ "\tthresholdB\x17\n" +
1503
+ "\x15_bm25_search_operator\"\xa7\x04\n" +
1504
+ "\n" +
1505
+ "NearVector\x12\x1a\n" +
1506
+ "\x06vector\x18\x01 \x03(\x02B\x02\x18\x01R\x06vector\x12!\n" +
1507
+ "\tcertainty\x18\x02 \x01(\x01H\x00R\tcertainty\x88\x01\x01\x12\x1f\n" +
1508
+ "\bdistance\x18\x03 \x01(\x01H\x01R\bdistance\x88\x01\x01\x12%\n" +
1509
+ "\fvector_bytes\x18\x04 \x01(\fB\x02\x18\x01R\vvectorBytes\x12)\n" +
1510
+ "\x0etarget_vectors\x18\x05 \x03(\tB\x02\x18\x01R\rtargetVectors\x12.\n" +
1511
+ "\atargets\x18\x06 \x01(\v2\x14.weaviate.v1.TargetsR\atargets\x12\\\n" +
1512
+ "\x11vector_per_target\x18\a \x03(\v2,.weaviate.v1.NearVector.VectorPerTargetEntryB\x02\x18\x01R\x0fvectorPerTarget\x12J\n" +
1513
+ "\x12vector_for_targets\x18\b \x03(\v2\x1c.weaviate.v1.VectorForTargetR\x10vectorForTargets\x12.\n" +
1514
+ "\avectors\x18\t \x03(\v2\x14.weaviate.v1.VectorsR\avectors\x1aB\n" +
1515
+ "\x14VectorPerTargetEntry\x12\x10\n" +
1516
+ "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" +
1517
+ "\x05value\x18\x02 \x01(\fR\x05value:\x028\x01B\f\n" +
1518
+ "\n" +
1519
+ "_certaintyB\v\n" +
1520
+ "\t_distance\"\xd6\x01\n" +
1521
+ "\n" +
1522
+ "NearObject\x12\x0e\n" +
1523
+ "\x02id\x18\x01 \x01(\tR\x02id\x12!\n" +
1524
+ "\tcertainty\x18\x02 \x01(\x01H\x00R\tcertainty\x88\x01\x01\x12\x1f\n" +
1525
+ "\bdistance\x18\x03 \x01(\x01H\x01R\bdistance\x88\x01\x01\x12)\n" +
1526
+ "\x0etarget_vectors\x18\x04 \x03(\tB\x02\x18\x01R\rtargetVectors\x12.\n" +
1527
+ "\atargets\x18\x05 \x01(\v2\x14.weaviate.v1.TargetsR\atargetsB\f\n" +
1528
+ "\n" +
1529
+ "_certaintyB\v\n" +
1530
+ "\t_distance\"\xce\x03\n" +
1531
+ "\x0eNearTextSearch\x12\x14\n" +
1532
+ "\x05query\x18\x01 \x03(\tR\x05query\x12!\n" +
1533
+ "\tcertainty\x18\x02 \x01(\x01H\x00R\tcertainty\x88\x01\x01\x12\x1f\n" +
1534
+ "\bdistance\x18\x03 \x01(\x01H\x01R\bdistance\x88\x01\x01\x12>\n" +
1535
+ "\amove_to\x18\x04 \x01(\v2 .weaviate.v1.NearTextSearch.MoveH\x02R\x06moveTo\x88\x01\x01\x12B\n" +
1536
+ "\tmove_away\x18\x05 \x01(\v2 .weaviate.v1.NearTextSearch.MoveH\x03R\bmoveAway\x88\x01\x01\x12)\n" +
1537
+ "\x0etarget_vectors\x18\x06 \x03(\tB\x02\x18\x01R\rtargetVectors\x12.\n" +
1538
+ "\atargets\x18\a \x01(\v2\x14.weaviate.v1.TargetsR\atargets\x1aN\n" +
1539
+ "\x04Move\x12\x14\n" +
1540
+ "\x05force\x18\x01 \x01(\x02R\x05force\x12\x1a\n" +
1541
+ "\bconcepts\x18\x02 \x03(\tR\bconcepts\x12\x14\n" +
1542
+ "\x05uuids\x18\x03 \x03(\tR\x05uuidsB\f\n" +
1543
+ "\n" +
1544
+ "_certaintyB\v\n" +
1545
+ "\t_distanceB\n" +
1546
+ "\n" +
1547
+ "\b_move_toB\f\n" +
1548
+ "\n" +
1549
+ "_move_away\"\xe1\x01\n" +
1550
+ "\x0fNearImageSearch\x12\x14\n" +
1551
+ "\x05image\x18\x01 \x01(\tR\x05image\x12!\n" +
1552
+ "\tcertainty\x18\x02 \x01(\x01H\x00R\tcertainty\x88\x01\x01\x12\x1f\n" +
1553
+ "\bdistance\x18\x03 \x01(\x01H\x01R\bdistance\x88\x01\x01\x12)\n" +
1554
+ "\x0etarget_vectors\x18\x04 \x03(\tB\x02\x18\x01R\rtargetVectors\x12.\n" +
1555
+ "\atargets\x18\x05 \x01(\v2\x14.weaviate.v1.TargetsR\atargetsB\f\n" +
1556
+ "\n" +
1557
+ "_certaintyB\v\n" +
1558
+ "\t_distance\"\xe1\x01\n" +
1559
+ "\x0fNearAudioSearch\x12\x14\n" +
1560
+ "\x05audio\x18\x01 \x01(\tR\x05audio\x12!\n" +
1561
+ "\tcertainty\x18\x02 \x01(\x01H\x00R\tcertainty\x88\x01\x01\x12\x1f\n" +
1562
+ "\bdistance\x18\x03 \x01(\x01H\x01R\bdistance\x88\x01\x01\x12)\n" +
1563
+ "\x0etarget_vectors\x18\x04 \x03(\tB\x02\x18\x01R\rtargetVectors\x12.\n" +
1564
+ "\atargets\x18\x05 \x01(\v2\x14.weaviate.v1.TargetsR\atargetsB\f\n" +
1565
+ "\n" +
1566
+ "_certaintyB\v\n" +
1567
+ "\t_distance\"\xe1\x01\n" +
1568
+ "\x0fNearVideoSearch\x12\x14\n" +
1569
+ "\x05video\x18\x01 \x01(\tR\x05video\x12!\n" +
1570
+ "\tcertainty\x18\x02 \x01(\x01H\x00R\tcertainty\x88\x01\x01\x12\x1f\n" +
1571
+ "\bdistance\x18\x03 \x01(\x01H\x01R\bdistance\x88\x01\x01\x12)\n" +
1572
+ "\x0etarget_vectors\x18\x04 \x03(\tB\x02\x18\x01R\rtargetVectors\x12.\n" +
1573
+ "\atargets\x18\x05 \x01(\v2\x14.weaviate.v1.TargetsR\atargetsB\f\n" +
1574
+ "\n" +
1575
+ "_certaintyB\v\n" +
1576
+ "\t_distance\"\xe1\x01\n" +
1577
+ "\x0fNearDepthSearch\x12\x14\n" +
1578
+ "\x05depth\x18\x01 \x01(\tR\x05depth\x12!\n" +
1579
+ "\tcertainty\x18\x02 \x01(\x01H\x00R\tcertainty\x88\x01\x01\x12\x1f\n" +
1580
+ "\bdistance\x18\x03 \x01(\x01H\x01R\bdistance\x88\x01\x01\x12)\n" +
1581
+ "\x0etarget_vectors\x18\x04 \x03(\tB\x02\x18\x01R\rtargetVectors\x12.\n" +
1582
+ "\atargets\x18\x05 \x01(\v2\x14.weaviate.v1.TargetsR\atargetsB\f\n" +
1583
+ "\n" +
1584
+ "_certaintyB\v\n" +
1585
+ "\t_distance\"\xe7\x01\n" +
1586
+ "\x11NearThermalSearch\x12\x18\n" +
1587
+ "\athermal\x18\x01 \x01(\tR\athermal\x12!\n" +
1588
+ "\tcertainty\x18\x02 \x01(\x01H\x00R\tcertainty\x88\x01\x01\x12\x1f\n" +
1589
+ "\bdistance\x18\x03 \x01(\x01H\x01R\bdistance\x88\x01\x01\x12)\n" +
1590
+ "\x0etarget_vectors\x18\x04 \x03(\tB\x02\x18\x01R\rtargetVectors\x12.\n" +
1591
+ "\atargets\x18\x05 \x01(\v2\x14.weaviate.v1.TargetsR\atargetsB\f\n" +
1592
+ "\n" +
1593
+ "_certaintyB\v\n" +
1594
+ "\t_distance\"\xdb\x01\n" +
1595
+ "\rNearIMUSearch\x12\x10\n" +
1596
+ "\x03imu\x18\x01 \x01(\tR\x03imu\x12!\n" +
1597
+ "\tcertainty\x18\x02 \x01(\x01H\x00R\tcertainty\x88\x01\x01\x12\x1f\n" +
1598
+ "\bdistance\x18\x03 \x01(\x01H\x01R\bdistance\x88\x01\x01\x12)\n" +
1599
+ "\x0etarget_vectors\x18\x04 \x03(\tB\x02\x18\x01R\rtargetVectors\x12.\n" +
1600
+ "\atargets\x18\x05 \x01(\v2\x14.weaviate.v1.TargetsR\atargetsB\f\n" +
1601
+ "\n" +
1602
+ "_certaintyB\v\n" +
1603
+ "\t_distance\"\xa2\x01\n" +
1604
+ "\x04BM25\x12\x14\n" +
1605
+ "\x05query\x18\x01 \x01(\tR\x05query\x12\x1e\n" +
1606
+ "\n" +
1607
+ "properties\x18\x02 \x03(\tR\n" +
1608
+ "properties\x12P\n" +
1609
+ "\x0fsearch_operator\x18\x03 \x01(\v2\".weaviate.v1.SearchOperatorOptionsH\x00R\x0esearchOperator\x88\x01\x01B\x12\n" +
1610
+ "\x10_search_operator*\xee\x01\n" +
1611
+ "\x11CombinationMethod\x12\"\n" +
1612
+ "\x1eCOMBINATION_METHOD_UNSPECIFIED\x10\x00\x12\x1f\n" +
1613
+ "\x1bCOMBINATION_METHOD_TYPE_SUM\x10\x01\x12\x1f\n" +
1614
+ "\x1bCOMBINATION_METHOD_TYPE_MIN\x10\x02\x12#\n" +
1615
+ "\x1fCOMBINATION_METHOD_TYPE_AVERAGE\x10\x03\x12*\n" +
1616
+ "&COMBINATION_METHOD_TYPE_RELATIVE_SCORE\x10\x04\x12\"\n" +
1617
+ "\x1eCOMBINATION_METHOD_TYPE_MANUAL\x10\x05Bt\n" +
1618
+ "#io.weaviate.client.grpc.protocol.v1B\x17WeaviateProtoBaseSearchZ4github.com/weaviate/weaviate/grpc/generated;protocolb\x06proto3"
1619
+
1620
+ var (
1621
+ file_v1_base_search_proto_rawDescOnce sync.Once
1622
+ file_v1_base_search_proto_rawDescData []byte
1623
+ )
1624
+
1625
+ func file_v1_base_search_proto_rawDescGZIP() []byte {
1626
+ file_v1_base_search_proto_rawDescOnce.Do(func() {
1627
+ file_v1_base_search_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_v1_base_search_proto_rawDesc), len(file_v1_base_search_proto_rawDesc)))
1628
+ })
1629
+ return file_v1_base_search_proto_rawDescData
1630
+ }
1631
+
1632
+ var file_v1_base_search_proto_enumTypes = make([]protoimpl.EnumInfo, 3)
1633
+ var file_v1_base_search_proto_msgTypes = make([]protoimpl.MessageInfo, 17)
1634
+ var file_v1_base_search_proto_goTypes = []any{
1635
+ (CombinationMethod)(0), // 0: weaviate.v1.CombinationMethod
1636
+ (SearchOperatorOptions_Operator)(0), // 1: weaviate.v1.SearchOperatorOptions.Operator
1637
+ (Hybrid_FusionType)(0), // 2: weaviate.v1.Hybrid.FusionType
1638
+ (*WeightsForTarget)(nil), // 3: weaviate.v1.WeightsForTarget
1639
+ (*Targets)(nil), // 4: weaviate.v1.Targets
1640
+ (*VectorForTarget)(nil), // 5: weaviate.v1.VectorForTarget
1641
+ (*SearchOperatorOptions)(nil), // 6: weaviate.v1.SearchOperatorOptions
1642
+ (*Hybrid)(nil), // 7: weaviate.v1.Hybrid
1643
+ (*NearVector)(nil), // 8: weaviate.v1.NearVector
1644
+ (*NearObject)(nil), // 9: weaviate.v1.NearObject
1645
+ (*NearTextSearch)(nil), // 10: weaviate.v1.NearTextSearch
1646
+ (*NearImageSearch)(nil), // 11: weaviate.v1.NearImageSearch
1647
+ (*NearAudioSearch)(nil), // 12: weaviate.v1.NearAudioSearch
1648
+ (*NearVideoSearch)(nil), // 13: weaviate.v1.NearVideoSearch
1649
+ (*NearDepthSearch)(nil), // 14: weaviate.v1.NearDepthSearch
1650
+ (*NearThermalSearch)(nil), // 15: weaviate.v1.NearThermalSearch
1651
+ (*NearIMUSearch)(nil), // 16: weaviate.v1.NearIMUSearch
1652
+ (*BM25)(nil), // 17: weaviate.v1.BM25
1653
+ nil, // 18: weaviate.v1.NearVector.VectorPerTargetEntry
1654
+ (*NearTextSearch_Move)(nil), // 19: weaviate.v1.NearTextSearch.Move
1655
+ (*Vectors)(nil), // 20: weaviate.v1.Vectors
1656
+ }
1657
+ var file_v1_base_search_proto_depIdxs = []int32{
1658
+ 0, // 0: weaviate.v1.Targets.combination:type_name -> weaviate.v1.CombinationMethod
1659
+ 3, // 1: weaviate.v1.Targets.weights_for_targets:type_name -> weaviate.v1.WeightsForTarget
1660
+ 20, // 2: weaviate.v1.VectorForTarget.vectors:type_name -> weaviate.v1.Vectors
1661
+ 1, // 3: weaviate.v1.SearchOperatorOptions.operator:type_name -> weaviate.v1.SearchOperatorOptions.Operator
1662
+ 2, // 4: weaviate.v1.Hybrid.fusion_type:type_name -> weaviate.v1.Hybrid.FusionType
1663
+ 10, // 5: weaviate.v1.Hybrid.near_text:type_name -> weaviate.v1.NearTextSearch
1664
+ 8, // 6: weaviate.v1.Hybrid.near_vector:type_name -> weaviate.v1.NearVector
1665
+ 4, // 7: weaviate.v1.Hybrid.targets:type_name -> weaviate.v1.Targets
1666
+ 6, // 8: weaviate.v1.Hybrid.bm25_search_operator:type_name -> weaviate.v1.SearchOperatorOptions
1667
+ 20, // 9: weaviate.v1.Hybrid.vectors:type_name -> weaviate.v1.Vectors
1668
+ 4, // 10: weaviate.v1.NearVector.targets:type_name -> weaviate.v1.Targets
1669
+ 18, // 11: weaviate.v1.NearVector.vector_per_target:type_name -> weaviate.v1.NearVector.VectorPerTargetEntry
1670
+ 5, // 12: weaviate.v1.NearVector.vector_for_targets:type_name -> weaviate.v1.VectorForTarget
1671
+ 20, // 13: weaviate.v1.NearVector.vectors:type_name -> weaviate.v1.Vectors
1672
+ 4, // 14: weaviate.v1.NearObject.targets:type_name -> weaviate.v1.Targets
1673
+ 19, // 15: weaviate.v1.NearTextSearch.move_to:type_name -> weaviate.v1.NearTextSearch.Move
1674
+ 19, // 16: weaviate.v1.NearTextSearch.move_away:type_name -> weaviate.v1.NearTextSearch.Move
1675
+ 4, // 17: weaviate.v1.NearTextSearch.targets:type_name -> weaviate.v1.Targets
1676
+ 4, // 18: weaviate.v1.NearImageSearch.targets:type_name -> weaviate.v1.Targets
1677
+ 4, // 19: weaviate.v1.NearAudioSearch.targets:type_name -> weaviate.v1.Targets
1678
+ 4, // 20: weaviate.v1.NearVideoSearch.targets:type_name -> weaviate.v1.Targets
1679
+ 4, // 21: weaviate.v1.NearDepthSearch.targets:type_name -> weaviate.v1.Targets
1680
+ 4, // 22: weaviate.v1.NearThermalSearch.targets:type_name -> weaviate.v1.Targets
1681
+ 4, // 23: weaviate.v1.NearIMUSearch.targets:type_name -> weaviate.v1.Targets
1682
+ 6, // 24: weaviate.v1.BM25.search_operator:type_name -> weaviate.v1.SearchOperatorOptions
1683
+ 25, // [25:25] is the sub-list for method output_type
1684
+ 25, // [25:25] is the sub-list for method input_type
1685
+ 25, // [25:25] is the sub-list for extension type_name
1686
+ 25, // [25:25] is the sub-list for extension extendee
1687
+ 0, // [0:25] is the sub-list for field type_name
1688
+ }
1689
+
1690
+ func init() { file_v1_base_search_proto_init() }
1691
+ func file_v1_base_search_proto_init() {
1692
+ if File_v1_base_search_proto != nil {
1693
+ return
1694
+ }
1695
+ file_v1_base_proto_init()
1696
+ file_v1_base_search_proto_msgTypes[3].OneofWrappers = []any{}
1697
+ file_v1_base_search_proto_msgTypes[4].OneofWrappers = []any{
1698
+ (*Hybrid_VectorDistance)(nil),
1699
+ }
1700
+ file_v1_base_search_proto_msgTypes[5].OneofWrappers = []any{}
1701
+ file_v1_base_search_proto_msgTypes[6].OneofWrappers = []any{}
1702
+ file_v1_base_search_proto_msgTypes[7].OneofWrappers = []any{}
1703
+ file_v1_base_search_proto_msgTypes[8].OneofWrappers = []any{}
1704
+ file_v1_base_search_proto_msgTypes[9].OneofWrappers = []any{}
1705
+ file_v1_base_search_proto_msgTypes[10].OneofWrappers = []any{}
1706
+ file_v1_base_search_proto_msgTypes[11].OneofWrappers = []any{}
1707
+ file_v1_base_search_proto_msgTypes[12].OneofWrappers = []any{}
1708
+ file_v1_base_search_proto_msgTypes[13].OneofWrappers = []any{}
1709
+ file_v1_base_search_proto_msgTypes[14].OneofWrappers = []any{}
1710
+ type x struct{}
1711
+ out := protoimpl.TypeBuilder{
1712
+ File: protoimpl.DescBuilder{
1713
+ GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
1714
+ RawDescriptor: unsafe.Slice(unsafe.StringData(file_v1_base_search_proto_rawDesc), len(file_v1_base_search_proto_rawDesc)),
1715
+ NumEnums: 3,
1716
+ NumMessages: 17,
1717
+ NumExtensions: 0,
1718
+ NumServices: 0,
1719
+ },
1720
+ GoTypes: file_v1_base_search_proto_goTypes,
1721
+ DependencyIndexes: file_v1_base_search_proto_depIdxs,
1722
+ EnumInfos: file_v1_base_search_proto_enumTypes,
1723
+ MessageInfos: file_v1_base_search_proto_msgTypes,
1724
+ }.Build()
1725
+ File_v1_base_search_proto = out.File
1726
+ file_v1_base_search_proto_goTypes = nil
1727
+ file_v1_base_search_proto_depIdxs = nil
1728
+ }
platform/dbops/binaries/weaviate-src/grpc/generated/protocol/v1/batch.pb.go ADDED
@@ -0,0 +1,1682 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Code generated by protoc-gen-go. DO NOT EDIT.
2
+
3
+ package protocol
4
+
5
+ import (
6
+ reflect "reflect"
7
+ sync "sync"
8
+ unsafe "unsafe"
9
+
10
+ protoreflect "google.golang.org/protobuf/reflect/protoreflect"
11
+ protoimpl "google.golang.org/protobuf/runtime/protoimpl"
12
+ structpb "google.golang.org/protobuf/types/known/structpb"
13
+ )
14
+
15
+ const (
16
+ // Verify that this generated code is sufficiently up-to-date.
17
+ _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
18
+ // Verify that runtime/protoimpl is sufficiently up-to-date.
19
+ _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
20
+ )
21
+
22
+ type BatchObjectsRequest struct {
23
+ state protoimpl.MessageState `protogen:"open.v1"`
24
+ Objects []*BatchObject `protobuf:"bytes,1,rep,name=objects,proto3" json:"objects,omitempty"`
25
+ ConsistencyLevel *ConsistencyLevel `protobuf:"varint,2,opt,name=consistency_level,json=consistencyLevel,proto3,enum=weaviate.v1.ConsistencyLevel,oneof" json:"consistency_level,omitempty"`
26
+ unknownFields protoimpl.UnknownFields
27
+ sizeCache protoimpl.SizeCache
28
+ }
29
+
30
+ func (x *BatchObjectsRequest) Reset() {
31
+ *x = BatchObjectsRequest{}
32
+ mi := &file_v1_batch_proto_msgTypes[0]
33
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
34
+ ms.StoreMessageInfo(mi)
35
+ }
36
+
37
+ func (x *BatchObjectsRequest) String() string {
38
+ return protoimpl.X.MessageStringOf(x)
39
+ }
40
+
41
+ func (*BatchObjectsRequest) ProtoMessage() {}
42
+
43
+ func (x *BatchObjectsRequest) ProtoReflect() protoreflect.Message {
44
+ mi := &file_v1_batch_proto_msgTypes[0]
45
+ if x != nil {
46
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
47
+ if ms.LoadMessageInfo() == nil {
48
+ ms.StoreMessageInfo(mi)
49
+ }
50
+ return ms
51
+ }
52
+ return mi.MessageOf(x)
53
+ }
54
+
55
+ // Deprecated: Use BatchObjectsRequest.ProtoReflect.Descriptor instead.
56
+ func (*BatchObjectsRequest) Descriptor() ([]byte, []int) {
57
+ return file_v1_batch_proto_rawDescGZIP(), []int{0}
58
+ }
59
+
60
+ func (x *BatchObjectsRequest) GetObjects() []*BatchObject {
61
+ if x != nil {
62
+ return x.Objects
63
+ }
64
+ return nil
65
+ }
66
+
67
+ func (x *BatchObjectsRequest) GetConsistencyLevel() ConsistencyLevel {
68
+ if x != nil && x.ConsistencyLevel != nil {
69
+ return *x.ConsistencyLevel
70
+ }
71
+ return ConsistencyLevel_CONSISTENCY_LEVEL_UNSPECIFIED
72
+ }
73
+
74
+ type BatchReferencesRequest struct {
75
+ state protoimpl.MessageState `protogen:"open.v1"`
76
+ References []*BatchReference `protobuf:"bytes,1,rep,name=references,proto3" json:"references,omitempty"`
77
+ ConsistencyLevel *ConsistencyLevel `protobuf:"varint,2,opt,name=consistency_level,json=consistencyLevel,proto3,enum=weaviate.v1.ConsistencyLevel,oneof" json:"consistency_level,omitempty"`
78
+ unknownFields protoimpl.UnknownFields
79
+ sizeCache protoimpl.SizeCache
80
+ }
81
+
82
+ func (x *BatchReferencesRequest) Reset() {
83
+ *x = BatchReferencesRequest{}
84
+ mi := &file_v1_batch_proto_msgTypes[1]
85
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
86
+ ms.StoreMessageInfo(mi)
87
+ }
88
+
89
+ func (x *BatchReferencesRequest) String() string {
90
+ return protoimpl.X.MessageStringOf(x)
91
+ }
92
+
93
+ func (*BatchReferencesRequest) ProtoMessage() {}
94
+
95
+ func (x *BatchReferencesRequest) ProtoReflect() protoreflect.Message {
96
+ mi := &file_v1_batch_proto_msgTypes[1]
97
+ if x != nil {
98
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
99
+ if ms.LoadMessageInfo() == nil {
100
+ ms.StoreMessageInfo(mi)
101
+ }
102
+ return ms
103
+ }
104
+ return mi.MessageOf(x)
105
+ }
106
+
107
+ // Deprecated: Use BatchReferencesRequest.ProtoReflect.Descriptor instead.
108
+ func (*BatchReferencesRequest) Descriptor() ([]byte, []int) {
109
+ return file_v1_batch_proto_rawDescGZIP(), []int{1}
110
+ }
111
+
112
+ func (x *BatchReferencesRequest) GetReferences() []*BatchReference {
113
+ if x != nil {
114
+ return x.References
115
+ }
116
+ return nil
117
+ }
118
+
119
+ func (x *BatchReferencesRequest) GetConsistencyLevel() ConsistencyLevel {
120
+ if x != nil && x.ConsistencyLevel != nil {
121
+ return *x.ConsistencyLevel
122
+ }
123
+ return ConsistencyLevel_CONSISTENCY_LEVEL_UNSPECIFIED
124
+ }
125
+
126
+ type BatchSendRequest struct {
127
+ state protoimpl.MessageState `protogen:"open.v1"`
128
+ StreamId string `protobuf:"bytes,1,opt,name=stream_id,json=streamId,proto3" json:"stream_id,omitempty"`
129
+ // Types that are valid to be assigned to Message:
130
+ //
131
+ // *BatchSendRequest_Objects_
132
+ // *BatchSendRequest_References_
133
+ // *BatchSendRequest_Stop_
134
+ Message isBatchSendRequest_Message `protobuf_oneof:"message"`
135
+ unknownFields protoimpl.UnknownFields
136
+ sizeCache protoimpl.SizeCache
137
+ }
138
+
139
+ func (x *BatchSendRequest) Reset() {
140
+ *x = BatchSendRequest{}
141
+ mi := &file_v1_batch_proto_msgTypes[2]
142
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
143
+ ms.StoreMessageInfo(mi)
144
+ }
145
+
146
+ func (x *BatchSendRequest) String() string {
147
+ return protoimpl.X.MessageStringOf(x)
148
+ }
149
+
150
+ func (*BatchSendRequest) ProtoMessage() {}
151
+
152
+ func (x *BatchSendRequest) ProtoReflect() protoreflect.Message {
153
+ mi := &file_v1_batch_proto_msgTypes[2]
154
+ if x != nil {
155
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
156
+ if ms.LoadMessageInfo() == nil {
157
+ ms.StoreMessageInfo(mi)
158
+ }
159
+ return ms
160
+ }
161
+ return mi.MessageOf(x)
162
+ }
163
+
164
+ // Deprecated: Use BatchSendRequest.ProtoReflect.Descriptor instead.
165
+ func (*BatchSendRequest) Descriptor() ([]byte, []int) {
166
+ return file_v1_batch_proto_rawDescGZIP(), []int{2}
167
+ }
168
+
169
+ func (x *BatchSendRequest) GetStreamId() string {
170
+ if x != nil {
171
+ return x.StreamId
172
+ }
173
+ return ""
174
+ }
175
+
176
+ func (x *BatchSendRequest) GetMessage() isBatchSendRequest_Message {
177
+ if x != nil {
178
+ return x.Message
179
+ }
180
+ return nil
181
+ }
182
+
183
+ func (x *BatchSendRequest) GetObjects() *BatchSendRequest_Objects {
184
+ if x != nil {
185
+ if x, ok := x.Message.(*BatchSendRequest_Objects_); ok {
186
+ return x.Objects
187
+ }
188
+ }
189
+ return nil
190
+ }
191
+
192
+ func (x *BatchSendRequest) GetReferences() *BatchSendRequest_References {
193
+ if x != nil {
194
+ if x, ok := x.Message.(*BatchSendRequest_References_); ok {
195
+ return x.References
196
+ }
197
+ }
198
+ return nil
199
+ }
200
+
201
+ func (x *BatchSendRequest) GetStop() *BatchSendRequest_Stop {
202
+ if x != nil {
203
+ if x, ok := x.Message.(*BatchSendRequest_Stop_); ok {
204
+ return x.Stop
205
+ }
206
+ }
207
+ return nil
208
+ }
209
+
210
+ type isBatchSendRequest_Message interface {
211
+ isBatchSendRequest_Message()
212
+ }
213
+
214
+ type BatchSendRequest_Objects_ struct {
215
+ Objects *BatchSendRequest_Objects `protobuf:"bytes,2,opt,name=objects,proto3,oneof"`
216
+ }
217
+
218
+ type BatchSendRequest_References_ struct {
219
+ References *BatchSendRequest_References `protobuf:"bytes,3,opt,name=references,proto3,oneof"`
220
+ }
221
+
222
+ type BatchSendRequest_Stop_ struct {
223
+ Stop *BatchSendRequest_Stop `protobuf:"bytes,4,opt,name=stop,proto3,oneof"`
224
+ }
225
+
226
+ func (*BatchSendRequest_Objects_) isBatchSendRequest_Message() {}
227
+
228
+ func (*BatchSendRequest_References_) isBatchSendRequest_Message() {}
229
+
230
+ func (*BatchSendRequest_Stop_) isBatchSendRequest_Message() {}
231
+
232
+ type BatchSendReply struct {
233
+ state protoimpl.MessageState `protogen:"open.v1"`
234
+ NextBatchSize int32 `protobuf:"varint,1,opt,name=next_batch_size,json=nextBatchSize,proto3" json:"next_batch_size,omitempty"`
235
+ BackoffSeconds float32 `protobuf:"fixed32,2,opt,name=backoff_seconds,json=backoffSeconds,proto3" json:"backoff_seconds,omitempty"`
236
+ unknownFields protoimpl.UnknownFields
237
+ sizeCache protoimpl.SizeCache
238
+ }
239
+
240
+ func (x *BatchSendReply) Reset() {
241
+ *x = BatchSendReply{}
242
+ mi := &file_v1_batch_proto_msgTypes[3]
243
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
244
+ ms.StoreMessageInfo(mi)
245
+ }
246
+
247
+ func (x *BatchSendReply) String() string {
248
+ return protoimpl.X.MessageStringOf(x)
249
+ }
250
+
251
+ func (*BatchSendReply) ProtoMessage() {}
252
+
253
+ func (x *BatchSendReply) ProtoReflect() protoreflect.Message {
254
+ mi := &file_v1_batch_proto_msgTypes[3]
255
+ if x != nil {
256
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
257
+ if ms.LoadMessageInfo() == nil {
258
+ ms.StoreMessageInfo(mi)
259
+ }
260
+ return ms
261
+ }
262
+ return mi.MessageOf(x)
263
+ }
264
+
265
+ // Deprecated: Use BatchSendReply.ProtoReflect.Descriptor instead.
266
+ func (*BatchSendReply) Descriptor() ([]byte, []int) {
267
+ return file_v1_batch_proto_rawDescGZIP(), []int{3}
268
+ }
269
+
270
+ func (x *BatchSendReply) GetNextBatchSize() int32 {
271
+ if x != nil {
272
+ return x.NextBatchSize
273
+ }
274
+ return 0
275
+ }
276
+
277
+ func (x *BatchSendReply) GetBackoffSeconds() float32 {
278
+ if x != nil {
279
+ return x.BackoffSeconds
280
+ }
281
+ return 0
282
+ }
283
+
284
+ type BatchStreamRequest struct {
285
+ state protoimpl.MessageState `protogen:"open.v1"`
286
+ ConsistencyLevel *ConsistencyLevel `protobuf:"varint,1,opt,name=consistency_level,json=consistencyLevel,proto3,enum=weaviate.v1.ConsistencyLevel,oneof" json:"consistency_level,omitempty"`
287
+ ObjectIndex *int32 `protobuf:"varint,2,opt,name=object_index,json=objectIndex,proto3,oneof" json:"object_index,omitempty"`
288
+ ReferenceIndex *int32 `protobuf:"varint,3,opt,name=reference_index,json=referenceIndex,proto3,oneof" json:"reference_index,omitempty"`
289
+ unknownFields protoimpl.UnknownFields
290
+ sizeCache protoimpl.SizeCache
291
+ }
292
+
293
+ func (x *BatchStreamRequest) Reset() {
294
+ *x = BatchStreamRequest{}
295
+ mi := &file_v1_batch_proto_msgTypes[4]
296
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
297
+ ms.StoreMessageInfo(mi)
298
+ }
299
+
300
+ func (x *BatchStreamRequest) String() string {
301
+ return protoimpl.X.MessageStringOf(x)
302
+ }
303
+
304
+ func (*BatchStreamRequest) ProtoMessage() {}
305
+
306
+ func (x *BatchStreamRequest) ProtoReflect() protoreflect.Message {
307
+ mi := &file_v1_batch_proto_msgTypes[4]
308
+ if x != nil {
309
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
310
+ if ms.LoadMessageInfo() == nil {
311
+ ms.StoreMessageInfo(mi)
312
+ }
313
+ return ms
314
+ }
315
+ return mi.MessageOf(x)
316
+ }
317
+
318
+ // Deprecated: Use BatchStreamRequest.ProtoReflect.Descriptor instead.
319
+ func (*BatchStreamRequest) Descriptor() ([]byte, []int) {
320
+ return file_v1_batch_proto_rawDescGZIP(), []int{4}
321
+ }
322
+
323
+ func (x *BatchStreamRequest) GetConsistencyLevel() ConsistencyLevel {
324
+ if x != nil && x.ConsistencyLevel != nil {
325
+ return *x.ConsistencyLevel
326
+ }
327
+ return ConsistencyLevel_CONSISTENCY_LEVEL_UNSPECIFIED
328
+ }
329
+
330
+ func (x *BatchStreamRequest) GetObjectIndex() int32 {
331
+ if x != nil && x.ObjectIndex != nil {
332
+ return *x.ObjectIndex
333
+ }
334
+ return 0
335
+ }
336
+
337
+ func (x *BatchStreamRequest) GetReferenceIndex() int32 {
338
+ if x != nil && x.ReferenceIndex != nil {
339
+ return *x.ReferenceIndex
340
+ }
341
+ return 0
342
+ }
343
+
344
+ type BatchStreamMessage struct {
345
+ state protoimpl.MessageState `protogen:"open.v1"`
346
+ StreamId string `protobuf:"bytes,1,opt,name=stream_id,json=streamId,proto3" json:"stream_id,omitempty"`
347
+ // Types that are valid to be assigned to Message:
348
+ //
349
+ // *BatchStreamMessage_Error_
350
+ // *BatchStreamMessage_Start_
351
+ // *BatchStreamMessage_Stop_
352
+ // *BatchStreamMessage_Shutdown_
353
+ // *BatchStreamMessage_ShuttingDown_
354
+ Message isBatchStreamMessage_Message `protobuf_oneof:"message"`
355
+ unknownFields protoimpl.UnknownFields
356
+ sizeCache protoimpl.SizeCache
357
+ }
358
+
359
+ func (x *BatchStreamMessage) Reset() {
360
+ *x = BatchStreamMessage{}
361
+ mi := &file_v1_batch_proto_msgTypes[5]
362
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
363
+ ms.StoreMessageInfo(mi)
364
+ }
365
+
366
+ func (x *BatchStreamMessage) String() string {
367
+ return protoimpl.X.MessageStringOf(x)
368
+ }
369
+
370
+ func (*BatchStreamMessage) ProtoMessage() {}
371
+
372
+ func (x *BatchStreamMessage) ProtoReflect() protoreflect.Message {
373
+ mi := &file_v1_batch_proto_msgTypes[5]
374
+ if x != nil {
375
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
376
+ if ms.LoadMessageInfo() == nil {
377
+ ms.StoreMessageInfo(mi)
378
+ }
379
+ return ms
380
+ }
381
+ return mi.MessageOf(x)
382
+ }
383
+
384
+ // Deprecated: Use BatchStreamMessage.ProtoReflect.Descriptor instead.
385
+ func (*BatchStreamMessage) Descriptor() ([]byte, []int) {
386
+ return file_v1_batch_proto_rawDescGZIP(), []int{5}
387
+ }
388
+
389
+ func (x *BatchStreamMessage) GetStreamId() string {
390
+ if x != nil {
391
+ return x.StreamId
392
+ }
393
+ return ""
394
+ }
395
+
396
+ func (x *BatchStreamMessage) GetMessage() isBatchStreamMessage_Message {
397
+ if x != nil {
398
+ return x.Message
399
+ }
400
+ return nil
401
+ }
402
+
403
+ func (x *BatchStreamMessage) GetError() *BatchStreamMessage_Error {
404
+ if x != nil {
405
+ if x, ok := x.Message.(*BatchStreamMessage_Error_); ok {
406
+ return x.Error
407
+ }
408
+ }
409
+ return nil
410
+ }
411
+
412
+ func (x *BatchStreamMessage) GetStart() *BatchStreamMessage_Start {
413
+ if x != nil {
414
+ if x, ok := x.Message.(*BatchStreamMessage_Start_); ok {
415
+ return x.Start
416
+ }
417
+ }
418
+ return nil
419
+ }
420
+
421
+ func (x *BatchStreamMessage) GetStop() *BatchStreamMessage_Stop {
422
+ if x != nil {
423
+ if x, ok := x.Message.(*BatchStreamMessage_Stop_); ok {
424
+ return x.Stop
425
+ }
426
+ }
427
+ return nil
428
+ }
429
+
430
+ func (x *BatchStreamMessage) GetShutdown() *BatchStreamMessage_Shutdown {
431
+ if x != nil {
432
+ if x, ok := x.Message.(*BatchStreamMessage_Shutdown_); ok {
433
+ return x.Shutdown
434
+ }
435
+ }
436
+ return nil
437
+ }
438
+
439
+ func (x *BatchStreamMessage) GetShuttingDown() *BatchStreamMessage_ShuttingDown {
440
+ if x != nil {
441
+ if x, ok := x.Message.(*BatchStreamMessage_ShuttingDown_); ok {
442
+ return x.ShuttingDown
443
+ }
444
+ }
445
+ return nil
446
+ }
447
+
448
+ type isBatchStreamMessage_Message interface {
449
+ isBatchStreamMessage_Message()
450
+ }
451
+
452
+ type BatchStreamMessage_Error_ struct {
453
+ Error *BatchStreamMessage_Error `protobuf:"bytes,2,opt,name=error,proto3,oneof"`
454
+ }
455
+
456
+ type BatchStreamMessage_Start_ struct {
457
+ Start *BatchStreamMessage_Start `protobuf:"bytes,3,opt,name=start,proto3,oneof"`
458
+ }
459
+
460
+ type BatchStreamMessage_Stop_ struct {
461
+ Stop *BatchStreamMessage_Stop `protobuf:"bytes,4,opt,name=stop,proto3,oneof"`
462
+ }
463
+
464
+ type BatchStreamMessage_Shutdown_ struct {
465
+ Shutdown *BatchStreamMessage_Shutdown `protobuf:"bytes,5,opt,name=shutdown,proto3,oneof"`
466
+ }
467
+
468
+ type BatchStreamMessage_ShuttingDown_ struct {
469
+ ShuttingDown *BatchStreamMessage_ShuttingDown `protobuf:"bytes,6,opt,name=shutting_down,json=shuttingDown,proto3,oneof"`
470
+ }
471
+
472
+ func (*BatchStreamMessage_Error_) isBatchStreamMessage_Message() {}
473
+
474
+ func (*BatchStreamMessage_Start_) isBatchStreamMessage_Message() {}
475
+
476
+ func (*BatchStreamMessage_Stop_) isBatchStreamMessage_Message() {}
477
+
478
+ func (*BatchStreamMessage_Shutdown_) isBatchStreamMessage_Message() {}
479
+
480
+ func (*BatchStreamMessage_ShuttingDown_) isBatchStreamMessage_Message() {}
481
+
482
+ type BatchObject struct {
483
+ state protoimpl.MessageState `protogen:"open.v1"`
484
+ Uuid string `protobuf:"bytes,1,opt,name=uuid,proto3" json:"uuid,omitempty"`
485
+ // protolint:disable:next REPEATED_FIELD_NAMES_PLURALIZED
486
+ //
487
+ // Deprecated: Marked as deprecated in v1/batch.proto.
488
+ Vector []float32 `protobuf:"fixed32,2,rep,packed,name=vector,proto3" json:"vector,omitempty"` // deprecated, will be removed
489
+ Properties *BatchObject_Properties `protobuf:"bytes,3,opt,name=properties,proto3" json:"properties,omitempty"`
490
+ Collection string `protobuf:"bytes,4,opt,name=collection,proto3" json:"collection,omitempty"`
491
+ Tenant string `protobuf:"bytes,5,opt,name=tenant,proto3" json:"tenant,omitempty"`
492
+ VectorBytes []byte `protobuf:"bytes,6,opt,name=vector_bytes,json=vectorBytes,proto3" json:"vector_bytes,omitempty"`
493
+ // protolint:disable:next REPEATED_FIELD_NAMES_PLURALIZED
494
+ Vectors []*Vectors `protobuf:"bytes,23,rep,name=vectors,proto3" json:"vectors,omitempty"`
495
+ unknownFields protoimpl.UnknownFields
496
+ sizeCache protoimpl.SizeCache
497
+ }
498
+
499
+ func (x *BatchObject) Reset() {
500
+ *x = BatchObject{}
501
+ mi := &file_v1_batch_proto_msgTypes[6]
502
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
503
+ ms.StoreMessageInfo(mi)
504
+ }
505
+
506
+ func (x *BatchObject) String() string {
507
+ return protoimpl.X.MessageStringOf(x)
508
+ }
509
+
510
+ func (*BatchObject) ProtoMessage() {}
511
+
512
+ func (x *BatchObject) ProtoReflect() protoreflect.Message {
513
+ mi := &file_v1_batch_proto_msgTypes[6]
514
+ if x != nil {
515
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
516
+ if ms.LoadMessageInfo() == nil {
517
+ ms.StoreMessageInfo(mi)
518
+ }
519
+ return ms
520
+ }
521
+ return mi.MessageOf(x)
522
+ }
523
+
524
+ // Deprecated: Use BatchObject.ProtoReflect.Descriptor instead.
525
+ func (*BatchObject) Descriptor() ([]byte, []int) {
526
+ return file_v1_batch_proto_rawDescGZIP(), []int{6}
527
+ }
528
+
529
+ func (x *BatchObject) GetUuid() string {
530
+ if x != nil {
531
+ return x.Uuid
532
+ }
533
+ return ""
534
+ }
535
+
536
+ // Deprecated: Marked as deprecated in v1/batch.proto.
537
+ func (x *BatchObject) GetVector() []float32 {
538
+ if x != nil {
539
+ return x.Vector
540
+ }
541
+ return nil
542
+ }
543
+
544
+ func (x *BatchObject) GetProperties() *BatchObject_Properties {
545
+ if x != nil {
546
+ return x.Properties
547
+ }
548
+ return nil
549
+ }
550
+
551
+ func (x *BatchObject) GetCollection() string {
552
+ if x != nil {
553
+ return x.Collection
554
+ }
555
+ return ""
556
+ }
557
+
558
+ func (x *BatchObject) GetTenant() string {
559
+ if x != nil {
560
+ return x.Tenant
561
+ }
562
+ return ""
563
+ }
564
+
565
+ func (x *BatchObject) GetVectorBytes() []byte {
566
+ if x != nil {
567
+ return x.VectorBytes
568
+ }
569
+ return nil
570
+ }
571
+
572
+ func (x *BatchObject) GetVectors() []*Vectors {
573
+ if x != nil {
574
+ return x.Vectors
575
+ }
576
+ return nil
577
+ }
578
+
579
+ type BatchReference struct {
580
+ state protoimpl.MessageState `protogen:"open.v1"`
581
+ Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
582
+ FromCollection string `protobuf:"bytes,2,opt,name=from_collection,json=fromCollection,proto3" json:"from_collection,omitempty"`
583
+ FromUuid string `protobuf:"bytes,3,opt,name=from_uuid,json=fromUuid,proto3" json:"from_uuid,omitempty"`
584
+ ToCollection *string `protobuf:"bytes,4,opt,name=to_collection,json=toCollection,proto3,oneof" json:"to_collection,omitempty"`
585
+ ToUuid string `protobuf:"bytes,5,opt,name=to_uuid,json=toUuid,proto3" json:"to_uuid,omitempty"`
586
+ Tenant string `protobuf:"bytes,6,opt,name=tenant,proto3" json:"tenant,omitempty"`
587
+ unknownFields protoimpl.UnknownFields
588
+ sizeCache protoimpl.SizeCache
589
+ }
590
+
591
+ func (x *BatchReference) Reset() {
592
+ *x = BatchReference{}
593
+ mi := &file_v1_batch_proto_msgTypes[7]
594
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
595
+ ms.StoreMessageInfo(mi)
596
+ }
597
+
598
+ func (x *BatchReference) String() string {
599
+ return protoimpl.X.MessageStringOf(x)
600
+ }
601
+
602
+ func (*BatchReference) ProtoMessage() {}
603
+
604
+ func (x *BatchReference) ProtoReflect() protoreflect.Message {
605
+ mi := &file_v1_batch_proto_msgTypes[7]
606
+ if x != nil {
607
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
608
+ if ms.LoadMessageInfo() == nil {
609
+ ms.StoreMessageInfo(mi)
610
+ }
611
+ return ms
612
+ }
613
+ return mi.MessageOf(x)
614
+ }
615
+
616
+ // Deprecated: Use BatchReference.ProtoReflect.Descriptor instead.
617
+ func (*BatchReference) Descriptor() ([]byte, []int) {
618
+ return file_v1_batch_proto_rawDescGZIP(), []int{7}
619
+ }
620
+
621
+ func (x *BatchReference) GetName() string {
622
+ if x != nil {
623
+ return x.Name
624
+ }
625
+ return ""
626
+ }
627
+
628
+ func (x *BatchReference) GetFromCollection() string {
629
+ if x != nil {
630
+ return x.FromCollection
631
+ }
632
+ return ""
633
+ }
634
+
635
+ func (x *BatchReference) GetFromUuid() string {
636
+ if x != nil {
637
+ return x.FromUuid
638
+ }
639
+ return ""
640
+ }
641
+
642
+ func (x *BatchReference) GetToCollection() string {
643
+ if x != nil && x.ToCollection != nil {
644
+ return *x.ToCollection
645
+ }
646
+ return ""
647
+ }
648
+
649
+ func (x *BatchReference) GetToUuid() string {
650
+ if x != nil {
651
+ return x.ToUuid
652
+ }
653
+ return ""
654
+ }
655
+
656
+ func (x *BatchReference) GetTenant() string {
657
+ if x != nil {
658
+ return x.Tenant
659
+ }
660
+ return ""
661
+ }
662
+
663
+ type BatchObjectsReply struct {
664
+ state protoimpl.MessageState `protogen:"open.v1"`
665
+ Took float32 `protobuf:"fixed32,1,opt,name=took,proto3" json:"took,omitempty"`
666
+ Errors []*BatchObjectsReply_BatchError `protobuf:"bytes,2,rep,name=errors,proto3" json:"errors,omitempty"`
667
+ unknownFields protoimpl.UnknownFields
668
+ sizeCache protoimpl.SizeCache
669
+ }
670
+
671
+ func (x *BatchObjectsReply) Reset() {
672
+ *x = BatchObjectsReply{}
673
+ mi := &file_v1_batch_proto_msgTypes[8]
674
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
675
+ ms.StoreMessageInfo(mi)
676
+ }
677
+
678
+ func (x *BatchObjectsReply) String() string {
679
+ return protoimpl.X.MessageStringOf(x)
680
+ }
681
+
682
+ func (*BatchObjectsReply) ProtoMessage() {}
683
+
684
+ func (x *BatchObjectsReply) ProtoReflect() protoreflect.Message {
685
+ mi := &file_v1_batch_proto_msgTypes[8]
686
+ if x != nil {
687
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
688
+ if ms.LoadMessageInfo() == nil {
689
+ ms.StoreMessageInfo(mi)
690
+ }
691
+ return ms
692
+ }
693
+ return mi.MessageOf(x)
694
+ }
695
+
696
+ // Deprecated: Use BatchObjectsReply.ProtoReflect.Descriptor instead.
697
+ func (*BatchObjectsReply) Descriptor() ([]byte, []int) {
698
+ return file_v1_batch_proto_rawDescGZIP(), []int{8}
699
+ }
700
+
701
+ func (x *BatchObjectsReply) GetTook() float32 {
702
+ if x != nil {
703
+ return x.Took
704
+ }
705
+ return 0
706
+ }
707
+
708
+ func (x *BatchObjectsReply) GetErrors() []*BatchObjectsReply_BatchError {
709
+ if x != nil {
710
+ return x.Errors
711
+ }
712
+ return nil
713
+ }
714
+
715
+ type BatchReferencesReply struct {
716
+ state protoimpl.MessageState `protogen:"open.v1"`
717
+ Took float32 `protobuf:"fixed32,1,opt,name=took,proto3" json:"took,omitempty"`
718
+ Errors []*BatchReferencesReply_BatchError `protobuf:"bytes,2,rep,name=errors,proto3" json:"errors,omitempty"`
719
+ unknownFields protoimpl.UnknownFields
720
+ sizeCache protoimpl.SizeCache
721
+ }
722
+
723
+ func (x *BatchReferencesReply) Reset() {
724
+ *x = BatchReferencesReply{}
725
+ mi := &file_v1_batch_proto_msgTypes[9]
726
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
727
+ ms.StoreMessageInfo(mi)
728
+ }
729
+
730
+ func (x *BatchReferencesReply) String() string {
731
+ return protoimpl.X.MessageStringOf(x)
732
+ }
733
+
734
+ func (*BatchReferencesReply) ProtoMessage() {}
735
+
736
+ func (x *BatchReferencesReply) ProtoReflect() protoreflect.Message {
737
+ mi := &file_v1_batch_proto_msgTypes[9]
738
+ if x != nil {
739
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
740
+ if ms.LoadMessageInfo() == nil {
741
+ ms.StoreMessageInfo(mi)
742
+ }
743
+ return ms
744
+ }
745
+ return mi.MessageOf(x)
746
+ }
747
+
748
+ // Deprecated: Use BatchReferencesReply.ProtoReflect.Descriptor instead.
749
+ func (*BatchReferencesReply) Descriptor() ([]byte, []int) {
750
+ return file_v1_batch_proto_rawDescGZIP(), []int{9}
751
+ }
752
+
753
+ func (x *BatchReferencesReply) GetTook() float32 {
754
+ if x != nil {
755
+ return x.Took
756
+ }
757
+ return 0
758
+ }
759
+
760
+ func (x *BatchReferencesReply) GetErrors() []*BatchReferencesReply_BatchError {
761
+ if x != nil {
762
+ return x.Errors
763
+ }
764
+ return nil
765
+ }
766
+
767
+ type BatchSendRequest_Stop struct {
768
+ state protoimpl.MessageState `protogen:"open.v1"`
769
+ unknownFields protoimpl.UnknownFields
770
+ sizeCache protoimpl.SizeCache
771
+ }
772
+
773
+ func (x *BatchSendRequest_Stop) Reset() {
774
+ *x = BatchSendRequest_Stop{}
775
+ mi := &file_v1_batch_proto_msgTypes[10]
776
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
777
+ ms.StoreMessageInfo(mi)
778
+ }
779
+
780
+ func (x *BatchSendRequest_Stop) String() string {
781
+ return protoimpl.X.MessageStringOf(x)
782
+ }
783
+
784
+ func (*BatchSendRequest_Stop) ProtoMessage() {}
785
+
786
+ func (x *BatchSendRequest_Stop) ProtoReflect() protoreflect.Message {
787
+ mi := &file_v1_batch_proto_msgTypes[10]
788
+ if x != nil {
789
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
790
+ if ms.LoadMessageInfo() == nil {
791
+ ms.StoreMessageInfo(mi)
792
+ }
793
+ return ms
794
+ }
795
+ return mi.MessageOf(x)
796
+ }
797
+
798
+ // Deprecated: Use BatchSendRequest_Stop.ProtoReflect.Descriptor instead.
799
+ func (*BatchSendRequest_Stop) Descriptor() ([]byte, []int) {
800
+ return file_v1_batch_proto_rawDescGZIP(), []int{2, 0}
801
+ }
802
+
803
+ type BatchSendRequest_Objects struct {
804
+ state protoimpl.MessageState `protogen:"open.v1"`
805
+ Values []*BatchObject `protobuf:"bytes,1,rep,name=values,proto3" json:"values,omitempty"`
806
+ unknownFields protoimpl.UnknownFields
807
+ sizeCache protoimpl.SizeCache
808
+ }
809
+
810
+ func (x *BatchSendRequest_Objects) Reset() {
811
+ *x = BatchSendRequest_Objects{}
812
+ mi := &file_v1_batch_proto_msgTypes[11]
813
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
814
+ ms.StoreMessageInfo(mi)
815
+ }
816
+
817
+ func (x *BatchSendRequest_Objects) String() string {
818
+ return protoimpl.X.MessageStringOf(x)
819
+ }
820
+
821
+ func (*BatchSendRequest_Objects) ProtoMessage() {}
822
+
823
+ func (x *BatchSendRequest_Objects) ProtoReflect() protoreflect.Message {
824
+ mi := &file_v1_batch_proto_msgTypes[11]
825
+ if x != nil {
826
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
827
+ if ms.LoadMessageInfo() == nil {
828
+ ms.StoreMessageInfo(mi)
829
+ }
830
+ return ms
831
+ }
832
+ return mi.MessageOf(x)
833
+ }
834
+
835
+ // Deprecated: Use BatchSendRequest_Objects.ProtoReflect.Descriptor instead.
836
+ func (*BatchSendRequest_Objects) Descriptor() ([]byte, []int) {
837
+ return file_v1_batch_proto_rawDescGZIP(), []int{2, 1}
838
+ }
839
+
840
+ func (x *BatchSendRequest_Objects) GetValues() []*BatchObject {
841
+ if x != nil {
842
+ return x.Values
843
+ }
844
+ return nil
845
+ }
846
+
847
+ type BatchSendRequest_References struct {
848
+ state protoimpl.MessageState `protogen:"open.v1"`
849
+ Values []*BatchReference `protobuf:"bytes,1,rep,name=values,proto3" json:"values,omitempty"`
850
+ unknownFields protoimpl.UnknownFields
851
+ sizeCache protoimpl.SizeCache
852
+ }
853
+
854
+ func (x *BatchSendRequest_References) Reset() {
855
+ *x = BatchSendRequest_References{}
856
+ mi := &file_v1_batch_proto_msgTypes[12]
857
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
858
+ ms.StoreMessageInfo(mi)
859
+ }
860
+
861
+ func (x *BatchSendRequest_References) String() string {
862
+ return protoimpl.X.MessageStringOf(x)
863
+ }
864
+
865
+ func (*BatchSendRequest_References) ProtoMessage() {}
866
+
867
+ func (x *BatchSendRequest_References) ProtoReflect() protoreflect.Message {
868
+ mi := &file_v1_batch_proto_msgTypes[12]
869
+ if x != nil {
870
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
871
+ if ms.LoadMessageInfo() == nil {
872
+ ms.StoreMessageInfo(mi)
873
+ }
874
+ return ms
875
+ }
876
+ return mi.MessageOf(x)
877
+ }
878
+
879
+ // Deprecated: Use BatchSendRequest_References.ProtoReflect.Descriptor instead.
880
+ func (*BatchSendRequest_References) Descriptor() ([]byte, []int) {
881
+ return file_v1_batch_proto_rawDescGZIP(), []int{2, 2}
882
+ }
883
+
884
+ func (x *BatchSendRequest_References) GetValues() []*BatchReference {
885
+ if x != nil {
886
+ return x.Values
887
+ }
888
+ return nil
889
+ }
890
+
891
+ type BatchStreamMessage_Start struct {
892
+ state protoimpl.MessageState `protogen:"open.v1"`
893
+ unknownFields protoimpl.UnknownFields
894
+ sizeCache protoimpl.SizeCache
895
+ }
896
+
897
+ func (x *BatchStreamMessage_Start) Reset() {
898
+ *x = BatchStreamMessage_Start{}
899
+ mi := &file_v1_batch_proto_msgTypes[13]
900
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
901
+ ms.StoreMessageInfo(mi)
902
+ }
903
+
904
+ func (x *BatchStreamMessage_Start) String() string {
905
+ return protoimpl.X.MessageStringOf(x)
906
+ }
907
+
908
+ func (*BatchStreamMessage_Start) ProtoMessage() {}
909
+
910
+ func (x *BatchStreamMessage_Start) ProtoReflect() protoreflect.Message {
911
+ mi := &file_v1_batch_proto_msgTypes[13]
912
+ if x != nil {
913
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
914
+ if ms.LoadMessageInfo() == nil {
915
+ ms.StoreMessageInfo(mi)
916
+ }
917
+ return ms
918
+ }
919
+ return mi.MessageOf(x)
920
+ }
921
+
922
+ // Deprecated: Use BatchStreamMessage_Start.ProtoReflect.Descriptor instead.
923
+ func (*BatchStreamMessage_Start) Descriptor() ([]byte, []int) {
924
+ return file_v1_batch_proto_rawDescGZIP(), []int{5, 0}
925
+ }
926
+
927
+ type BatchStreamMessage_Stop struct {
928
+ state protoimpl.MessageState `protogen:"open.v1"`
929
+ unknownFields protoimpl.UnknownFields
930
+ sizeCache protoimpl.SizeCache
931
+ }
932
+
933
+ func (x *BatchStreamMessage_Stop) Reset() {
934
+ *x = BatchStreamMessage_Stop{}
935
+ mi := &file_v1_batch_proto_msgTypes[14]
936
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
937
+ ms.StoreMessageInfo(mi)
938
+ }
939
+
940
+ func (x *BatchStreamMessage_Stop) String() string {
941
+ return protoimpl.X.MessageStringOf(x)
942
+ }
943
+
944
+ func (*BatchStreamMessage_Stop) ProtoMessage() {}
945
+
946
+ func (x *BatchStreamMessage_Stop) ProtoReflect() protoreflect.Message {
947
+ mi := &file_v1_batch_proto_msgTypes[14]
948
+ if x != nil {
949
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
950
+ if ms.LoadMessageInfo() == nil {
951
+ ms.StoreMessageInfo(mi)
952
+ }
953
+ return ms
954
+ }
955
+ return mi.MessageOf(x)
956
+ }
957
+
958
+ // Deprecated: Use BatchStreamMessage_Stop.ProtoReflect.Descriptor instead.
959
+ func (*BatchStreamMessage_Stop) Descriptor() ([]byte, []int) {
960
+ return file_v1_batch_proto_rawDescGZIP(), []int{5, 1}
961
+ }
962
+
963
+ type BatchStreamMessage_Shutdown struct {
964
+ state protoimpl.MessageState `protogen:"open.v1"`
965
+ unknownFields protoimpl.UnknownFields
966
+ sizeCache protoimpl.SizeCache
967
+ }
968
+
969
+ func (x *BatchStreamMessage_Shutdown) Reset() {
970
+ *x = BatchStreamMessage_Shutdown{}
971
+ mi := &file_v1_batch_proto_msgTypes[15]
972
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
973
+ ms.StoreMessageInfo(mi)
974
+ }
975
+
976
+ func (x *BatchStreamMessage_Shutdown) String() string {
977
+ return protoimpl.X.MessageStringOf(x)
978
+ }
979
+
980
+ func (*BatchStreamMessage_Shutdown) ProtoMessage() {}
981
+
982
+ func (x *BatchStreamMessage_Shutdown) ProtoReflect() protoreflect.Message {
983
+ mi := &file_v1_batch_proto_msgTypes[15]
984
+ if x != nil {
985
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
986
+ if ms.LoadMessageInfo() == nil {
987
+ ms.StoreMessageInfo(mi)
988
+ }
989
+ return ms
990
+ }
991
+ return mi.MessageOf(x)
992
+ }
993
+
994
+ // Deprecated: Use BatchStreamMessage_Shutdown.ProtoReflect.Descriptor instead.
995
+ func (*BatchStreamMessage_Shutdown) Descriptor() ([]byte, []int) {
996
+ return file_v1_batch_proto_rawDescGZIP(), []int{5, 2}
997
+ }
998
+
999
+ type BatchStreamMessage_ShuttingDown struct {
1000
+ state protoimpl.MessageState `protogen:"open.v1"`
1001
+ unknownFields protoimpl.UnknownFields
1002
+ sizeCache protoimpl.SizeCache
1003
+ }
1004
+
1005
+ func (x *BatchStreamMessage_ShuttingDown) Reset() {
1006
+ *x = BatchStreamMessage_ShuttingDown{}
1007
+ mi := &file_v1_batch_proto_msgTypes[16]
1008
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
1009
+ ms.StoreMessageInfo(mi)
1010
+ }
1011
+
1012
+ func (x *BatchStreamMessage_ShuttingDown) String() string {
1013
+ return protoimpl.X.MessageStringOf(x)
1014
+ }
1015
+
1016
+ func (*BatchStreamMessage_ShuttingDown) ProtoMessage() {}
1017
+
1018
+ func (x *BatchStreamMessage_ShuttingDown) ProtoReflect() protoreflect.Message {
1019
+ mi := &file_v1_batch_proto_msgTypes[16]
1020
+ if x != nil {
1021
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
1022
+ if ms.LoadMessageInfo() == nil {
1023
+ ms.StoreMessageInfo(mi)
1024
+ }
1025
+ return ms
1026
+ }
1027
+ return mi.MessageOf(x)
1028
+ }
1029
+
1030
+ // Deprecated: Use BatchStreamMessage_ShuttingDown.ProtoReflect.Descriptor instead.
1031
+ func (*BatchStreamMessage_ShuttingDown) Descriptor() ([]byte, []int) {
1032
+ return file_v1_batch_proto_rawDescGZIP(), []int{5, 3}
1033
+ }
1034
+
1035
+ type BatchStreamMessage_Error struct {
1036
+ state protoimpl.MessageState `protogen:"open.v1"`
1037
+ Error string `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"`
1038
+ Index int32 `protobuf:"varint,2,opt,name=index,proto3" json:"index,omitempty"`
1039
+ IsRetriable bool `protobuf:"varint,3,opt,name=is_retriable,json=isRetriable,proto3" json:"is_retriable,omitempty"`
1040
+ IsObject bool `protobuf:"varint,4,opt,name=is_object,json=isObject,proto3" json:"is_object,omitempty"`
1041
+ IsReference bool `protobuf:"varint,5,opt,name=is_reference,json=isReference,proto3" json:"is_reference,omitempty"`
1042
+ unknownFields protoimpl.UnknownFields
1043
+ sizeCache protoimpl.SizeCache
1044
+ }
1045
+
1046
+ func (x *BatchStreamMessage_Error) Reset() {
1047
+ *x = BatchStreamMessage_Error{}
1048
+ mi := &file_v1_batch_proto_msgTypes[17]
1049
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
1050
+ ms.StoreMessageInfo(mi)
1051
+ }
1052
+
1053
+ func (x *BatchStreamMessage_Error) String() string {
1054
+ return protoimpl.X.MessageStringOf(x)
1055
+ }
1056
+
1057
+ func (*BatchStreamMessage_Error) ProtoMessage() {}
1058
+
1059
+ func (x *BatchStreamMessage_Error) ProtoReflect() protoreflect.Message {
1060
+ mi := &file_v1_batch_proto_msgTypes[17]
1061
+ if x != nil {
1062
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
1063
+ if ms.LoadMessageInfo() == nil {
1064
+ ms.StoreMessageInfo(mi)
1065
+ }
1066
+ return ms
1067
+ }
1068
+ return mi.MessageOf(x)
1069
+ }
1070
+
1071
+ // Deprecated: Use BatchStreamMessage_Error.ProtoReflect.Descriptor instead.
1072
+ func (*BatchStreamMessage_Error) Descriptor() ([]byte, []int) {
1073
+ return file_v1_batch_proto_rawDescGZIP(), []int{5, 4}
1074
+ }
1075
+
1076
+ func (x *BatchStreamMessage_Error) GetError() string {
1077
+ if x != nil {
1078
+ return x.Error
1079
+ }
1080
+ return ""
1081
+ }
1082
+
1083
+ func (x *BatchStreamMessage_Error) GetIndex() int32 {
1084
+ if x != nil {
1085
+ return x.Index
1086
+ }
1087
+ return 0
1088
+ }
1089
+
1090
+ func (x *BatchStreamMessage_Error) GetIsRetriable() bool {
1091
+ if x != nil {
1092
+ return x.IsRetriable
1093
+ }
1094
+ return false
1095
+ }
1096
+
1097
+ func (x *BatchStreamMessage_Error) GetIsObject() bool {
1098
+ if x != nil {
1099
+ return x.IsObject
1100
+ }
1101
+ return false
1102
+ }
1103
+
1104
+ func (x *BatchStreamMessage_Error) GetIsReference() bool {
1105
+ if x != nil {
1106
+ return x.IsReference
1107
+ }
1108
+ return false
1109
+ }
1110
+
1111
+ type BatchObject_Properties struct {
1112
+ state protoimpl.MessageState `protogen:"open.v1"`
1113
+ NonRefProperties *structpb.Struct `protobuf:"bytes,1,opt,name=non_ref_properties,json=nonRefProperties,proto3" json:"non_ref_properties,omitempty"`
1114
+ SingleTargetRefProps []*BatchObject_SingleTargetRefProps `protobuf:"bytes,2,rep,name=single_target_ref_props,json=singleTargetRefProps,proto3" json:"single_target_ref_props,omitempty"`
1115
+ MultiTargetRefProps []*BatchObject_MultiTargetRefProps `protobuf:"bytes,3,rep,name=multi_target_ref_props,json=multiTargetRefProps,proto3" json:"multi_target_ref_props,omitempty"`
1116
+ NumberArrayProperties []*NumberArrayProperties `protobuf:"bytes,4,rep,name=number_array_properties,json=numberArrayProperties,proto3" json:"number_array_properties,omitempty"`
1117
+ IntArrayProperties []*IntArrayProperties `protobuf:"bytes,5,rep,name=int_array_properties,json=intArrayProperties,proto3" json:"int_array_properties,omitempty"`
1118
+ TextArrayProperties []*TextArrayProperties `protobuf:"bytes,6,rep,name=text_array_properties,json=textArrayProperties,proto3" json:"text_array_properties,omitempty"`
1119
+ BooleanArrayProperties []*BooleanArrayProperties `protobuf:"bytes,7,rep,name=boolean_array_properties,json=booleanArrayProperties,proto3" json:"boolean_array_properties,omitempty"`
1120
+ ObjectProperties []*ObjectProperties `protobuf:"bytes,8,rep,name=object_properties,json=objectProperties,proto3" json:"object_properties,omitempty"`
1121
+ ObjectArrayProperties []*ObjectArrayProperties `protobuf:"bytes,9,rep,name=object_array_properties,json=objectArrayProperties,proto3" json:"object_array_properties,omitempty"`
1122
+ // empty lists do not have a type in many languages and clients do not know which datatype the property has.
1123
+ // Weaviate can get the datatype from its schema
1124
+ EmptyListProps []string `protobuf:"bytes,10,rep,name=empty_list_props,json=emptyListProps,proto3" json:"empty_list_props,omitempty"`
1125
+ unknownFields protoimpl.UnknownFields
1126
+ sizeCache protoimpl.SizeCache
1127
+ }
1128
+
1129
+ func (x *BatchObject_Properties) Reset() {
1130
+ *x = BatchObject_Properties{}
1131
+ mi := &file_v1_batch_proto_msgTypes[18]
1132
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
1133
+ ms.StoreMessageInfo(mi)
1134
+ }
1135
+
1136
+ func (x *BatchObject_Properties) String() string {
1137
+ return protoimpl.X.MessageStringOf(x)
1138
+ }
1139
+
1140
+ func (*BatchObject_Properties) ProtoMessage() {}
1141
+
1142
+ func (x *BatchObject_Properties) ProtoReflect() protoreflect.Message {
1143
+ mi := &file_v1_batch_proto_msgTypes[18]
1144
+ if x != nil {
1145
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
1146
+ if ms.LoadMessageInfo() == nil {
1147
+ ms.StoreMessageInfo(mi)
1148
+ }
1149
+ return ms
1150
+ }
1151
+ return mi.MessageOf(x)
1152
+ }
1153
+
1154
+ // Deprecated: Use BatchObject_Properties.ProtoReflect.Descriptor instead.
1155
+ func (*BatchObject_Properties) Descriptor() ([]byte, []int) {
1156
+ return file_v1_batch_proto_rawDescGZIP(), []int{6, 0}
1157
+ }
1158
+
1159
+ func (x *BatchObject_Properties) GetNonRefProperties() *structpb.Struct {
1160
+ if x != nil {
1161
+ return x.NonRefProperties
1162
+ }
1163
+ return nil
1164
+ }
1165
+
1166
+ func (x *BatchObject_Properties) GetSingleTargetRefProps() []*BatchObject_SingleTargetRefProps {
1167
+ if x != nil {
1168
+ return x.SingleTargetRefProps
1169
+ }
1170
+ return nil
1171
+ }
1172
+
1173
+ func (x *BatchObject_Properties) GetMultiTargetRefProps() []*BatchObject_MultiTargetRefProps {
1174
+ if x != nil {
1175
+ return x.MultiTargetRefProps
1176
+ }
1177
+ return nil
1178
+ }
1179
+
1180
+ func (x *BatchObject_Properties) GetNumberArrayProperties() []*NumberArrayProperties {
1181
+ if x != nil {
1182
+ return x.NumberArrayProperties
1183
+ }
1184
+ return nil
1185
+ }
1186
+
1187
+ func (x *BatchObject_Properties) GetIntArrayProperties() []*IntArrayProperties {
1188
+ if x != nil {
1189
+ return x.IntArrayProperties
1190
+ }
1191
+ return nil
1192
+ }
1193
+
1194
+ func (x *BatchObject_Properties) GetTextArrayProperties() []*TextArrayProperties {
1195
+ if x != nil {
1196
+ return x.TextArrayProperties
1197
+ }
1198
+ return nil
1199
+ }
1200
+
1201
+ func (x *BatchObject_Properties) GetBooleanArrayProperties() []*BooleanArrayProperties {
1202
+ if x != nil {
1203
+ return x.BooleanArrayProperties
1204
+ }
1205
+ return nil
1206
+ }
1207
+
1208
+ func (x *BatchObject_Properties) GetObjectProperties() []*ObjectProperties {
1209
+ if x != nil {
1210
+ return x.ObjectProperties
1211
+ }
1212
+ return nil
1213
+ }
1214
+
1215
+ func (x *BatchObject_Properties) GetObjectArrayProperties() []*ObjectArrayProperties {
1216
+ if x != nil {
1217
+ return x.ObjectArrayProperties
1218
+ }
1219
+ return nil
1220
+ }
1221
+
1222
+ func (x *BatchObject_Properties) GetEmptyListProps() []string {
1223
+ if x != nil {
1224
+ return x.EmptyListProps
1225
+ }
1226
+ return nil
1227
+ }
1228
+
1229
+ type BatchObject_SingleTargetRefProps struct {
1230
+ state protoimpl.MessageState `protogen:"open.v1"`
1231
+ Uuids []string `protobuf:"bytes,1,rep,name=uuids,proto3" json:"uuids,omitempty"`
1232
+ PropName string `protobuf:"bytes,2,opt,name=prop_name,json=propName,proto3" json:"prop_name,omitempty"`
1233
+ unknownFields protoimpl.UnknownFields
1234
+ sizeCache protoimpl.SizeCache
1235
+ }
1236
+
1237
+ func (x *BatchObject_SingleTargetRefProps) Reset() {
1238
+ *x = BatchObject_SingleTargetRefProps{}
1239
+ mi := &file_v1_batch_proto_msgTypes[19]
1240
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
1241
+ ms.StoreMessageInfo(mi)
1242
+ }
1243
+
1244
+ func (x *BatchObject_SingleTargetRefProps) String() string {
1245
+ return protoimpl.X.MessageStringOf(x)
1246
+ }
1247
+
1248
+ func (*BatchObject_SingleTargetRefProps) ProtoMessage() {}
1249
+
1250
+ func (x *BatchObject_SingleTargetRefProps) ProtoReflect() protoreflect.Message {
1251
+ mi := &file_v1_batch_proto_msgTypes[19]
1252
+ if x != nil {
1253
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
1254
+ if ms.LoadMessageInfo() == nil {
1255
+ ms.StoreMessageInfo(mi)
1256
+ }
1257
+ return ms
1258
+ }
1259
+ return mi.MessageOf(x)
1260
+ }
1261
+
1262
+ // Deprecated: Use BatchObject_SingleTargetRefProps.ProtoReflect.Descriptor instead.
1263
+ func (*BatchObject_SingleTargetRefProps) Descriptor() ([]byte, []int) {
1264
+ return file_v1_batch_proto_rawDescGZIP(), []int{6, 1}
1265
+ }
1266
+
1267
+ func (x *BatchObject_SingleTargetRefProps) GetUuids() []string {
1268
+ if x != nil {
1269
+ return x.Uuids
1270
+ }
1271
+ return nil
1272
+ }
1273
+
1274
+ func (x *BatchObject_SingleTargetRefProps) GetPropName() string {
1275
+ if x != nil {
1276
+ return x.PropName
1277
+ }
1278
+ return ""
1279
+ }
1280
+
1281
+ type BatchObject_MultiTargetRefProps struct {
1282
+ state protoimpl.MessageState `protogen:"open.v1"`
1283
+ Uuids []string `protobuf:"bytes,1,rep,name=uuids,proto3" json:"uuids,omitempty"`
1284
+ PropName string `protobuf:"bytes,2,opt,name=prop_name,json=propName,proto3" json:"prop_name,omitempty"`
1285
+ TargetCollection string `protobuf:"bytes,3,opt,name=target_collection,json=targetCollection,proto3" json:"target_collection,omitempty"`
1286
+ unknownFields protoimpl.UnknownFields
1287
+ sizeCache protoimpl.SizeCache
1288
+ }
1289
+
1290
+ func (x *BatchObject_MultiTargetRefProps) Reset() {
1291
+ *x = BatchObject_MultiTargetRefProps{}
1292
+ mi := &file_v1_batch_proto_msgTypes[20]
1293
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
1294
+ ms.StoreMessageInfo(mi)
1295
+ }
1296
+
1297
+ func (x *BatchObject_MultiTargetRefProps) String() string {
1298
+ return protoimpl.X.MessageStringOf(x)
1299
+ }
1300
+
1301
+ func (*BatchObject_MultiTargetRefProps) ProtoMessage() {}
1302
+
1303
+ func (x *BatchObject_MultiTargetRefProps) ProtoReflect() protoreflect.Message {
1304
+ mi := &file_v1_batch_proto_msgTypes[20]
1305
+ if x != nil {
1306
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
1307
+ if ms.LoadMessageInfo() == nil {
1308
+ ms.StoreMessageInfo(mi)
1309
+ }
1310
+ return ms
1311
+ }
1312
+ return mi.MessageOf(x)
1313
+ }
1314
+
1315
+ // Deprecated: Use BatchObject_MultiTargetRefProps.ProtoReflect.Descriptor instead.
1316
+ func (*BatchObject_MultiTargetRefProps) Descriptor() ([]byte, []int) {
1317
+ return file_v1_batch_proto_rawDescGZIP(), []int{6, 2}
1318
+ }
1319
+
1320
+ func (x *BatchObject_MultiTargetRefProps) GetUuids() []string {
1321
+ if x != nil {
1322
+ return x.Uuids
1323
+ }
1324
+ return nil
1325
+ }
1326
+
1327
+ func (x *BatchObject_MultiTargetRefProps) GetPropName() string {
1328
+ if x != nil {
1329
+ return x.PropName
1330
+ }
1331
+ return ""
1332
+ }
1333
+
1334
+ func (x *BatchObject_MultiTargetRefProps) GetTargetCollection() string {
1335
+ if x != nil {
1336
+ return x.TargetCollection
1337
+ }
1338
+ return ""
1339
+ }
1340
+
1341
+ type BatchObjectsReply_BatchError struct {
1342
+ state protoimpl.MessageState `protogen:"open.v1"`
1343
+ Index int32 `protobuf:"varint,1,opt,name=index,proto3" json:"index,omitempty"`
1344
+ Error string `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"`
1345
+ unknownFields protoimpl.UnknownFields
1346
+ sizeCache protoimpl.SizeCache
1347
+ }
1348
+
1349
+ func (x *BatchObjectsReply_BatchError) Reset() {
1350
+ *x = BatchObjectsReply_BatchError{}
1351
+ mi := &file_v1_batch_proto_msgTypes[21]
1352
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
1353
+ ms.StoreMessageInfo(mi)
1354
+ }
1355
+
1356
+ func (x *BatchObjectsReply_BatchError) String() string {
1357
+ return protoimpl.X.MessageStringOf(x)
1358
+ }
1359
+
1360
+ func (*BatchObjectsReply_BatchError) ProtoMessage() {}
1361
+
1362
+ func (x *BatchObjectsReply_BatchError) ProtoReflect() protoreflect.Message {
1363
+ mi := &file_v1_batch_proto_msgTypes[21]
1364
+ if x != nil {
1365
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
1366
+ if ms.LoadMessageInfo() == nil {
1367
+ ms.StoreMessageInfo(mi)
1368
+ }
1369
+ return ms
1370
+ }
1371
+ return mi.MessageOf(x)
1372
+ }
1373
+
1374
+ // Deprecated: Use BatchObjectsReply_BatchError.ProtoReflect.Descriptor instead.
1375
+ func (*BatchObjectsReply_BatchError) Descriptor() ([]byte, []int) {
1376
+ return file_v1_batch_proto_rawDescGZIP(), []int{8, 0}
1377
+ }
1378
+
1379
+ func (x *BatchObjectsReply_BatchError) GetIndex() int32 {
1380
+ if x != nil {
1381
+ return x.Index
1382
+ }
1383
+ return 0
1384
+ }
1385
+
1386
+ func (x *BatchObjectsReply_BatchError) GetError() string {
1387
+ if x != nil {
1388
+ return x.Error
1389
+ }
1390
+ return ""
1391
+ }
1392
+
1393
+ type BatchReferencesReply_BatchError struct {
1394
+ state protoimpl.MessageState `protogen:"open.v1"`
1395
+ Index int32 `protobuf:"varint,1,opt,name=index,proto3" json:"index,omitempty"`
1396
+ Error string `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"`
1397
+ unknownFields protoimpl.UnknownFields
1398
+ sizeCache protoimpl.SizeCache
1399
+ }
1400
+
1401
+ func (x *BatchReferencesReply_BatchError) Reset() {
1402
+ *x = BatchReferencesReply_BatchError{}
1403
+ mi := &file_v1_batch_proto_msgTypes[22]
1404
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
1405
+ ms.StoreMessageInfo(mi)
1406
+ }
1407
+
1408
+ func (x *BatchReferencesReply_BatchError) String() string {
1409
+ return protoimpl.X.MessageStringOf(x)
1410
+ }
1411
+
1412
+ func (*BatchReferencesReply_BatchError) ProtoMessage() {}
1413
+
1414
+ func (x *BatchReferencesReply_BatchError) ProtoReflect() protoreflect.Message {
1415
+ mi := &file_v1_batch_proto_msgTypes[22]
1416
+ if x != nil {
1417
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
1418
+ if ms.LoadMessageInfo() == nil {
1419
+ ms.StoreMessageInfo(mi)
1420
+ }
1421
+ return ms
1422
+ }
1423
+ return mi.MessageOf(x)
1424
+ }
1425
+
1426
+ // Deprecated: Use BatchReferencesReply_BatchError.ProtoReflect.Descriptor instead.
1427
+ func (*BatchReferencesReply_BatchError) Descriptor() ([]byte, []int) {
1428
+ return file_v1_batch_proto_rawDescGZIP(), []int{9, 0}
1429
+ }
1430
+
1431
+ func (x *BatchReferencesReply_BatchError) GetIndex() int32 {
1432
+ if x != nil {
1433
+ return x.Index
1434
+ }
1435
+ return 0
1436
+ }
1437
+
1438
+ func (x *BatchReferencesReply_BatchError) GetError() string {
1439
+ if x != nil {
1440
+ return x.Error
1441
+ }
1442
+ return ""
1443
+ }
1444
+
1445
+ var File_v1_batch_proto protoreflect.FileDescriptor
1446
+
1447
+ const file_v1_batch_proto_rawDesc = "" +
1448
+ "\n" +
1449
+ "\x0ev1/batch.proto\x12\vweaviate.v1\x1a\x1cgoogle/protobuf/struct.proto\x1a\rv1/base.proto\"\xb0\x01\n" +
1450
+ "\x13BatchObjectsRequest\x122\n" +
1451
+ "\aobjects\x18\x01 \x03(\v2\x18.weaviate.v1.BatchObjectR\aobjects\x12O\n" +
1452
+ "\x11consistency_level\x18\x02 \x01(\x0e2\x1d.weaviate.v1.ConsistencyLevelH\x00R\x10consistencyLevel\x88\x01\x01B\x14\n" +
1453
+ "\x12_consistency_level\"\xbc\x01\n" +
1454
+ "\x16BatchReferencesRequest\x12;\n" +
1455
+ "\n" +
1456
+ "references\x18\x01 \x03(\v2\x1b.weaviate.v1.BatchReferenceR\n" +
1457
+ "references\x12O\n" +
1458
+ "\x11consistency_level\x18\x02 \x01(\x0e2\x1d.weaviate.v1.ConsistencyLevelH\x00R\x10consistencyLevel\x88\x01\x01B\x14\n" +
1459
+ "\x12_consistency_level\"\x8b\x03\n" +
1460
+ "\x10BatchSendRequest\x12\x1b\n" +
1461
+ "\tstream_id\x18\x01 \x01(\tR\bstreamId\x12A\n" +
1462
+ "\aobjects\x18\x02 \x01(\v2%.weaviate.v1.BatchSendRequest.ObjectsH\x00R\aobjects\x12J\n" +
1463
+ "\n" +
1464
+ "references\x18\x03 \x01(\v2(.weaviate.v1.BatchSendRequest.ReferencesH\x00R\n" +
1465
+ "references\x128\n" +
1466
+ "\x04stop\x18\x04 \x01(\v2\".weaviate.v1.BatchSendRequest.StopH\x00R\x04stop\x1a\x06\n" +
1467
+ "\x04Stop\x1a;\n" +
1468
+ "\aObjects\x120\n" +
1469
+ "\x06values\x18\x01 \x03(\v2\x18.weaviate.v1.BatchObjectR\x06values\x1aA\n" +
1470
+ "\n" +
1471
+ "References\x123\n" +
1472
+ "\x06values\x18\x01 \x03(\v2\x1b.weaviate.v1.BatchReferenceR\x06valuesB\t\n" +
1473
+ "\amessage\"a\n" +
1474
+ "\x0eBatchSendReply\x12&\n" +
1475
+ "\x0fnext_batch_size\x18\x01 \x01(\x05R\rnextBatchSize\x12'\n" +
1476
+ "\x0fbackoff_seconds\x18\x02 \x01(\x02R\x0ebackoffSeconds\"\xf6\x01\n" +
1477
+ "\x12BatchStreamRequest\x12O\n" +
1478
+ "\x11consistency_level\x18\x01 \x01(\x0e2\x1d.weaviate.v1.ConsistencyLevelH\x00R\x10consistencyLevel\x88\x01\x01\x12&\n" +
1479
+ "\fobject_index\x18\x02 \x01(\x05H\x01R\vobjectIndex\x88\x01\x01\x12,\n" +
1480
+ "\x0freference_index\x18\x03 \x01(\x05H\x02R\x0ereferenceIndex\x88\x01\x01B\x14\n" +
1481
+ "\x12_consistency_levelB\x0f\n" +
1482
+ "\r_object_indexB\x12\n" +
1483
+ "\x10_reference_index\"\xd9\x04\n" +
1484
+ "\x12BatchStreamMessage\x12\x1b\n" +
1485
+ "\tstream_id\x18\x01 \x01(\tR\bstreamId\x12=\n" +
1486
+ "\x05error\x18\x02 \x01(\v2%.weaviate.v1.BatchStreamMessage.ErrorH\x00R\x05error\x12=\n" +
1487
+ "\x05start\x18\x03 \x01(\v2%.weaviate.v1.BatchStreamMessage.StartH\x00R\x05start\x12:\n" +
1488
+ "\x04stop\x18\x04 \x01(\v2$.weaviate.v1.BatchStreamMessage.StopH\x00R\x04stop\x12F\n" +
1489
+ "\bshutdown\x18\x05 \x01(\v2(.weaviate.v1.BatchStreamMessage.ShutdownH\x00R\bshutdown\x12S\n" +
1490
+ "\rshutting_down\x18\x06 \x01(\v2,.weaviate.v1.BatchStreamMessage.ShuttingDownH\x00R\fshuttingDown\x1a\a\n" +
1491
+ "\x05Start\x1a\x06\n" +
1492
+ "\x04Stop\x1a\n" +
1493
+ "\n" +
1494
+ "\bShutdown\x1a\x0e\n" +
1495
+ "\fShuttingDown\x1a\x96\x01\n" +
1496
+ "\x05Error\x12\x14\n" +
1497
+ "\x05error\x18\x01 \x01(\tR\x05error\x12\x14\n" +
1498
+ "\x05index\x18\x02 \x01(\x05R\x05index\x12!\n" +
1499
+ "\fis_retriable\x18\x03 \x01(\bR\visRetriable\x12\x1b\n" +
1500
+ "\tis_object\x18\x04 \x01(\bR\bisObject\x12!\n" +
1501
+ "\fis_reference\x18\x05 \x01(\bR\visReferenceB\t\n" +
1502
+ "\amessage\"\xa4\n" +
1503
+ "\n" +
1504
+ "\vBatchObject\x12\x12\n" +
1505
+ "\x04uuid\x18\x01 \x01(\tR\x04uuid\x12\x1a\n" +
1506
+ "\x06vector\x18\x02 \x03(\x02B\x02\x18\x01R\x06vector\x12C\n" +
1507
+ "\n" +
1508
+ "properties\x18\x03 \x01(\v2#.weaviate.v1.BatchObject.PropertiesR\n" +
1509
+ "properties\x12\x1e\n" +
1510
+ "\n" +
1511
+ "collection\x18\x04 \x01(\tR\n" +
1512
+ "collection\x12\x16\n" +
1513
+ "\x06tenant\x18\x05 \x01(\tR\x06tenant\x12!\n" +
1514
+ "\fvector_bytes\x18\x06 \x01(\fR\vvectorBytes\x12.\n" +
1515
+ "\avectors\x18\x17 \x03(\v2\x14.weaviate.v1.VectorsR\avectors\x1a\xd2\x06\n" +
1516
+ "\n" +
1517
+ "Properties\x12E\n" +
1518
+ "\x12non_ref_properties\x18\x01 \x01(\v2\x17.google.protobuf.StructR\x10nonRefProperties\x12d\n" +
1519
+ "\x17single_target_ref_props\x18\x02 \x03(\v2-.weaviate.v1.BatchObject.SingleTargetRefPropsR\x14singleTargetRefProps\x12a\n" +
1520
+ "\x16multi_target_ref_props\x18\x03 \x03(\v2,.weaviate.v1.BatchObject.MultiTargetRefPropsR\x13multiTargetRefProps\x12Z\n" +
1521
+ "\x17number_array_properties\x18\x04 \x03(\v2\".weaviate.v1.NumberArrayPropertiesR\x15numberArrayProperties\x12Q\n" +
1522
+ "\x14int_array_properties\x18\x05 \x03(\v2\x1f.weaviate.v1.IntArrayPropertiesR\x12intArrayProperties\x12T\n" +
1523
+ "\x15text_array_properties\x18\x06 \x03(\v2 .weaviate.v1.TextArrayPropertiesR\x13textArrayProperties\x12]\n" +
1524
+ "\x18boolean_array_properties\x18\a \x03(\v2#.weaviate.v1.BooleanArrayPropertiesR\x16booleanArrayProperties\x12J\n" +
1525
+ "\x11object_properties\x18\b \x03(\v2\x1d.weaviate.v1.ObjectPropertiesR\x10objectProperties\x12Z\n" +
1526
+ "\x17object_array_properties\x18\t \x03(\v2\".weaviate.v1.ObjectArrayPropertiesR\x15objectArrayProperties\x12(\n" +
1527
+ "\x10empty_list_props\x18\n" +
1528
+ " \x03(\tR\x0eemptyListProps\x1aI\n" +
1529
+ "\x14SingleTargetRefProps\x12\x14\n" +
1530
+ "\x05uuids\x18\x01 \x03(\tR\x05uuids\x12\x1b\n" +
1531
+ "\tprop_name\x18\x02 \x01(\tR\bpropName\x1au\n" +
1532
+ "\x13MultiTargetRefProps\x12\x14\n" +
1533
+ "\x05uuids\x18\x01 \x03(\tR\x05uuids\x12\x1b\n" +
1534
+ "\tprop_name\x18\x02 \x01(\tR\bpropName\x12+\n" +
1535
+ "\x11target_collection\x18\x03 \x01(\tR\x10targetCollection\"\xd7\x01\n" +
1536
+ "\x0eBatchReference\x12\x12\n" +
1537
+ "\x04name\x18\x01 \x01(\tR\x04name\x12'\n" +
1538
+ "\x0ffrom_collection\x18\x02 \x01(\tR\x0efromCollection\x12\x1b\n" +
1539
+ "\tfrom_uuid\x18\x03 \x01(\tR\bfromUuid\x12(\n" +
1540
+ "\rto_collection\x18\x04 \x01(\tH\x00R\ftoCollection\x88\x01\x01\x12\x17\n" +
1541
+ "\ato_uuid\x18\x05 \x01(\tR\x06toUuid\x12\x16\n" +
1542
+ "\x06tenant\x18\x06 \x01(\tR\x06tenantB\x10\n" +
1543
+ "\x0e_to_collection\"\xa4\x01\n" +
1544
+ "\x11BatchObjectsReply\x12\x12\n" +
1545
+ "\x04took\x18\x01 \x01(\x02R\x04took\x12A\n" +
1546
+ "\x06errors\x18\x02 \x03(\v2).weaviate.v1.BatchObjectsReply.BatchErrorR\x06errors\x1a8\n" +
1547
+ "\n" +
1548
+ "BatchError\x12\x14\n" +
1549
+ "\x05index\x18\x01 \x01(\x05R\x05index\x12\x14\n" +
1550
+ "\x05error\x18\x02 \x01(\tR\x05error\"\xaa\x01\n" +
1551
+ "\x14BatchReferencesReply\x12\x12\n" +
1552
+ "\x04took\x18\x01 \x01(\x02R\x04took\x12D\n" +
1553
+ "\x06errors\x18\x02 \x03(\v2,.weaviate.v1.BatchReferencesReply.BatchErrorR\x06errors\x1a8\n" +
1554
+ "\n" +
1555
+ "BatchError\x12\x14\n" +
1556
+ "\x05index\x18\x01 \x01(\x05R\x05index\x12\x14\n" +
1557
+ "\x05error\x18\x02 \x01(\tR\x05errorBo\n" +
1558
+ "#io.weaviate.client.grpc.protocol.v1B\x12WeaviateProtoBatchZ4github.com/weaviate/weaviate/grpc/generated;protocolb\x06proto3"
1559
+
1560
+ var (
1561
+ file_v1_batch_proto_rawDescOnce sync.Once
1562
+ file_v1_batch_proto_rawDescData []byte
1563
+ )
1564
+
1565
+ func file_v1_batch_proto_rawDescGZIP() []byte {
1566
+ file_v1_batch_proto_rawDescOnce.Do(func() {
1567
+ file_v1_batch_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_v1_batch_proto_rawDesc), len(file_v1_batch_proto_rawDesc)))
1568
+ })
1569
+ return file_v1_batch_proto_rawDescData
1570
+ }
1571
+
1572
+ var file_v1_batch_proto_msgTypes = make([]protoimpl.MessageInfo, 23)
1573
+ var file_v1_batch_proto_goTypes = []any{
1574
+ (*BatchObjectsRequest)(nil), // 0: weaviate.v1.BatchObjectsRequest
1575
+ (*BatchReferencesRequest)(nil), // 1: weaviate.v1.BatchReferencesRequest
1576
+ (*BatchSendRequest)(nil), // 2: weaviate.v1.BatchSendRequest
1577
+ (*BatchSendReply)(nil), // 3: weaviate.v1.BatchSendReply
1578
+ (*BatchStreamRequest)(nil), // 4: weaviate.v1.BatchStreamRequest
1579
+ (*BatchStreamMessage)(nil), // 5: weaviate.v1.BatchStreamMessage
1580
+ (*BatchObject)(nil), // 6: weaviate.v1.BatchObject
1581
+ (*BatchReference)(nil), // 7: weaviate.v1.BatchReference
1582
+ (*BatchObjectsReply)(nil), // 8: weaviate.v1.BatchObjectsReply
1583
+ (*BatchReferencesReply)(nil), // 9: weaviate.v1.BatchReferencesReply
1584
+ (*BatchSendRequest_Stop)(nil), // 10: weaviate.v1.BatchSendRequest.Stop
1585
+ (*BatchSendRequest_Objects)(nil), // 11: weaviate.v1.BatchSendRequest.Objects
1586
+ (*BatchSendRequest_References)(nil), // 12: weaviate.v1.BatchSendRequest.References
1587
+ (*BatchStreamMessage_Start)(nil), // 13: weaviate.v1.BatchStreamMessage.Start
1588
+ (*BatchStreamMessage_Stop)(nil), // 14: weaviate.v1.BatchStreamMessage.Stop
1589
+ (*BatchStreamMessage_Shutdown)(nil), // 15: weaviate.v1.BatchStreamMessage.Shutdown
1590
+ (*BatchStreamMessage_ShuttingDown)(nil), // 16: weaviate.v1.BatchStreamMessage.ShuttingDown
1591
+ (*BatchStreamMessage_Error)(nil), // 17: weaviate.v1.BatchStreamMessage.Error
1592
+ (*BatchObject_Properties)(nil), // 18: weaviate.v1.BatchObject.Properties
1593
+ (*BatchObject_SingleTargetRefProps)(nil), // 19: weaviate.v1.BatchObject.SingleTargetRefProps
1594
+ (*BatchObject_MultiTargetRefProps)(nil), // 20: weaviate.v1.BatchObject.MultiTargetRefProps
1595
+ (*BatchObjectsReply_BatchError)(nil), // 21: weaviate.v1.BatchObjectsReply.BatchError
1596
+ (*BatchReferencesReply_BatchError)(nil), // 22: weaviate.v1.BatchReferencesReply.BatchError
1597
+ (ConsistencyLevel)(0), // 23: weaviate.v1.ConsistencyLevel
1598
+ (*Vectors)(nil), // 24: weaviate.v1.Vectors
1599
+ (*structpb.Struct)(nil), // 25: google.protobuf.Struct
1600
+ (*NumberArrayProperties)(nil), // 26: weaviate.v1.NumberArrayProperties
1601
+ (*IntArrayProperties)(nil), // 27: weaviate.v1.IntArrayProperties
1602
+ (*TextArrayProperties)(nil), // 28: weaviate.v1.TextArrayProperties
1603
+ (*BooleanArrayProperties)(nil), // 29: weaviate.v1.BooleanArrayProperties
1604
+ (*ObjectProperties)(nil), // 30: weaviate.v1.ObjectProperties
1605
+ (*ObjectArrayProperties)(nil), // 31: weaviate.v1.ObjectArrayProperties
1606
+ }
1607
+ var file_v1_batch_proto_depIdxs = []int32{
1608
+ 6, // 0: weaviate.v1.BatchObjectsRequest.objects:type_name -> weaviate.v1.BatchObject
1609
+ 23, // 1: weaviate.v1.BatchObjectsRequest.consistency_level:type_name -> weaviate.v1.ConsistencyLevel
1610
+ 7, // 2: weaviate.v1.BatchReferencesRequest.references:type_name -> weaviate.v1.BatchReference
1611
+ 23, // 3: weaviate.v1.BatchReferencesRequest.consistency_level:type_name -> weaviate.v1.ConsistencyLevel
1612
+ 11, // 4: weaviate.v1.BatchSendRequest.objects:type_name -> weaviate.v1.BatchSendRequest.Objects
1613
+ 12, // 5: weaviate.v1.BatchSendRequest.references:type_name -> weaviate.v1.BatchSendRequest.References
1614
+ 10, // 6: weaviate.v1.BatchSendRequest.stop:type_name -> weaviate.v1.BatchSendRequest.Stop
1615
+ 23, // 7: weaviate.v1.BatchStreamRequest.consistency_level:type_name -> weaviate.v1.ConsistencyLevel
1616
+ 17, // 8: weaviate.v1.BatchStreamMessage.error:type_name -> weaviate.v1.BatchStreamMessage.Error
1617
+ 13, // 9: weaviate.v1.BatchStreamMessage.start:type_name -> weaviate.v1.BatchStreamMessage.Start
1618
+ 14, // 10: weaviate.v1.BatchStreamMessage.stop:type_name -> weaviate.v1.BatchStreamMessage.Stop
1619
+ 15, // 11: weaviate.v1.BatchStreamMessage.shutdown:type_name -> weaviate.v1.BatchStreamMessage.Shutdown
1620
+ 16, // 12: weaviate.v1.BatchStreamMessage.shutting_down:type_name -> weaviate.v1.BatchStreamMessage.ShuttingDown
1621
+ 18, // 13: weaviate.v1.BatchObject.properties:type_name -> weaviate.v1.BatchObject.Properties
1622
+ 24, // 14: weaviate.v1.BatchObject.vectors:type_name -> weaviate.v1.Vectors
1623
+ 21, // 15: weaviate.v1.BatchObjectsReply.errors:type_name -> weaviate.v1.BatchObjectsReply.BatchError
1624
+ 22, // 16: weaviate.v1.BatchReferencesReply.errors:type_name -> weaviate.v1.BatchReferencesReply.BatchError
1625
+ 6, // 17: weaviate.v1.BatchSendRequest.Objects.values:type_name -> weaviate.v1.BatchObject
1626
+ 7, // 18: weaviate.v1.BatchSendRequest.References.values:type_name -> weaviate.v1.BatchReference
1627
+ 25, // 19: weaviate.v1.BatchObject.Properties.non_ref_properties:type_name -> google.protobuf.Struct
1628
+ 19, // 20: weaviate.v1.BatchObject.Properties.single_target_ref_props:type_name -> weaviate.v1.BatchObject.SingleTargetRefProps
1629
+ 20, // 21: weaviate.v1.BatchObject.Properties.multi_target_ref_props:type_name -> weaviate.v1.BatchObject.MultiTargetRefProps
1630
+ 26, // 22: weaviate.v1.BatchObject.Properties.number_array_properties:type_name -> weaviate.v1.NumberArrayProperties
1631
+ 27, // 23: weaviate.v1.BatchObject.Properties.int_array_properties:type_name -> weaviate.v1.IntArrayProperties
1632
+ 28, // 24: weaviate.v1.BatchObject.Properties.text_array_properties:type_name -> weaviate.v1.TextArrayProperties
1633
+ 29, // 25: weaviate.v1.BatchObject.Properties.boolean_array_properties:type_name -> weaviate.v1.BooleanArrayProperties
1634
+ 30, // 26: weaviate.v1.BatchObject.Properties.object_properties:type_name -> weaviate.v1.ObjectProperties
1635
+ 31, // 27: weaviate.v1.BatchObject.Properties.object_array_properties:type_name -> weaviate.v1.ObjectArrayProperties
1636
+ 28, // [28:28] is the sub-list for method output_type
1637
+ 28, // [28:28] is the sub-list for method input_type
1638
+ 28, // [28:28] is the sub-list for extension type_name
1639
+ 28, // [28:28] is the sub-list for extension extendee
1640
+ 0, // [0:28] is the sub-list for field type_name
1641
+ }
1642
+
1643
+ func init() { file_v1_batch_proto_init() }
1644
+ func file_v1_batch_proto_init() {
1645
+ if File_v1_batch_proto != nil {
1646
+ return
1647
+ }
1648
+ file_v1_base_proto_init()
1649
+ file_v1_batch_proto_msgTypes[0].OneofWrappers = []any{}
1650
+ file_v1_batch_proto_msgTypes[1].OneofWrappers = []any{}
1651
+ file_v1_batch_proto_msgTypes[2].OneofWrappers = []any{
1652
+ (*BatchSendRequest_Objects_)(nil),
1653
+ (*BatchSendRequest_References_)(nil),
1654
+ (*BatchSendRequest_Stop_)(nil),
1655
+ }
1656
+ file_v1_batch_proto_msgTypes[4].OneofWrappers = []any{}
1657
+ file_v1_batch_proto_msgTypes[5].OneofWrappers = []any{
1658
+ (*BatchStreamMessage_Error_)(nil),
1659
+ (*BatchStreamMessage_Start_)(nil),
1660
+ (*BatchStreamMessage_Stop_)(nil),
1661
+ (*BatchStreamMessage_Shutdown_)(nil),
1662
+ (*BatchStreamMessage_ShuttingDown_)(nil),
1663
+ }
1664
+ file_v1_batch_proto_msgTypes[7].OneofWrappers = []any{}
1665
+ type x struct{}
1666
+ out := protoimpl.TypeBuilder{
1667
+ File: protoimpl.DescBuilder{
1668
+ GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
1669
+ RawDescriptor: unsafe.Slice(unsafe.StringData(file_v1_batch_proto_rawDesc), len(file_v1_batch_proto_rawDesc)),
1670
+ NumEnums: 0,
1671
+ NumMessages: 23,
1672
+ NumExtensions: 0,
1673
+ NumServices: 0,
1674
+ },
1675
+ GoTypes: file_v1_batch_proto_goTypes,
1676
+ DependencyIndexes: file_v1_batch_proto_depIdxs,
1677
+ MessageInfos: file_v1_batch_proto_msgTypes,
1678
+ }.Build()
1679
+ File_v1_batch_proto = out.File
1680
+ file_v1_batch_proto_goTypes = nil
1681
+ file_v1_batch_proto_depIdxs = nil
1682
+ }
platform/dbops/binaries/weaviate-src/grpc/generated/protocol/v1/batch_delete.pb.go ADDED
@@ -0,0 +1,330 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Code generated by protoc-gen-go. DO NOT EDIT.
2
+
3
+ package protocol
4
+
5
+ import (
6
+ reflect "reflect"
7
+ sync "sync"
8
+ unsafe "unsafe"
9
+
10
+ protoreflect "google.golang.org/protobuf/reflect/protoreflect"
11
+ protoimpl "google.golang.org/protobuf/runtime/protoimpl"
12
+ )
13
+
14
+ const (
15
+ // Verify that this generated code is sufficiently up-to-date.
16
+ _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
17
+ // Verify that runtime/protoimpl is sufficiently up-to-date.
18
+ _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
19
+ )
20
+
21
+ type BatchDeleteRequest struct {
22
+ state protoimpl.MessageState `protogen:"open.v1"`
23
+ Collection string `protobuf:"bytes,1,opt,name=collection,proto3" json:"collection,omitempty"`
24
+ Filters *Filters `protobuf:"bytes,2,opt,name=filters,proto3" json:"filters,omitempty"`
25
+ Verbose bool `protobuf:"varint,3,opt,name=verbose,proto3" json:"verbose,omitempty"`
26
+ DryRun bool `protobuf:"varint,4,opt,name=dry_run,json=dryRun,proto3" json:"dry_run,omitempty"`
27
+ ConsistencyLevel *ConsistencyLevel `protobuf:"varint,5,opt,name=consistency_level,json=consistencyLevel,proto3,enum=weaviate.v1.ConsistencyLevel,oneof" json:"consistency_level,omitempty"`
28
+ Tenant *string `protobuf:"bytes,6,opt,name=tenant,proto3,oneof" json:"tenant,omitempty"`
29
+ unknownFields protoimpl.UnknownFields
30
+ sizeCache protoimpl.SizeCache
31
+ }
32
+
33
+ func (x *BatchDeleteRequest) Reset() {
34
+ *x = BatchDeleteRequest{}
35
+ mi := &file_v1_batch_delete_proto_msgTypes[0]
36
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
37
+ ms.StoreMessageInfo(mi)
38
+ }
39
+
40
+ func (x *BatchDeleteRequest) String() string {
41
+ return protoimpl.X.MessageStringOf(x)
42
+ }
43
+
44
+ func (*BatchDeleteRequest) ProtoMessage() {}
45
+
46
+ func (x *BatchDeleteRequest) ProtoReflect() protoreflect.Message {
47
+ mi := &file_v1_batch_delete_proto_msgTypes[0]
48
+ if x != nil {
49
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
50
+ if ms.LoadMessageInfo() == nil {
51
+ ms.StoreMessageInfo(mi)
52
+ }
53
+ return ms
54
+ }
55
+ return mi.MessageOf(x)
56
+ }
57
+
58
+ // Deprecated: Use BatchDeleteRequest.ProtoReflect.Descriptor instead.
59
+ func (*BatchDeleteRequest) Descriptor() ([]byte, []int) {
60
+ return file_v1_batch_delete_proto_rawDescGZIP(), []int{0}
61
+ }
62
+
63
+ func (x *BatchDeleteRequest) GetCollection() string {
64
+ if x != nil {
65
+ return x.Collection
66
+ }
67
+ return ""
68
+ }
69
+
70
+ func (x *BatchDeleteRequest) GetFilters() *Filters {
71
+ if x != nil {
72
+ return x.Filters
73
+ }
74
+ return nil
75
+ }
76
+
77
+ func (x *BatchDeleteRequest) GetVerbose() bool {
78
+ if x != nil {
79
+ return x.Verbose
80
+ }
81
+ return false
82
+ }
83
+
84
+ func (x *BatchDeleteRequest) GetDryRun() bool {
85
+ if x != nil {
86
+ return x.DryRun
87
+ }
88
+ return false
89
+ }
90
+
91
+ func (x *BatchDeleteRequest) GetConsistencyLevel() ConsistencyLevel {
92
+ if x != nil && x.ConsistencyLevel != nil {
93
+ return *x.ConsistencyLevel
94
+ }
95
+ return ConsistencyLevel_CONSISTENCY_LEVEL_UNSPECIFIED
96
+ }
97
+
98
+ func (x *BatchDeleteRequest) GetTenant() string {
99
+ if x != nil && x.Tenant != nil {
100
+ return *x.Tenant
101
+ }
102
+ return ""
103
+ }
104
+
105
+ type BatchDeleteReply struct {
106
+ state protoimpl.MessageState `protogen:"open.v1"`
107
+ Took float32 `protobuf:"fixed32,1,opt,name=took,proto3" json:"took,omitempty"`
108
+ Failed int64 `protobuf:"varint,2,opt,name=failed,proto3" json:"failed,omitempty"`
109
+ Matches int64 `protobuf:"varint,3,opt,name=matches,proto3" json:"matches,omitempty"`
110
+ Successful int64 `protobuf:"varint,4,opt,name=successful,proto3" json:"successful,omitempty"`
111
+ Objects []*BatchDeleteObject `protobuf:"bytes,5,rep,name=objects,proto3" json:"objects,omitempty"`
112
+ unknownFields protoimpl.UnknownFields
113
+ sizeCache protoimpl.SizeCache
114
+ }
115
+
116
+ func (x *BatchDeleteReply) Reset() {
117
+ *x = BatchDeleteReply{}
118
+ mi := &file_v1_batch_delete_proto_msgTypes[1]
119
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
120
+ ms.StoreMessageInfo(mi)
121
+ }
122
+
123
+ func (x *BatchDeleteReply) String() string {
124
+ return protoimpl.X.MessageStringOf(x)
125
+ }
126
+
127
+ func (*BatchDeleteReply) ProtoMessage() {}
128
+
129
+ func (x *BatchDeleteReply) ProtoReflect() protoreflect.Message {
130
+ mi := &file_v1_batch_delete_proto_msgTypes[1]
131
+ if x != nil {
132
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
133
+ if ms.LoadMessageInfo() == nil {
134
+ ms.StoreMessageInfo(mi)
135
+ }
136
+ return ms
137
+ }
138
+ return mi.MessageOf(x)
139
+ }
140
+
141
+ // Deprecated: Use BatchDeleteReply.ProtoReflect.Descriptor instead.
142
+ func (*BatchDeleteReply) Descriptor() ([]byte, []int) {
143
+ return file_v1_batch_delete_proto_rawDescGZIP(), []int{1}
144
+ }
145
+
146
+ func (x *BatchDeleteReply) GetTook() float32 {
147
+ if x != nil {
148
+ return x.Took
149
+ }
150
+ return 0
151
+ }
152
+
153
+ func (x *BatchDeleteReply) GetFailed() int64 {
154
+ if x != nil {
155
+ return x.Failed
156
+ }
157
+ return 0
158
+ }
159
+
160
+ func (x *BatchDeleteReply) GetMatches() int64 {
161
+ if x != nil {
162
+ return x.Matches
163
+ }
164
+ return 0
165
+ }
166
+
167
+ func (x *BatchDeleteReply) GetSuccessful() int64 {
168
+ if x != nil {
169
+ return x.Successful
170
+ }
171
+ return 0
172
+ }
173
+
174
+ func (x *BatchDeleteReply) GetObjects() []*BatchDeleteObject {
175
+ if x != nil {
176
+ return x.Objects
177
+ }
178
+ return nil
179
+ }
180
+
181
+ type BatchDeleteObject struct {
182
+ state protoimpl.MessageState `protogen:"open.v1"`
183
+ Uuid []byte `protobuf:"bytes,1,opt,name=uuid,proto3" json:"uuid,omitempty"`
184
+ Successful bool `protobuf:"varint,2,opt,name=successful,proto3" json:"successful,omitempty"`
185
+ Error *string `protobuf:"bytes,3,opt,name=error,proto3,oneof" json:"error,omitempty"` // empty string means no error
186
+ unknownFields protoimpl.UnknownFields
187
+ sizeCache protoimpl.SizeCache
188
+ }
189
+
190
+ func (x *BatchDeleteObject) Reset() {
191
+ *x = BatchDeleteObject{}
192
+ mi := &file_v1_batch_delete_proto_msgTypes[2]
193
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
194
+ ms.StoreMessageInfo(mi)
195
+ }
196
+
197
+ func (x *BatchDeleteObject) String() string {
198
+ return protoimpl.X.MessageStringOf(x)
199
+ }
200
+
201
+ func (*BatchDeleteObject) ProtoMessage() {}
202
+
203
+ func (x *BatchDeleteObject) ProtoReflect() protoreflect.Message {
204
+ mi := &file_v1_batch_delete_proto_msgTypes[2]
205
+ if x != nil {
206
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
207
+ if ms.LoadMessageInfo() == nil {
208
+ ms.StoreMessageInfo(mi)
209
+ }
210
+ return ms
211
+ }
212
+ return mi.MessageOf(x)
213
+ }
214
+
215
+ // Deprecated: Use BatchDeleteObject.ProtoReflect.Descriptor instead.
216
+ func (*BatchDeleteObject) Descriptor() ([]byte, []int) {
217
+ return file_v1_batch_delete_proto_rawDescGZIP(), []int{2}
218
+ }
219
+
220
+ func (x *BatchDeleteObject) GetUuid() []byte {
221
+ if x != nil {
222
+ return x.Uuid
223
+ }
224
+ return nil
225
+ }
226
+
227
+ func (x *BatchDeleteObject) GetSuccessful() bool {
228
+ if x != nil {
229
+ return x.Successful
230
+ }
231
+ return false
232
+ }
233
+
234
+ func (x *BatchDeleteObject) GetError() string {
235
+ if x != nil && x.Error != nil {
236
+ return *x.Error
237
+ }
238
+ return ""
239
+ }
240
+
241
+ var File_v1_batch_delete_proto protoreflect.FileDescriptor
242
+
243
+ const file_v1_batch_delete_proto_rawDesc = "" +
244
+ "\n" +
245
+ "\x15v1/batch_delete.proto\x12\vweaviate.v1\x1a\rv1/base.proto\"\xa6\x02\n" +
246
+ "\x12BatchDeleteRequest\x12\x1e\n" +
247
+ "\n" +
248
+ "collection\x18\x01 \x01(\tR\n" +
249
+ "collection\x12.\n" +
250
+ "\afilters\x18\x02 \x01(\v2\x14.weaviate.v1.FiltersR\afilters\x12\x18\n" +
251
+ "\averbose\x18\x03 \x01(\bR\averbose\x12\x17\n" +
252
+ "\adry_run\x18\x04 \x01(\bR\x06dryRun\x12O\n" +
253
+ "\x11consistency_level\x18\x05 \x01(\x0e2\x1d.weaviate.v1.ConsistencyLevelH\x00R\x10consistencyLevel\x88\x01\x01\x12\x1b\n" +
254
+ "\x06tenant\x18\x06 \x01(\tH\x01R\x06tenant\x88\x01\x01B\x14\n" +
255
+ "\x12_consistency_levelB\t\n" +
256
+ "\a_tenant\"\xb2\x01\n" +
257
+ "\x10BatchDeleteReply\x12\x12\n" +
258
+ "\x04took\x18\x01 \x01(\x02R\x04took\x12\x16\n" +
259
+ "\x06failed\x18\x02 \x01(\x03R\x06failed\x12\x18\n" +
260
+ "\amatches\x18\x03 \x01(\x03R\amatches\x12\x1e\n" +
261
+ "\n" +
262
+ "successful\x18\x04 \x01(\x03R\n" +
263
+ "successful\x128\n" +
264
+ "\aobjects\x18\x05 \x03(\v2\x1e.weaviate.v1.BatchDeleteObjectR\aobjects\"l\n" +
265
+ "\x11BatchDeleteObject\x12\x12\n" +
266
+ "\x04uuid\x18\x01 \x01(\fR\x04uuid\x12\x1e\n" +
267
+ "\n" +
268
+ "successful\x18\x02 \x01(\bR\n" +
269
+ "successful\x12\x19\n" +
270
+ "\x05error\x18\x03 \x01(\tH\x00R\x05error\x88\x01\x01B\b\n" +
271
+ "\x06_errorBu\n" +
272
+ "#io.weaviate.client.grpc.protocol.v1B\x18WeaviateProtoBatchDeleteZ4github.com/weaviate/weaviate/grpc/generated;protocolb\x06proto3"
273
+
274
+ var (
275
+ file_v1_batch_delete_proto_rawDescOnce sync.Once
276
+ file_v1_batch_delete_proto_rawDescData []byte
277
+ )
278
+
279
+ func file_v1_batch_delete_proto_rawDescGZIP() []byte {
280
+ file_v1_batch_delete_proto_rawDescOnce.Do(func() {
281
+ file_v1_batch_delete_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_v1_batch_delete_proto_rawDesc), len(file_v1_batch_delete_proto_rawDesc)))
282
+ })
283
+ return file_v1_batch_delete_proto_rawDescData
284
+ }
285
+
286
+ var file_v1_batch_delete_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
287
+ var file_v1_batch_delete_proto_goTypes = []any{
288
+ (*BatchDeleteRequest)(nil), // 0: weaviate.v1.BatchDeleteRequest
289
+ (*BatchDeleteReply)(nil), // 1: weaviate.v1.BatchDeleteReply
290
+ (*BatchDeleteObject)(nil), // 2: weaviate.v1.BatchDeleteObject
291
+ (*Filters)(nil), // 3: weaviate.v1.Filters
292
+ (ConsistencyLevel)(0), // 4: weaviate.v1.ConsistencyLevel
293
+ }
294
+ var file_v1_batch_delete_proto_depIdxs = []int32{
295
+ 3, // 0: weaviate.v1.BatchDeleteRequest.filters:type_name -> weaviate.v1.Filters
296
+ 4, // 1: weaviate.v1.BatchDeleteRequest.consistency_level:type_name -> weaviate.v1.ConsistencyLevel
297
+ 2, // 2: weaviate.v1.BatchDeleteReply.objects:type_name -> weaviate.v1.BatchDeleteObject
298
+ 3, // [3:3] is the sub-list for method output_type
299
+ 3, // [3:3] is the sub-list for method input_type
300
+ 3, // [3:3] is the sub-list for extension type_name
301
+ 3, // [3:3] is the sub-list for extension extendee
302
+ 0, // [0:3] is the sub-list for field type_name
303
+ }
304
+
305
+ func init() { file_v1_batch_delete_proto_init() }
306
+ func file_v1_batch_delete_proto_init() {
307
+ if File_v1_batch_delete_proto != nil {
308
+ return
309
+ }
310
+ file_v1_base_proto_init()
311
+ file_v1_batch_delete_proto_msgTypes[0].OneofWrappers = []any{}
312
+ file_v1_batch_delete_proto_msgTypes[2].OneofWrappers = []any{}
313
+ type x struct{}
314
+ out := protoimpl.TypeBuilder{
315
+ File: protoimpl.DescBuilder{
316
+ GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
317
+ RawDescriptor: unsafe.Slice(unsafe.StringData(file_v1_batch_delete_proto_rawDesc), len(file_v1_batch_delete_proto_rawDesc)),
318
+ NumEnums: 0,
319
+ NumMessages: 3,
320
+ NumExtensions: 0,
321
+ NumServices: 0,
322
+ },
323
+ GoTypes: file_v1_batch_delete_proto_goTypes,
324
+ DependencyIndexes: file_v1_batch_delete_proto_depIdxs,
325
+ MessageInfos: file_v1_batch_delete_proto_msgTypes,
326
+ }.Build()
327
+ File_v1_batch_delete_proto = out.File
328
+ file_v1_batch_delete_proto_goTypes = nil
329
+ file_v1_batch_delete_proto_depIdxs = nil
330
+ }
platform/dbops/binaries/weaviate-src/grpc/generated/protocol/v1/file_replication.pb.go ADDED
@@ -0,0 +1,810 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Code generated by protoc-gen-go. DO NOT EDIT.
2
+
3
+ package protocol
4
+
5
+ import (
6
+ reflect "reflect"
7
+ sync "sync"
8
+ unsafe "unsafe"
9
+
10
+ protoreflect "google.golang.org/protobuf/reflect/protoreflect"
11
+ protoimpl "google.golang.org/protobuf/runtime/protoimpl"
12
+ )
13
+
14
+ const (
15
+ // Verify that this generated code is sufficiently up-to-date.
16
+ _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
17
+ // Verify that runtime/protoimpl is sufficiently up-to-date.
18
+ _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
19
+ )
20
+
21
+ type CompressionType int32
22
+
23
+ const (
24
+ CompressionType_COMPRESSION_TYPE_UNSPECIFIED CompressionType = 0 // No compression
25
+ CompressionType_COMPRESSION_TYPE_GZIP CompressionType = 1 // gzip (compress/gzip)
26
+ CompressionType_COMPRESSION_TYPE_ZLIB CompressionType = 2 // zlib (compress/zlib)
27
+ CompressionType_COMPRESSION_TYPE_DEFLATE CompressionType = 3 // raw DEFLATE (compress/flate)
28
+ )
29
+
30
+ // Enum value maps for CompressionType.
31
+ var (
32
+ CompressionType_name = map[int32]string{
33
+ 0: "COMPRESSION_TYPE_UNSPECIFIED",
34
+ 1: "COMPRESSION_TYPE_GZIP",
35
+ 2: "COMPRESSION_TYPE_ZLIB",
36
+ 3: "COMPRESSION_TYPE_DEFLATE",
37
+ }
38
+ CompressionType_value = map[string]int32{
39
+ "COMPRESSION_TYPE_UNSPECIFIED": 0,
40
+ "COMPRESSION_TYPE_GZIP": 1,
41
+ "COMPRESSION_TYPE_ZLIB": 2,
42
+ "COMPRESSION_TYPE_DEFLATE": 3,
43
+ }
44
+ )
45
+
46
+ func (x CompressionType) Enum() *CompressionType {
47
+ p := new(CompressionType)
48
+ *p = x
49
+ return p
50
+ }
51
+
52
+ func (x CompressionType) String() string {
53
+ return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
54
+ }
55
+
56
+ func (CompressionType) Descriptor() protoreflect.EnumDescriptor {
57
+ return file_v1_file_replication_proto_enumTypes[0].Descriptor()
58
+ }
59
+
60
+ func (CompressionType) Type() protoreflect.EnumType {
61
+ return &file_v1_file_replication_proto_enumTypes[0]
62
+ }
63
+
64
+ func (x CompressionType) Number() protoreflect.EnumNumber {
65
+ return protoreflect.EnumNumber(x)
66
+ }
67
+
68
+ // Deprecated: Use CompressionType.Descriptor instead.
69
+ func (CompressionType) EnumDescriptor() ([]byte, []int) {
70
+ return file_v1_file_replication_proto_rawDescGZIP(), []int{0}
71
+ }
72
+
73
+ type PauseFileActivityRequest struct {
74
+ state protoimpl.MessageState `protogen:"open.v1"`
75
+ IndexName string `protobuf:"bytes,1,opt,name=index_name,json=indexName,proto3" json:"index_name,omitempty"`
76
+ ShardName string `protobuf:"bytes,2,opt,name=shard_name,json=shardName,proto3" json:"shard_name,omitempty"`
77
+ SchemaVersion uint64 `protobuf:"varint,3,opt,name=schema_version,json=schemaVersion,proto3" json:"schema_version,omitempty"`
78
+ unknownFields protoimpl.UnknownFields
79
+ sizeCache protoimpl.SizeCache
80
+ }
81
+
82
+ func (x *PauseFileActivityRequest) Reset() {
83
+ *x = PauseFileActivityRequest{}
84
+ mi := &file_v1_file_replication_proto_msgTypes[0]
85
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
86
+ ms.StoreMessageInfo(mi)
87
+ }
88
+
89
+ func (x *PauseFileActivityRequest) String() string {
90
+ return protoimpl.X.MessageStringOf(x)
91
+ }
92
+
93
+ func (*PauseFileActivityRequest) ProtoMessage() {}
94
+
95
+ func (x *PauseFileActivityRequest) ProtoReflect() protoreflect.Message {
96
+ mi := &file_v1_file_replication_proto_msgTypes[0]
97
+ if x != nil {
98
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
99
+ if ms.LoadMessageInfo() == nil {
100
+ ms.StoreMessageInfo(mi)
101
+ }
102
+ return ms
103
+ }
104
+ return mi.MessageOf(x)
105
+ }
106
+
107
+ // Deprecated: Use PauseFileActivityRequest.ProtoReflect.Descriptor instead.
108
+ func (*PauseFileActivityRequest) Descriptor() ([]byte, []int) {
109
+ return file_v1_file_replication_proto_rawDescGZIP(), []int{0}
110
+ }
111
+
112
+ func (x *PauseFileActivityRequest) GetIndexName() string {
113
+ if x != nil {
114
+ return x.IndexName
115
+ }
116
+ return ""
117
+ }
118
+
119
+ func (x *PauseFileActivityRequest) GetShardName() string {
120
+ if x != nil {
121
+ return x.ShardName
122
+ }
123
+ return ""
124
+ }
125
+
126
+ func (x *PauseFileActivityRequest) GetSchemaVersion() uint64 {
127
+ if x != nil {
128
+ return x.SchemaVersion
129
+ }
130
+ return 0
131
+ }
132
+
133
+ type PauseFileActivityResponse struct {
134
+ state protoimpl.MessageState `protogen:"open.v1"`
135
+ IndexName string `protobuf:"bytes,1,opt,name=index_name,json=indexName,proto3" json:"index_name,omitempty"`
136
+ ShardName string `protobuf:"bytes,2,opt,name=shard_name,json=shardName,proto3" json:"shard_name,omitempty"`
137
+ unknownFields protoimpl.UnknownFields
138
+ sizeCache protoimpl.SizeCache
139
+ }
140
+
141
+ func (x *PauseFileActivityResponse) Reset() {
142
+ *x = PauseFileActivityResponse{}
143
+ mi := &file_v1_file_replication_proto_msgTypes[1]
144
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
145
+ ms.StoreMessageInfo(mi)
146
+ }
147
+
148
+ func (x *PauseFileActivityResponse) String() string {
149
+ return protoimpl.X.MessageStringOf(x)
150
+ }
151
+
152
+ func (*PauseFileActivityResponse) ProtoMessage() {}
153
+
154
+ func (x *PauseFileActivityResponse) ProtoReflect() protoreflect.Message {
155
+ mi := &file_v1_file_replication_proto_msgTypes[1]
156
+ if x != nil {
157
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
158
+ if ms.LoadMessageInfo() == nil {
159
+ ms.StoreMessageInfo(mi)
160
+ }
161
+ return ms
162
+ }
163
+ return mi.MessageOf(x)
164
+ }
165
+
166
+ // Deprecated: Use PauseFileActivityResponse.ProtoReflect.Descriptor instead.
167
+ func (*PauseFileActivityResponse) Descriptor() ([]byte, []int) {
168
+ return file_v1_file_replication_proto_rawDescGZIP(), []int{1}
169
+ }
170
+
171
+ func (x *PauseFileActivityResponse) GetIndexName() string {
172
+ if x != nil {
173
+ return x.IndexName
174
+ }
175
+ return ""
176
+ }
177
+
178
+ func (x *PauseFileActivityResponse) GetShardName() string {
179
+ if x != nil {
180
+ return x.ShardName
181
+ }
182
+ return ""
183
+ }
184
+
185
+ type ResumeFileActivityRequest struct {
186
+ state protoimpl.MessageState `protogen:"open.v1"`
187
+ IndexName string `protobuf:"bytes,1,opt,name=index_name,json=indexName,proto3" json:"index_name,omitempty"`
188
+ ShardName string `protobuf:"bytes,2,opt,name=shard_name,json=shardName,proto3" json:"shard_name,omitempty"`
189
+ unknownFields protoimpl.UnknownFields
190
+ sizeCache protoimpl.SizeCache
191
+ }
192
+
193
+ func (x *ResumeFileActivityRequest) Reset() {
194
+ *x = ResumeFileActivityRequest{}
195
+ mi := &file_v1_file_replication_proto_msgTypes[2]
196
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
197
+ ms.StoreMessageInfo(mi)
198
+ }
199
+
200
+ func (x *ResumeFileActivityRequest) String() string {
201
+ return protoimpl.X.MessageStringOf(x)
202
+ }
203
+
204
+ func (*ResumeFileActivityRequest) ProtoMessage() {}
205
+
206
+ func (x *ResumeFileActivityRequest) ProtoReflect() protoreflect.Message {
207
+ mi := &file_v1_file_replication_proto_msgTypes[2]
208
+ if x != nil {
209
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
210
+ if ms.LoadMessageInfo() == nil {
211
+ ms.StoreMessageInfo(mi)
212
+ }
213
+ return ms
214
+ }
215
+ return mi.MessageOf(x)
216
+ }
217
+
218
+ // Deprecated: Use ResumeFileActivityRequest.ProtoReflect.Descriptor instead.
219
+ func (*ResumeFileActivityRequest) Descriptor() ([]byte, []int) {
220
+ return file_v1_file_replication_proto_rawDescGZIP(), []int{2}
221
+ }
222
+
223
+ func (x *ResumeFileActivityRequest) GetIndexName() string {
224
+ if x != nil {
225
+ return x.IndexName
226
+ }
227
+ return ""
228
+ }
229
+
230
+ func (x *ResumeFileActivityRequest) GetShardName() string {
231
+ if x != nil {
232
+ return x.ShardName
233
+ }
234
+ return ""
235
+ }
236
+
237
+ type ResumeFileActivityResponse struct {
238
+ state protoimpl.MessageState `protogen:"open.v1"`
239
+ IndexName string `protobuf:"bytes,1,opt,name=index_name,json=indexName,proto3" json:"index_name,omitempty"`
240
+ ShardName string `protobuf:"bytes,2,opt,name=shard_name,json=shardName,proto3" json:"shard_name,omitempty"`
241
+ unknownFields protoimpl.UnknownFields
242
+ sizeCache protoimpl.SizeCache
243
+ }
244
+
245
+ func (x *ResumeFileActivityResponse) Reset() {
246
+ *x = ResumeFileActivityResponse{}
247
+ mi := &file_v1_file_replication_proto_msgTypes[3]
248
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
249
+ ms.StoreMessageInfo(mi)
250
+ }
251
+
252
+ func (x *ResumeFileActivityResponse) String() string {
253
+ return protoimpl.X.MessageStringOf(x)
254
+ }
255
+
256
+ func (*ResumeFileActivityResponse) ProtoMessage() {}
257
+
258
+ func (x *ResumeFileActivityResponse) ProtoReflect() protoreflect.Message {
259
+ mi := &file_v1_file_replication_proto_msgTypes[3]
260
+ if x != nil {
261
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
262
+ if ms.LoadMessageInfo() == nil {
263
+ ms.StoreMessageInfo(mi)
264
+ }
265
+ return ms
266
+ }
267
+ return mi.MessageOf(x)
268
+ }
269
+
270
+ // Deprecated: Use ResumeFileActivityResponse.ProtoReflect.Descriptor instead.
271
+ func (*ResumeFileActivityResponse) Descriptor() ([]byte, []int) {
272
+ return file_v1_file_replication_proto_rawDescGZIP(), []int{3}
273
+ }
274
+
275
+ func (x *ResumeFileActivityResponse) GetIndexName() string {
276
+ if x != nil {
277
+ return x.IndexName
278
+ }
279
+ return ""
280
+ }
281
+
282
+ func (x *ResumeFileActivityResponse) GetShardName() string {
283
+ if x != nil {
284
+ return x.ShardName
285
+ }
286
+ return ""
287
+ }
288
+
289
+ type ListFilesRequest struct {
290
+ state protoimpl.MessageState `protogen:"open.v1"`
291
+ IndexName string `protobuf:"bytes,1,opt,name=index_name,json=indexName,proto3" json:"index_name,omitempty"`
292
+ ShardName string `protobuf:"bytes,2,opt,name=shard_name,json=shardName,proto3" json:"shard_name,omitempty"`
293
+ unknownFields protoimpl.UnknownFields
294
+ sizeCache protoimpl.SizeCache
295
+ }
296
+
297
+ func (x *ListFilesRequest) Reset() {
298
+ *x = ListFilesRequest{}
299
+ mi := &file_v1_file_replication_proto_msgTypes[4]
300
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
301
+ ms.StoreMessageInfo(mi)
302
+ }
303
+
304
+ func (x *ListFilesRequest) String() string {
305
+ return protoimpl.X.MessageStringOf(x)
306
+ }
307
+
308
+ func (*ListFilesRequest) ProtoMessage() {}
309
+
310
+ func (x *ListFilesRequest) ProtoReflect() protoreflect.Message {
311
+ mi := &file_v1_file_replication_proto_msgTypes[4]
312
+ if x != nil {
313
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
314
+ if ms.LoadMessageInfo() == nil {
315
+ ms.StoreMessageInfo(mi)
316
+ }
317
+ return ms
318
+ }
319
+ return mi.MessageOf(x)
320
+ }
321
+
322
+ // Deprecated: Use ListFilesRequest.ProtoReflect.Descriptor instead.
323
+ func (*ListFilesRequest) Descriptor() ([]byte, []int) {
324
+ return file_v1_file_replication_proto_rawDescGZIP(), []int{4}
325
+ }
326
+
327
+ func (x *ListFilesRequest) GetIndexName() string {
328
+ if x != nil {
329
+ return x.IndexName
330
+ }
331
+ return ""
332
+ }
333
+
334
+ func (x *ListFilesRequest) GetShardName() string {
335
+ if x != nil {
336
+ return x.ShardName
337
+ }
338
+ return ""
339
+ }
340
+
341
+ type ListFilesResponse struct {
342
+ state protoimpl.MessageState `protogen:"open.v1"`
343
+ IndexName string `protobuf:"bytes,1,opt,name=index_name,json=indexName,proto3" json:"index_name,omitempty"`
344
+ ShardName string `protobuf:"bytes,2,opt,name=shard_name,json=shardName,proto3" json:"shard_name,omitempty"`
345
+ FileNames []string `protobuf:"bytes,3,rep,name=file_names,json=fileNames,proto3" json:"file_names,omitempty"`
346
+ unknownFields protoimpl.UnknownFields
347
+ sizeCache protoimpl.SizeCache
348
+ }
349
+
350
+ func (x *ListFilesResponse) Reset() {
351
+ *x = ListFilesResponse{}
352
+ mi := &file_v1_file_replication_proto_msgTypes[5]
353
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
354
+ ms.StoreMessageInfo(mi)
355
+ }
356
+
357
+ func (x *ListFilesResponse) String() string {
358
+ return protoimpl.X.MessageStringOf(x)
359
+ }
360
+
361
+ func (*ListFilesResponse) ProtoMessage() {}
362
+
363
+ func (x *ListFilesResponse) ProtoReflect() protoreflect.Message {
364
+ mi := &file_v1_file_replication_proto_msgTypes[5]
365
+ if x != nil {
366
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
367
+ if ms.LoadMessageInfo() == nil {
368
+ ms.StoreMessageInfo(mi)
369
+ }
370
+ return ms
371
+ }
372
+ return mi.MessageOf(x)
373
+ }
374
+
375
+ // Deprecated: Use ListFilesResponse.ProtoReflect.Descriptor instead.
376
+ func (*ListFilesResponse) Descriptor() ([]byte, []int) {
377
+ return file_v1_file_replication_proto_rawDescGZIP(), []int{5}
378
+ }
379
+
380
+ func (x *ListFilesResponse) GetIndexName() string {
381
+ if x != nil {
382
+ return x.IndexName
383
+ }
384
+ return ""
385
+ }
386
+
387
+ func (x *ListFilesResponse) GetShardName() string {
388
+ if x != nil {
389
+ return x.ShardName
390
+ }
391
+ return ""
392
+ }
393
+
394
+ func (x *ListFilesResponse) GetFileNames() []string {
395
+ if x != nil {
396
+ return x.FileNames
397
+ }
398
+ return nil
399
+ }
400
+
401
+ type GetFileMetadataRequest struct {
402
+ state protoimpl.MessageState `protogen:"open.v1"`
403
+ IndexName string `protobuf:"bytes,1,opt,name=index_name,json=indexName,proto3" json:"index_name,omitempty"`
404
+ ShardName string `protobuf:"bytes,2,opt,name=shard_name,json=shardName,proto3" json:"shard_name,omitempty"`
405
+ FileName string `protobuf:"bytes,3,opt,name=file_name,json=fileName,proto3" json:"file_name,omitempty"`
406
+ unknownFields protoimpl.UnknownFields
407
+ sizeCache protoimpl.SizeCache
408
+ }
409
+
410
+ func (x *GetFileMetadataRequest) Reset() {
411
+ *x = GetFileMetadataRequest{}
412
+ mi := &file_v1_file_replication_proto_msgTypes[6]
413
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
414
+ ms.StoreMessageInfo(mi)
415
+ }
416
+
417
+ func (x *GetFileMetadataRequest) String() string {
418
+ return protoimpl.X.MessageStringOf(x)
419
+ }
420
+
421
+ func (*GetFileMetadataRequest) ProtoMessage() {}
422
+
423
+ func (x *GetFileMetadataRequest) ProtoReflect() protoreflect.Message {
424
+ mi := &file_v1_file_replication_proto_msgTypes[6]
425
+ if x != nil {
426
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
427
+ if ms.LoadMessageInfo() == nil {
428
+ ms.StoreMessageInfo(mi)
429
+ }
430
+ return ms
431
+ }
432
+ return mi.MessageOf(x)
433
+ }
434
+
435
+ // Deprecated: Use GetFileMetadataRequest.ProtoReflect.Descriptor instead.
436
+ func (*GetFileMetadataRequest) Descriptor() ([]byte, []int) {
437
+ return file_v1_file_replication_proto_rawDescGZIP(), []int{6}
438
+ }
439
+
440
+ func (x *GetFileMetadataRequest) GetIndexName() string {
441
+ if x != nil {
442
+ return x.IndexName
443
+ }
444
+ return ""
445
+ }
446
+
447
+ func (x *GetFileMetadataRequest) GetShardName() string {
448
+ if x != nil {
449
+ return x.ShardName
450
+ }
451
+ return ""
452
+ }
453
+
454
+ func (x *GetFileMetadataRequest) GetFileName() string {
455
+ if x != nil {
456
+ return x.FileName
457
+ }
458
+ return ""
459
+ }
460
+
461
+ type FileMetadata struct {
462
+ state protoimpl.MessageState `protogen:"open.v1"`
463
+ IndexName string `protobuf:"bytes,1,opt,name=index_name,json=indexName,proto3" json:"index_name,omitempty"`
464
+ ShardName string `protobuf:"bytes,2,opt,name=shard_name,json=shardName,proto3" json:"shard_name,omitempty"`
465
+ FileName string `protobuf:"bytes,3,opt,name=file_name,json=fileName,proto3" json:"file_name,omitempty"`
466
+ Size int64 `protobuf:"varint,4,opt,name=size,proto3" json:"size,omitempty"`
467
+ Crc32 uint32 `protobuf:"varint,5,opt,name=crc32,proto3" json:"crc32,omitempty"`
468
+ unknownFields protoimpl.UnknownFields
469
+ sizeCache protoimpl.SizeCache
470
+ }
471
+
472
+ func (x *FileMetadata) Reset() {
473
+ *x = FileMetadata{}
474
+ mi := &file_v1_file_replication_proto_msgTypes[7]
475
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
476
+ ms.StoreMessageInfo(mi)
477
+ }
478
+
479
+ func (x *FileMetadata) String() string {
480
+ return protoimpl.X.MessageStringOf(x)
481
+ }
482
+
483
+ func (*FileMetadata) ProtoMessage() {}
484
+
485
+ func (x *FileMetadata) ProtoReflect() protoreflect.Message {
486
+ mi := &file_v1_file_replication_proto_msgTypes[7]
487
+ if x != nil {
488
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
489
+ if ms.LoadMessageInfo() == nil {
490
+ ms.StoreMessageInfo(mi)
491
+ }
492
+ return ms
493
+ }
494
+ return mi.MessageOf(x)
495
+ }
496
+
497
+ // Deprecated: Use FileMetadata.ProtoReflect.Descriptor instead.
498
+ func (*FileMetadata) Descriptor() ([]byte, []int) {
499
+ return file_v1_file_replication_proto_rawDescGZIP(), []int{7}
500
+ }
501
+
502
+ func (x *FileMetadata) GetIndexName() string {
503
+ if x != nil {
504
+ return x.IndexName
505
+ }
506
+ return ""
507
+ }
508
+
509
+ func (x *FileMetadata) GetShardName() string {
510
+ if x != nil {
511
+ return x.ShardName
512
+ }
513
+ return ""
514
+ }
515
+
516
+ func (x *FileMetadata) GetFileName() string {
517
+ if x != nil {
518
+ return x.FileName
519
+ }
520
+ return ""
521
+ }
522
+
523
+ func (x *FileMetadata) GetSize() int64 {
524
+ if x != nil {
525
+ return x.Size
526
+ }
527
+ return 0
528
+ }
529
+
530
+ func (x *FileMetadata) GetCrc32() uint32 {
531
+ if x != nil {
532
+ return x.Crc32
533
+ }
534
+ return 0
535
+ }
536
+
537
+ type GetFileRequest struct {
538
+ state protoimpl.MessageState `protogen:"open.v1"`
539
+ IndexName string `protobuf:"bytes,1,opt,name=index_name,json=indexName,proto3" json:"index_name,omitempty"`
540
+ ShardName string `protobuf:"bytes,2,opt,name=shard_name,json=shardName,proto3" json:"shard_name,omitempty"`
541
+ FileName string `protobuf:"bytes,3,opt,name=file_name,json=fileName,proto3" json:"file_name,omitempty"`
542
+ Compression CompressionType `protobuf:"varint,4,opt,name=compression,proto3,enum=weaviate.v1.CompressionType" json:"compression,omitempty"` // Requested compression algorithm for streamed chunks
543
+ unknownFields protoimpl.UnknownFields
544
+ sizeCache protoimpl.SizeCache
545
+ }
546
+
547
+ func (x *GetFileRequest) Reset() {
548
+ *x = GetFileRequest{}
549
+ mi := &file_v1_file_replication_proto_msgTypes[8]
550
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
551
+ ms.StoreMessageInfo(mi)
552
+ }
553
+
554
+ func (x *GetFileRequest) String() string {
555
+ return protoimpl.X.MessageStringOf(x)
556
+ }
557
+
558
+ func (*GetFileRequest) ProtoMessage() {}
559
+
560
+ func (x *GetFileRequest) ProtoReflect() protoreflect.Message {
561
+ mi := &file_v1_file_replication_proto_msgTypes[8]
562
+ if x != nil {
563
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
564
+ if ms.LoadMessageInfo() == nil {
565
+ ms.StoreMessageInfo(mi)
566
+ }
567
+ return ms
568
+ }
569
+ return mi.MessageOf(x)
570
+ }
571
+
572
+ // Deprecated: Use GetFileRequest.ProtoReflect.Descriptor instead.
573
+ func (*GetFileRequest) Descriptor() ([]byte, []int) {
574
+ return file_v1_file_replication_proto_rawDescGZIP(), []int{8}
575
+ }
576
+
577
+ func (x *GetFileRequest) GetIndexName() string {
578
+ if x != nil {
579
+ return x.IndexName
580
+ }
581
+ return ""
582
+ }
583
+
584
+ func (x *GetFileRequest) GetShardName() string {
585
+ if x != nil {
586
+ return x.ShardName
587
+ }
588
+ return ""
589
+ }
590
+
591
+ func (x *GetFileRequest) GetFileName() string {
592
+ if x != nil {
593
+ return x.FileName
594
+ }
595
+ return ""
596
+ }
597
+
598
+ func (x *GetFileRequest) GetCompression() CompressionType {
599
+ if x != nil {
600
+ return x.Compression
601
+ }
602
+ return CompressionType_COMPRESSION_TYPE_UNSPECIFIED
603
+ }
604
+
605
+ type FileChunk struct {
606
+ state protoimpl.MessageState `protogen:"open.v1"`
607
+ Offset int64 `protobuf:"varint,1,opt,name=offset,proto3" json:"offset,omitempty"` // Byte offset in the uncompressed file
608
+ Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` // Compressed or raw chunk data
609
+ Eof bool `protobuf:"varint,3,opt,name=eof,proto3" json:"eof,omitempty"` // Indicates final chunk
610
+ unknownFields protoimpl.UnknownFields
611
+ sizeCache protoimpl.SizeCache
612
+ }
613
+
614
+ func (x *FileChunk) Reset() {
615
+ *x = FileChunk{}
616
+ mi := &file_v1_file_replication_proto_msgTypes[9]
617
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
618
+ ms.StoreMessageInfo(mi)
619
+ }
620
+
621
+ func (x *FileChunk) String() string {
622
+ return protoimpl.X.MessageStringOf(x)
623
+ }
624
+
625
+ func (*FileChunk) ProtoMessage() {}
626
+
627
+ func (x *FileChunk) ProtoReflect() protoreflect.Message {
628
+ mi := &file_v1_file_replication_proto_msgTypes[9]
629
+ if x != nil {
630
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
631
+ if ms.LoadMessageInfo() == nil {
632
+ ms.StoreMessageInfo(mi)
633
+ }
634
+ return ms
635
+ }
636
+ return mi.MessageOf(x)
637
+ }
638
+
639
+ // Deprecated: Use FileChunk.ProtoReflect.Descriptor instead.
640
+ func (*FileChunk) Descriptor() ([]byte, []int) {
641
+ return file_v1_file_replication_proto_rawDescGZIP(), []int{9}
642
+ }
643
+
644
+ func (x *FileChunk) GetOffset() int64 {
645
+ if x != nil {
646
+ return x.Offset
647
+ }
648
+ return 0
649
+ }
650
+
651
+ func (x *FileChunk) GetData() []byte {
652
+ if x != nil {
653
+ return x.Data
654
+ }
655
+ return nil
656
+ }
657
+
658
+ func (x *FileChunk) GetEof() bool {
659
+ if x != nil {
660
+ return x.Eof
661
+ }
662
+ return false
663
+ }
664
+
665
+ var File_v1_file_replication_proto protoreflect.FileDescriptor
666
+
667
+ const file_v1_file_replication_proto_rawDesc = "" +
668
+ "\n" +
669
+ "\x19v1/file_replication.proto\x12\vweaviate.v1\"\x7f\n" +
670
+ "\x18PauseFileActivityRequest\x12\x1d\n" +
671
+ "\n" +
672
+ "index_name\x18\x01 \x01(\tR\tindexName\x12\x1d\n" +
673
+ "\n" +
674
+ "shard_name\x18\x02 \x01(\tR\tshardName\x12%\n" +
675
+ "\x0eschema_version\x18\x03 \x01(\x04R\rschemaVersion\"Y\n" +
676
+ "\x19PauseFileActivityResponse\x12\x1d\n" +
677
+ "\n" +
678
+ "index_name\x18\x01 \x01(\tR\tindexName\x12\x1d\n" +
679
+ "\n" +
680
+ "shard_name\x18\x02 \x01(\tR\tshardName\"Y\n" +
681
+ "\x19ResumeFileActivityRequest\x12\x1d\n" +
682
+ "\n" +
683
+ "index_name\x18\x01 \x01(\tR\tindexName\x12\x1d\n" +
684
+ "\n" +
685
+ "shard_name\x18\x02 \x01(\tR\tshardName\"Z\n" +
686
+ "\x1aResumeFileActivityResponse\x12\x1d\n" +
687
+ "\n" +
688
+ "index_name\x18\x01 \x01(\tR\tindexName\x12\x1d\n" +
689
+ "\n" +
690
+ "shard_name\x18\x02 \x01(\tR\tshardName\"P\n" +
691
+ "\x10ListFilesRequest\x12\x1d\n" +
692
+ "\n" +
693
+ "index_name\x18\x01 \x01(\tR\tindexName\x12\x1d\n" +
694
+ "\n" +
695
+ "shard_name\x18\x02 \x01(\tR\tshardName\"p\n" +
696
+ "\x11ListFilesResponse\x12\x1d\n" +
697
+ "\n" +
698
+ "index_name\x18\x01 \x01(\tR\tindexName\x12\x1d\n" +
699
+ "\n" +
700
+ "shard_name\x18\x02 \x01(\tR\tshardName\x12\x1d\n" +
701
+ "\n" +
702
+ "file_names\x18\x03 \x03(\tR\tfileNames\"s\n" +
703
+ "\x16GetFileMetadataRequest\x12\x1d\n" +
704
+ "\n" +
705
+ "index_name\x18\x01 \x01(\tR\tindexName\x12\x1d\n" +
706
+ "\n" +
707
+ "shard_name\x18\x02 \x01(\tR\tshardName\x12\x1b\n" +
708
+ "\tfile_name\x18\x03 \x01(\tR\bfileName\"\x93\x01\n" +
709
+ "\fFileMetadata\x12\x1d\n" +
710
+ "\n" +
711
+ "index_name\x18\x01 \x01(\tR\tindexName\x12\x1d\n" +
712
+ "\n" +
713
+ "shard_name\x18\x02 \x01(\tR\tshardName\x12\x1b\n" +
714
+ "\tfile_name\x18\x03 \x01(\tR\bfileName\x12\x12\n" +
715
+ "\x04size\x18\x04 \x01(\x03R\x04size\x12\x14\n" +
716
+ "\x05crc32\x18\x05 \x01(\rR\x05crc32\"\xab\x01\n" +
717
+ "\x0eGetFileRequest\x12\x1d\n" +
718
+ "\n" +
719
+ "index_name\x18\x01 \x01(\tR\tindexName\x12\x1d\n" +
720
+ "\n" +
721
+ "shard_name\x18\x02 \x01(\tR\tshardName\x12\x1b\n" +
722
+ "\tfile_name\x18\x03 \x01(\tR\bfileName\x12>\n" +
723
+ "\vcompression\x18\x04 \x01(\x0e2\x1c.weaviate.v1.CompressionTypeR\vcompression\"I\n" +
724
+ "\tFileChunk\x12\x16\n" +
725
+ "\x06offset\x18\x01 \x01(\x03R\x06offset\x12\x12\n" +
726
+ "\x04data\x18\x02 \x01(\fR\x04data\x12\x10\n" +
727
+ "\x03eof\x18\x03 \x01(\bR\x03eof*\x87\x01\n" +
728
+ "\x0fCompressionType\x12 \n" +
729
+ "\x1cCOMPRESSION_TYPE_UNSPECIFIED\x10\x00\x12\x19\n" +
730
+ "\x15COMPRESSION_TYPE_GZIP\x10\x01\x12\x19\n" +
731
+ "\x15COMPRESSION_TYPE_ZLIB\x10\x02\x12\x1c\n" +
732
+ "\x18COMPRESSION_TYPE_DEFLATE\x10\x032\xca\x03\n" +
733
+ "\x16FileReplicationService\x12b\n" +
734
+ "\x11PauseFileActivity\x12%.weaviate.v1.PauseFileActivityRequest\x1a&.weaviate.v1.PauseFileActivityResponse\x12e\n" +
735
+ "\x12ResumeFileActivity\x12&.weaviate.v1.ResumeFileActivityRequest\x1a'.weaviate.v1.ResumeFileActivityResponse\x12J\n" +
736
+ "\tListFiles\x12\x1d.weaviate.v1.ListFilesRequest\x1a\x1e.weaviate.v1.ListFilesResponse\x12U\n" +
737
+ "\x0fGetFileMetadata\x12#.weaviate.v1.GetFileMetadataRequest\x1a\x19.weaviate.v1.FileMetadata(\x010\x01\x12B\n" +
738
+ "\aGetFile\x12\x1b.weaviate.v1.GetFileRequest\x1a\x16.weaviate.v1.FileChunk(\x010\x01Bj\n" +
739
+ "#io.weaviate.client.grpc.protocol.v1B\rWeaviateProtoZ4github.com/weaviate/weaviate/grpc/generated;protocolb\x06proto3"
740
+
741
+ var (
742
+ file_v1_file_replication_proto_rawDescOnce sync.Once
743
+ file_v1_file_replication_proto_rawDescData []byte
744
+ )
745
+
746
+ func file_v1_file_replication_proto_rawDescGZIP() []byte {
747
+ file_v1_file_replication_proto_rawDescOnce.Do(func() {
748
+ file_v1_file_replication_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_v1_file_replication_proto_rawDesc), len(file_v1_file_replication_proto_rawDesc)))
749
+ })
750
+ return file_v1_file_replication_proto_rawDescData
751
+ }
752
+
753
+ var file_v1_file_replication_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
754
+ var file_v1_file_replication_proto_msgTypes = make([]protoimpl.MessageInfo, 10)
755
+ var file_v1_file_replication_proto_goTypes = []any{
756
+ (CompressionType)(0), // 0: weaviate.v1.CompressionType
757
+ (*PauseFileActivityRequest)(nil), // 1: weaviate.v1.PauseFileActivityRequest
758
+ (*PauseFileActivityResponse)(nil), // 2: weaviate.v1.PauseFileActivityResponse
759
+ (*ResumeFileActivityRequest)(nil), // 3: weaviate.v1.ResumeFileActivityRequest
760
+ (*ResumeFileActivityResponse)(nil), // 4: weaviate.v1.ResumeFileActivityResponse
761
+ (*ListFilesRequest)(nil), // 5: weaviate.v1.ListFilesRequest
762
+ (*ListFilesResponse)(nil), // 6: weaviate.v1.ListFilesResponse
763
+ (*GetFileMetadataRequest)(nil), // 7: weaviate.v1.GetFileMetadataRequest
764
+ (*FileMetadata)(nil), // 8: weaviate.v1.FileMetadata
765
+ (*GetFileRequest)(nil), // 9: weaviate.v1.GetFileRequest
766
+ (*FileChunk)(nil), // 10: weaviate.v1.FileChunk
767
+ }
768
+ var file_v1_file_replication_proto_depIdxs = []int32{
769
+ 0, // 0: weaviate.v1.GetFileRequest.compression:type_name -> weaviate.v1.CompressionType
770
+ 1, // 1: weaviate.v1.FileReplicationService.PauseFileActivity:input_type -> weaviate.v1.PauseFileActivityRequest
771
+ 3, // 2: weaviate.v1.FileReplicationService.ResumeFileActivity:input_type -> weaviate.v1.ResumeFileActivityRequest
772
+ 5, // 3: weaviate.v1.FileReplicationService.ListFiles:input_type -> weaviate.v1.ListFilesRequest
773
+ 7, // 4: weaviate.v1.FileReplicationService.GetFileMetadata:input_type -> weaviate.v1.GetFileMetadataRequest
774
+ 9, // 5: weaviate.v1.FileReplicationService.GetFile:input_type -> weaviate.v1.GetFileRequest
775
+ 2, // 6: weaviate.v1.FileReplicationService.PauseFileActivity:output_type -> weaviate.v1.PauseFileActivityResponse
776
+ 4, // 7: weaviate.v1.FileReplicationService.ResumeFileActivity:output_type -> weaviate.v1.ResumeFileActivityResponse
777
+ 6, // 8: weaviate.v1.FileReplicationService.ListFiles:output_type -> weaviate.v1.ListFilesResponse
778
+ 8, // 9: weaviate.v1.FileReplicationService.GetFileMetadata:output_type -> weaviate.v1.FileMetadata
779
+ 10, // 10: weaviate.v1.FileReplicationService.GetFile:output_type -> weaviate.v1.FileChunk
780
+ 6, // [6:11] is the sub-list for method output_type
781
+ 1, // [1:6] is the sub-list for method input_type
782
+ 1, // [1:1] is the sub-list for extension type_name
783
+ 1, // [1:1] is the sub-list for extension extendee
784
+ 0, // [0:1] is the sub-list for field type_name
785
+ }
786
+
787
+ func init() { file_v1_file_replication_proto_init() }
788
+ func file_v1_file_replication_proto_init() {
789
+ if File_v1_file_replication_proto != nil {
790
+ return
791
+ }
792
+ type x struct{}
793
+ out := protoimpl.TypeBuilder{
794
+ File: protoimpl.DescBuilder{
795
+ GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
796
+ RawDescriptor: unsafe.Slice(unsafe.StringData(file_v1_file_replication_proto_rawDesc), len(file_v1_file_replication_proto_rawDesc)),
797
+ NumEnums: 1,
798
+ NumMessages: 10,
799
+ NumExtensions: 0,
800
+ NumServices: 1,
801
+ },
802
+ GoTypes: file_v1_file_replication_proto_goTypes,
803
+ DependencyIndexes: file_v1_file_replication_proto_depIdxs,
804
+ EnumInfos: file_v1_file_replication_proto_enumTypes,
805
+ MessageInfos: file_v1_file_replication_proto_msgTypes,
806
+ }.Build()
807
+ File_v1_file_replication_proto = out.File
808
+ file_v1_file_replication_proto_goTypes = nil
809
+ file_v1_file_replication_proto_depIdxs = nil
810
+ }
platform/dbops/binaries/weaviate-src/grpc/generated/protocol/v1/file_replication_grpc.pb.go ADDED
@@ -0,0 +1,260 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Code generated by protoc-gen-go-grpc. DO NOT EDIT.
2
+
3
+ package protocol
4
+
5
+ import (
6
+ context "context"
7
+
8
+ grpc "google.golang.org/grpc"
9
+ codes "google.golang.org/grpc/codes"
10
+ status "google.golang.org/grpc/status"
11
+ )
12
+
13
+ // This is a compile-time assertion to ensure that this generated file
14
+ // is compatible with the grpc package it is being compiled against.
15
+ // Requires gRPC-Go v1.64.0 or later.
16
+ const _ = grpc.SupportPackageIsVersion9
17
+
18
+ const (
19
+ FileReplicationService_PauseFileActivity_FullMethodName = "/weaviate.v1.FileReplicationService/PauseFileActivity"
20
+ FileReplicationService_ResumeFileActivity_FullMethodName = "/weaviate.v1.FileReplicationService/ResumeFileActivity"
21
+ FileReplicationService_ListFiles_FullMethodName = "/weaviate.v1.FileReplicationService/ListFiles"
22
+ FileReplicationService_GetFileMetadata_FullMethodName = "/weaviate.v1.FileReplicationService/GetFileMetadata"
23
+ FileReplicationService_GetFile_FullMethodName = "/weaviate.v1.FileReplicationService/GetFile"
24
+ )
25
+
26
+ // FileReplicationServiceClient is the client API for FileReplicationService service.
27
+ //
28
+ // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
29
+ type FileReplicationServiceClient interface {
30
+ PauseFileActivity(ctx context.Context, in *PauseFileActivityRequest, opts ...grpc.CallOption) (*PauseFileActivityResponse, error)
31
+ ResumeFileActivity(ctx context.Context, in *ResumeFileActivityRequest, opts ...grpc.CallOption) (*ResumeFileActivityResponse, error)
32
+ ListFiles(ctx context.Context, in *ListFilesRequest, opts ...grpc.CallOption) (*ListFilesResponse, error)
33
+ GetFileMetadata(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[GetFileMetadataRequest, FileMetadata], error)
34
+ GetFile(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[GetFileRequest, FileChunk], error)
35
+ }
36
+
37
+ type fileReplicationServiceClient struct {
38
+ cc grpc.ClientConnInterface
39
+ }
40
+
41
+ func NewFileReplicationServiceClient(cc grpc.ClientConnInterface) FileReplicationServiceClient {
42
+ return &fileReplicationServiceClient{cc}
43
+ }
44
+
45
+ func (c *fileReplicationServiceClient) PauseFileActivity(ctx context.Context, in *PauseFileActivityRequest, opts ...grpc.CallOption) (*PauseFileActivityResponse, error) {
46
+ cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
47
+ out := new(PauseFileActivityResponse)
48
+ err := c.cc.Invoke(ctx, FileReplicationService_PauseFileActivity_FullMethodName, in, out, cOpts...)
49
+ if err != nil {
50
+ return nil, err
51
+ }
52
+ return out, nil
53
+ }
54
+
55
+ func (c *fileReplicationServiceClient) ResumeFileActivity(ctx context.Context, in *ResumeFileActivityRequest, opts ...grpc.CallOption) (*ResumeFileActivityResponse, error) {
56
+ cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
57
+ out := new(ResumeFileActivityResponse)
58
+ err := c.cc.Invoke(ctx, FileReplicationService_ResumeFileActivity_FullMethodName, in, out, cOpts...)
59
+ if err != nil {
60
+ return nil, err
61
+ }
62
+ return out, nil
63
+ }
64
+
65
+ func (c *fileReplicationServiceClient) ListFiles(ctx context.Context, in *ListFilesRequest, opts ...grpc.CallOption) (*ListFilesResponse, error) {
66
+ cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
67
+ out := new(ListFilesResponse)
68
+ err := c.cc.Invoke(ctx, FileReplicationService_ListFiles_FullMethodName, in, out, cOpts...)
69
+ if err != nil {
70
+ return nil, err
71
+ }
72
+ return out, nil
73
+ }
74
+
75
+ func (c *fileReplicationServiceClient) GetFileMetadata(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[GetFileMetadataRequest, FileMetadata], error) {
76
+ cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
77
+ stream, err := c.cc.NewStream(ctx, &FileReplicationService_ServiceDesc.Streams[0], FileReplicationService_GetFileMetadata_FullMethodName, cOpts...)
78
+ if err != nil {
79
+ return nil, err
80
+ }
81
+ x := &grpc.GenericClientStream[GetFileMetadataRequest, FileMetadata]{ClientStream: stream}
82
+ return x, nil
83
+ }
84
+
85
+ // This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
86
+ type FileReplicationService_GetFileMetadataClient = grpc.BidiStreamingClient[GetFileMetadataRequest, FileMetadata]
87
+
88
+ func (c *fileReplicationServiceClient) GetFile(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[GetFileRequest, FileChunk], error) {
89
+ cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
90
+ stream, err := c.cc.NewStream(ctx, &FileReplicationService_ServiceDesc.Streams[1], FileReplicationService_GetFile_FullMethodName, cOpts...)
91
+ if err != nil {
92
+ return nil, err
93
+ }
94
+ x := &grpc.GenericClientStream[GetFileRequest, FileChunk]{ClientStream: stream}
95
+ return x, nil
96
+ }
97
+
98
+ // This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
99
+ type FileReplicationService_GetFileClient = grpc.BidiStreamingClient[GetFileRequest, FileChunk]
100
+
101
+ // FileReplicationServiceServer is the server API for FileReplicationService service.
102
+ // All implementations must embed UnimplementedFileReplicationServiceServer
103
+ // for forward compatibility.
104
+ type FileReplicationServiceServer interface {
105
+ PauseFileActivity(context.Context, *PauseFileActivityRequest) (*PauseFileActivityResponse, error)
106
+ ResumeFileActivity(context.Context, *ResumeFileActivityRequest) (*ResumeFileActivityResponse, error)
107
+ ListFiles(context.Context, *ListFilesRequest) (*ListFilesResponse, error)
108
+ GetFileMetadata(grpc.BidiStreamingServer[GetFileMetadataRequest, FileMetadata]) error
109
+ GetFile(grpc.BidiStreamingServer[GetFileRequest, FileChunk]) error
110
+ mustEmbedUnimplementedFileReplicationServiceServer()
111
+ }
112
+
113
+ // UnimplementedFileReplicationServiceServer must be embedded to have
114
+ // forward compatible implementations.
115
+ //
116
+ // NOTE: this should be embedded by value instead of pointer to avoid a nil
117
+ // pointer dereference when methods are called.
118
+ type UnimplementedFileReplicationServiceServer struct{}
119
+
120
+ func (UnimplementedFileReplicationServiceServer) PauseFileActivity(context.Context, *PauseFileActivityRequest) (*PauseFileActivityResponse, error) {
121
+ return nil, status.Errorf(codes.Unimplemented, "method PauseFileActivity not implemented")
122
+ }
123
+ func (UnimplementedFileReplicationServiceServer) ResumeFileActivity(context.Context, *ResumeFileActivityRequest) (*ResumeFileActivityResponse, error) {
124
+ return nil, status.Errorf(codes.Unimplemented, "method ResumeFileActivity not implemented")
125
+ }
126
+ func (UnimplementedFileReplicationServiceServer) ListFiles(context.Context, *ListFilesRequest) (*ListFilesResponse, error) {
127
+ return nil, status.Errorf(codes.Unimplemented, "method ListFiles not implemented")
128
+ }
129
+ func (UnimplementedFileReplicationServiceServer) GetFileMetadata(grpc.BidiStreamingServer[GetFileMetadataRequest, FileMetadata]) error {
130
+ return status.Errorf(codes.Unimplemented, "method GetFileMetadata not implemented")
131
+ }
132
+ func (UnimplementedFileReplicationServiceServer) GetFile(grpc.BidiStreamingServer[GetFileRequest, FileChunk]) error {
133
+ return status.Errorf(codes.Unimplemented, "method GetFile not implemented")
134
+ }
135
+ func (UnimplementedFileReplicationServiceServer) mustEmbedUnimplementedFileReplicationServiceServer() {
136
+ }
137
+ func (UnimplementedFileReplicationServiceServer) testEmbeddedByValue() {}
138
+
139
+ // UnsafeFileReplicationServiceServer may be embedded to opt out of forward compatibility for this service.
140
+ // Use of this interface is not recommended, as added methods to FileReplicationServiceServer will
141
+ // result in compilation errors.
142
+ type UnsafeFileReplicationServiceServer interface {
143
+ mustEmbedUnimplementedFileReplicationServiceServer()
144
+ }
145
+
146
+ func RegisterFileReplicationServiceServer(s grpc.ServiceRegistrar, srv FileReplicationServiceServer) {
147
+ // If the following call pancis, it indicates UnimplementedFileReplicationServiceServer was
148
+ // embedded by pointer and is nil. This will cause panics if an
149
+ // unimplemented method is ever invoked, so we test this at initialization
150
+ // time to prevent it from happening at runtime later due to I/O.
151
+ if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
152
+ t.testEmbeddedByValue()
153
+ }
154
+ s.RegisterService(&FileReplicationService_ServiceDesc, srv)
155
+ }
156
+
157
+ func _FileReplicationService_PauseFileActivity_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
158
+ in := new(PauseFileActivityRequest)
159
+ if err := dec(in); err != nil {
160
+ return nil, err
161
+ }
162
+ if interceptor == nil {
163
+ return srv.(FileReplicationServiceServer).PauseFileActivity(ctx, in)
164
+ }
165
+ info := &grpc.UnaryServerInfo{
166
+ Server: srv,
167
+ FullMethod: FileReplicationService_PauseFileActivity_FullMethodName,
168
+ }
169
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
170
+ return srv.(FileReplicationServiceServer).PauseFileActivity(ctx, req.(*PauseFileActivityRequest))
171
+ }
172
+ return interceptor(ctx, in, info, handler)
173
+ }
174
+
175
+ func _FileReplicationService_ResumeFileActivity_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
176
+ in := new(ResumeFileActivityRequest)
177
+ if err := dec(in); err != nil {
178
+ return nil, err
179
+ }
180
+ if interceptor == nil {
181
+ return srv.(FileReplicationServiceServer).ResumeFileActivity(ctx, in)
182
+ }
183
+ info := &grpc.UnaryServerInfo{
184
+ Server: srv,
185
+ FullMethod: FileReplicationService_ResumeFileActivity_FullMethodName,
186
+ }
187
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
188
+ return srv.(FileReplicationServiceServer).ResumeFileActivity(ctx, req.(*ResumeFileActivityRequest))
189
+ }
190
+ return interceptor(ctx, in, info, handler)
191
+ }
192
+
193
+ func _FileReplicationService_ListFiles_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
194
+ in := new(ListFilesRequest)
195
+ if err := dec(in); err != nil {
196
+ return nil, err
197
+ }
198
+ if interceptor == nil {
199
+ return srv.(FileReplicationServiceServer).ListFiles(ctx, in)
200
+ }
201
+ info := &grpc.UnaryServerInfo{
202
+ Server: srv,
203
+ FullMethod: FileReplicationService_ListFiles_FullMethodName,
204
+ }
205
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
206
+ return srv.(FileReplicationServiceServer).ListFiles(ctx, req.(*ListFilesRequest))
207
+ }
208
+ return interceptor(ctx, in, info, handler)
209
+ }
210
+
211
+ func _FileReplicationService_GetFileMetadata_Handler(srv interface{}, stream grpc.ServerStream) error {
212
+ return srv.(FileReplicationServiceServer).GetFileMetadata(&grpc.GenericServerStream[GetFileMetadataRequest, FileMetadata]{ServerStream: stream})
213
+ }
214
+
215
+ // This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
216
+ type FileReplicationService_GetFileMetadataServer = grpc.BidiStreamingServer[GetFileMetadataRequest, FileMetadata]
217
+
218
+ func _FileReplicationService_GetFile_Handler(srv interface{}, stream grpc.ServerStream) error {
219
+ return srv.(FileReplicationServiceServer).GetFile(&grpc.GenericServerStream[GetFileRequest, FileChunk]{ServerStream: stream})
220
+ }
221
+
222
+ // This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
223
+ type FileReplicationService_GetFileServer = grpc.BidiStreamingServer[GetFileRequest, FileChunk]
224
+
225
+ // FileReplicationService_ServiceDesc is the grpc.ServiceDesc for FileReplicationService service.
226
+ // It's only intended for direct use with grpc.RegisterService,
227
+ // and not to be introspected or modified (even as a copy)
228
+ var FileReplicationService_ServiceDesc = grpc.ServiceDesc{
229
+ ServiceName: "weaviate.v1.FileReplicationService",
230
+ HandlerType: (*FileReplicationServiceServer)(nil),
231
+ Methods: []grpc.MethodDesc{
232
+ {
233
+ MethodName: "PauseFileActivity",
234
+ Handler: _FileReplicationService_PauseFileActivity_Handler,
235
+ },
236
+ {
237
+ MethodName: "ResumeFileActivity",
238
+ Handler: _FileReplicationService_ResumeFileActivity_Handler,
239
+ },
240
+ {
241
+ MethodName: "ListFiles",
242
+ Handler: _FileReplicationService_ListFiles_Handler,
243
+ },
244
+ },
245
+ Streams: []grpc.StreamDesc{
246
+ {
247
+ StreamName: "GetFileMetadata",
248
+ Handler: _FileReplicationService_GetFileMetadata_Handler,
249
+ ServerStreams: true,
250
+ ClientStreams: true,
251
+ },
252
+ {
253
+ StreamName: "GetFile",
254
+ Handler: _FileReplicationService_GetFile_Handler,
255
+ ServerStreams: true,
256
+ ClientStreams: true,
257
+ },
258
+ },
259
+ Metadata: "v1/file_replication.proto",
260
+ }
platform/dbops/binaries/weaviate-src/grpc/generated/protocol/v1/generative.pb.go ADDED
The diff for this file is too large to render. See raw diff
 
platform/dbops/binaries/weaviate-src/grpc/generated/protocol/v1/properties.pb.go ADDED
@@ -0,0 +1,1105 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Code generated by protoc-gen-go. DO NOT EDIT.
2
+
3
+ package protocol
4
+
5
+ import (
6
+ reflect "reflect"
7
+ sync "sync"
8
+ unsafe "unsafe"
9
+
10
+ protoreflect "google.golang.org/protobuf/reflect/protoreflect"
11
+ protoimpl "google.golang.org/protobuf/runtime/protoimpl"
12
+ structpb "google.golang.org/protobuf/types/known/structpb"
13
+ )
14
+
15
+ const (
16
+ // Verify that this generated code is sufficiently up-to-date.
17
+ _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
18
+ // Verify that runtime/protoimpl is sufficiently up-to-date.
19
+ _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
20
+ )
21
+
22
+ type Properties struct {
23
+ state protoimpl.MessageState `protogen:"open.v1"`
24
+ Fields map[string]*Value `protobuf:"bytes,1,rep,name=fields,proto3" json:"fields,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"`
25
+ unknownFields protoimpl.UnknownFields
26
+ sizeCache protoimpl.SizeCache
27
+ }
28
+
29
+ func (x *Properties) Reset() {
30
+ *x = Properties{}
31
+ mi := &file_v1_properties_proto_msgTypes[0]
32
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
33
+ ms.StoreMessageInfo(mi)
34
+ }
35
+
36
+ func (x *Properties) String() string {
37
+ return protoimpl.X.MessageStringOf(x)
38
+ }
39
+
40
+ func (*Properties) ProtoMessage() {}
41
+
42
+ func (x *Properties) ProtoReflect() protoreflect.Message {
43
+ mi := &file_v1_properties_proto_msgTypes[0]
44
+ if x != nil {
45
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
46
+ if ms.LoadMessageInfo() == nil {
47
+ ms.StoreMessageInfo(mi)
48
+ }
49
+ return ms
50
+ }
51
+ return mi.MessageOf(x)
52
+ }
53
+
54
+ // Deprecated: Use Properties.ProtoReflect.Descriptor instead.
55
+ func (*Properties) Descriptor() ([]byte, []int) {
56
+ return file_v1_properties_proto_rawDescGZIP(), []int{0}
57
+ }
58
+
59
+ func (x *Properties) GetFields() map[string]*Value {
60
+ if x != nil {
61
+ return x.Fields
62
+ }
63
+ return nil
64
+ }
65
+
66
+ type Value struct {
67
+ state protoimpl.MessageState `protogen:"open.v1"`
68
+ // Types that are valid to be assigned to Kind:
69
+ //
70
+ // *Value_NumberValue
71
+ // *Value_BoolValue
72
+ // *Value_ObjectValue
73
+ // *Value_ListValue
74
+ // *Value_DateValue
75
+ // *Value_UuidValue
76
+ // *Value_IntValue
77
+ // *Value_GeoValue
78
+ // *Value_BlobValue
79
+ // *Value_PhoneValue
80
+ // *Value_NullValue
81
+ // *Value_TextValue
82
+ Kind isValue_Kind `protobuf_oneof:"kind"`
83
+ unknownFields protoimpl.UnknownFields
84
+ sizeCache protoimpl.SizeCache
85
+ }
86
+
87
+ func (x *Value) Reset() {
88
+ *x = Value{}
89
+ mi := &file_v1_properties_proto_msgTypes[1]
90
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
91
+ ms.StoreMessageInfo(mi)
92
+ }
93
+
94
+ func (x *Value) String() string {
95
+ return protoimpl.X.MessageStringOf(x)
96
+ }
97
+
98
+ func (*Value) ProtoMessage() {}
99
+
100
+ func (x *Value) ProtoReflect() protoreflect.Message {
101
+ mi := &file_v1_properties_proto_msgTypes[1]
102
+ if x != nil {
103
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
104
+ if ms.LoadMessageInfo() == nil {
105
+ ms.StoreMessageInfo(mi)
106
+ }
107
+ return ms
108
+ }
109
+ return mi.MessageOf(x)
110
+ }
111
+
112
+ // Deprecated: Use Value.ProtoReflect.Descriptor instead.
113
+ func (*Value) Descriptor() ([]byte, []int) {
114
+ return file_v1_properties_proto_rawDescGZIP(), []int{1}
115
+ }
116
+
117
+ func (x *Value) GetKind() isValue_Kind {
118
+ if x != nil {
119
+ return x.Kind
120
+ }
121
+ return nil
122
+ }
123
+
124
+ func (x *Value) GetNumberValue() float64 {
125
+ if x != nil {
126
+ if x, ok := x.Kind.(*Value_NumberValue); ok {
127
+ return x.NumberValue
128
+ }
129
+ }
130
+ return 0
131
+ }
132
+
133
+ func (x *Value) GetBoolValue() bool {
134
+ if x != nil {
135
+ if x, ok := x.Kind.(*Value_BoolValue); ok {
136
+ return x.BoolValue
137
+ }
138
+ }
139
+ return false
140
+ }
141
+
142
+ func (x *Value) GetObjectValue() *Properties {
143
+ if x != nil {
144
+ if x, ok := x.Kind.(*Value_ObjectValue); ok {
145
+ return x.ObjectValue
146
+ }
147
+ }
148
+ return nil
149
+ }
150
+
151
+ func (x *Value) GetListValue() *ListValue {
152
+ if x != nil {
153
+ if x, ok := x.Kind.(*Value_ListValue); ok {
154
+ return x.ListValue
155
+ }
156
+ }
157
+ return nil
158
+ }
159
+
160
+ func (x *Value) GetDateValue() string {
161
+ if x != nil {
162
+ if x, ok := x.Kind.(*Value_DateValue); ok {
163
+ return x.DateValue
164
+ }
165
+ }
166
+ return ""
167
+ }
168
+
169
+ func (x *Value) GetUuidValue() string {
170
+ if x != nil {
171
+ if x, ok := x.Kind.(*Value_UuidValue); ok {
172
+ return x.UuidValue
173
+ }
174
+ }
175
+ return ""
176
+ }
177
+
178
+ func (x *Value) GetIntValue() int64 {
179
+ if x != nil {
180
+ if x, ok := x.Kind.(*Value_IntValue); ok {
181
+ return x.IntValue
182
+ }
183
+ }
184
+ return 0
185
+ }
186
+
187
+ func (x *Value) GetGeoValue() *GeoCoordinate {
188
+ if x != nil {
189
+ if x, ok := x.Kind.(*Value_GeoValue); ok {
190
+ return x.GeoValue
191
+ }
192
+ }
193
+ return nil
194
+ }
195
+
196
+ func (x *Value) GetBlobValue() string {
197
+ if x != nil {
198
+ if x, ok := x.Kind.(*Value_BlobValue); ok {
199
+ return x.BlobValue
200
+ }
201
+ }
202
+ return ""
203
+ }
204
+
205
+ func (x *Value) GetPhoneValue() *PhoneNumber {
206
+ if x != nil {
207
+ if x, ok := x.Kind.(*Value_PhoneValue); ok {
208
+ return x.PhoneValue
209
+ }
210
+ }
211
+ return nil
212
+ }
213
+
214
+ func (x *Value) GetNullValue() structpb.NullValue {
215
+ if x != nil {
216
+ if x, ok := x.Kind.(*Value_NullValue); ok {
217
+ return x.NullValue
218
+ }
219
+ }
220
+ return structpb.NullValue(0)
221
+ }
222
+
223
+ func (x *Value) GetTextValue() string {
224
+ if x != nil {
225
+ if x, ok := x.Kind.(*Value_TextValue); ok {
226
+ return x.TextValue
227
+ }
228
+ }
229
+ return ""
230
+ }
231
+
232
+ type isValue_Kind interface {
233
+ isValue_Kind()
234
+ }
235
+
236
+ type Value_NumberValue struct {
237
+ NumberValue float64 `protobuf:"fixed64,1,opt,name=number_value,json=numberValue,proto3,oneof"`
238
+ }
239
+
240
+ type Value_BoolValue struct {
241
+ // dont reuse 2, old field that has been removed; Was "string string_value = 2;"
242
+ BoolValue bool `protobuf:"varint,3,opt,name=bool_value,json=boolValue,proto3,oneof"`
243
+ }
244
+
245
+ type Value_ObjectValue struct {
246
+ ObjectValue *Properties `protobuf:"bytes,4,opt,name=object_value,json=objectValue,proto3,oneof"`
247
+ }
248
+
249
+ type Value_ListValue struct {
250
+ ListValue *ListValue `protobuf:"bytes,5,opt,name=list_value,json=listValue,proto3,oneof"`
251
+ }
252
+
253
+ type Value_DateValue struct {
254
+ DateValue string `protobuf:"bytes,6,opt,name=date_value,json=dateValue,proto3,oneof"`
255
+ }
256
+
257
+ type Value_UuidValue struct {
258
+ UuidValue string `protobuf:"bytes,7,opt,name=uuid_value,json=uuidValue,proto3,oneof"`
259
+ }
260
+
261
+ type Value_IntValue struct {
262
+ IntValue int64 `protobuf:"varint,8,opt,name=int_value,json=intValue,proto3,oneof"`
263
+ }
264
+
265
+ type Value_GeoValue struct {
266
+ GeoValue *GeoCoordinate `protobuf:"bytes,9,opt,name=geo_value,json=geoValue,proto3,oneof"`
267
+ }
268
+
269
+ type Value_BlobValue struct {
270
+ BlobValue string `protobuf:"bytes,10,opt,name=blob_value,json=blobValue,proto3,oneof"`
271
+ }
272
+
273
+ type Value_PhoneValue struct {
274
+ PhoneValue *PhoneNumber `protobuf:"bytes,11,opt,name=phone_value,json=phoneValue,proto3,oneof"`
275
+ }
276
+
277
+ type Value_NullValue struct {
278
+ NullValue structpb.NullValue `protobuf:"varint,12,opt,name=null_value,json=nullValue,proto3,enum=google.protobuf.NullValue,oneof"`
279
+ }
280
+
281
+ type Value_TextValue struct {
282
+ TextValue string `protobuf:"bytes,13,opt,name=text_value,json=textValue,proto3,oneof"`
283
+ }
284
+
285
+ func (*Value_NumberValue) isValue_Kind() {}
286
+
287
+ func (*Value_BoolValue) isValue_Kind() {}
288
+
289
+ func (*Value_ObjectValue) isValue_Kind() {}
290
+
291
+ func (*Value_ListValue) isValue_Kind() {}
292
+
293
+ func (*Value_DateValue) isValue_Kind() {}
294
+
295
+ func (*Value_UuidValue) isValue_Kind() {}
296
+
297
+ func (*Value_IntValue) isValue_Kind() {}
298
+
299
+ func (*Value_GeoValue) isValue_Kind() {}
300
+
301
+ func (*Value_BlobValue) isValue_Kind() {}
302
+
303
+ func (*Value_PhoneValue) isValue_Kind() {}
304
+
305
+ func (*Value_NullValue) isValue_Kind() {}
306
+
307
+ func (*Value_TextValue) isValue_Kind() {}
308
+
309
+ type ListValue struct {
310
+ state protoimpl.MessageState `protogen:"open.v1"`
311
+ // Types that are valid to be assigned to Kind:
312
+ //
313
+ // *ListValue_NumberValues
314
+ // *ListValue_BoolValues
315
+ // *ListValue_ObjectValues
316
+ // *ListValue_DateValues
317
+ // *ListValue_UuidValues
318
+ // *ListValue_IntValues
319
+ // *ListValue_TextValues
320
+ Kind isListValue_Kind `protobuf_oneof:"kind"`
321
+ unknownFields protoimpl.UnknownFields
322
+ sizeCache protoimpl.SizeCache
323
+ }
324
+
325
+ func (x *ListValue) Reset() {
326
+ *x = ListValue{}
327
+ mi := &file_v1_properties_proto_msgTypes[2]
328
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
329
+ ms.StoreMessageInfo(mi)
330
+ }
331
+
332
+ func (x *ListValue) String() string {
333
+ return protoimpl.X.MessageStringOf(x)
334
+ }
335
+
336
+ func (*ListValue) ProtoMessage() {}
337
+
338
+ func (x *ListValue) ProtoReflect() protoreflect.Message {
339
+ mi := &file_v1_properties_proto_msgTypes[2]
340
+ if x != nil {
341
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
342
+ if ms.LoadMessageInfo() == nil {
343
+ ms.StoreMessageInfo(mi)
344
+ }
345
+ return ms
346
+ }
347
+ return mi.MessageOf(x)
348
+ }
349
+
350
+ // Deprecated: Use ListValue.ProtoReflect.Descriptor instead.
351
+ func (*ListValue) Descriptor() ([]byte, []int) {
352
+ return file_v1_properties_proto_rawDescGZIP(), []int{2}
353
+ }
354
+
355
+ func (x *ListValue) GetKind() isListValue_Kind {
356
+ if x != nil {
357
+ return x.Kind
358
+ }
359
+ return nil
360
+ }
361
+
362
+ func (x *ListValue) GetNumberValues() *NumberValues {
363
+ if x != nil {
364
+ if x, ok := x.Kind.(*ListValue_NumberValues); ok {
365
+ return x.NumberValues
366
+ }
367
+ }
368
+ return nil
369
+ }
370
+
371
+ func (x *ListValue) GetBoolValues() *BoolValues {
372
+ if x != nil {
373
+ if x, ok := x.Kind.(*ListValue_BoolValues); ok {
374
+ return x.BoolValues
375
+ }
376
+ }
377
+ return nil
378
+ }
379
+
380
+ func (x *ListValue) GetObjectValues() *ObjectValues {
381
+ if x != nil {
382
+ if x, ok := x.Kind.(*ListValue_ObjectValues); ok {
383
+ return x.ObjectValues
384
+ }
385
+ }
386
+ return nil
387
+ }
388
+
389
+ func (x *ListValue) GetDateValues() *DateValues {
390
+ if x != nil {
391
+ if x, ok := x.Kind.(*ListValue_DateValues); ok {
392
+ return x.DateValues
393
+ }
394
+ }
395
+ return nil
396
+ }
397
+
398
+ func (x *ListValue) GetUuidValues() *UuidValues {
399
+ if x != nil {
400
+ if x, ok := x.Kind.(*ListValue_UuidValues); ok {
401
+ return x.UuidValues
402
+ }
403
+ }
404
+ return nil
405
+ }
406
+
407
+ func (x *ListValue) GetIntValues() *IntValues {
408
+ if x != nil {
409
+ if x, ok := x.Kind.(*ListValue_IntValues); ok {
410
+ return x.IntValues
411
+ }
412
+ }
413
+ return nil
414
+ }
415
+
416
+ func (x *ListValue) GetTextValues() *TextValues {
417
+ if x != nil {
418
+ if x, ok := x.Kind.(*ListValue_TextValues); ok {
419
+ return x.TextValues
420
+ }
421
+ }
422
+ return nil
423
+ }
424
+
425
+ type isListValue_Kind interface {
426
+ isListValue_Kind()
427
+ }
428
+
429
+ type ListValue_NumberValues struct {
430
+ NumberValues *NumberValues `protobuf:"bytes,2,opt,name=number_values,json=numberValues,proto3,oneof"`
431
+ }
432
+
433
+ type ListValue_BoolValues struct {
434
+ BoolValues *BoolValues `protobuf:"bytes,3,opt,name=bool_values,json=boolValues,proto3,oneof"`
435
+ }
436
+
437
+ type ListValue_ObjectValues struct {
438
+ ObjectValues *ObjectValues `protobuf:"bytes,4,opt,name=object_values,json=objectValues,proto3,oneof"`
439
+ }
440
+
441
+ type ListValue_DateValues struct {
442
+ DateValues *DateValues `protobuf:"bytes,5,opt,name=date_values,json=dateValues,proto3,oneof"`
443
+ }
444
+
445
+ type ListValue_UuidValues struct {
446
+ UuidValues *UuidValues `protobuf:"bytes,6,opt,name=uuid_values,json=uuidValues,proto3,oneof"`
447
+ }
448
+
449
+ type ListValue_IntValues struct {
450
+ IntValues *IntValues `protobuf:"bytes,7,opt,name=int_values,json=intValues,proto3,oneof"`
451
+ }
452
+
453
+ type ListValue_TextValues struct {
454
+ TextValues *TextValues `protobuf:"bytes,8,opt,name=text_values,json=textValues,proto3,oneof"`
455
+ }
456
+
457
+ func (*ListValue_NumberValues) isListValue_Kind() {}
458
+
459
+ func (*ListValue_BoolValues) isListValue_Kind() {}
460
+
461
+ func (*ListValue_ObjectValues) isListValue_Kind() {}
462
+
463
+ func (*ListValue_DateValues) isListValue_Kind() {}
464
+
465
+ func (*ListValue_UuidValues) isListValue_Kind() {}
466
+
467
+ func (*ListValue_IntValues) isListValue_Kind() {}
468
+
469
+ func (*ListValue_TextValues) isListValue_Kind() {}
470
+
471
+ type NumberValues struct {
472
+ state protoimpl.MessageState `protogen:"open.v1"`
473
+ // *
474
+ // The values are stored as a byte array, where each 8 bytes represent a single float64 value.
475
+ // The byte array is stored in little-endian order using uint64 encoding.
476
+ Values []byte `protobuf:"bytes,1,opt,name=values,proto3" json:"values,omitempty"`
477
+ unknownFields protoimpl.UnknownFields
478
+ sizeCache protoimpl.SizeCache
479
+ }
480
+
481
+ func (x *NumberValues) Reset() {
482
+ *x = NumberValues{}
483
+ mi := &file_v1_properties_proto_msgTypes[3]
484
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
485
+ ms.StoreMessageInfo(mi)
486
+ }
487
+
488
+ func (x *NumberValues) String() string {
489
+ return protoimpl.X.MessageStringOf(x)
490
+ }
491
+
492
+ func (*NumberValues) ProtoMessage() {}
493
+
494
+ func (x *NumberValues) ProtoReflect() protoreflect.Message {
495
+ mi := &file_v1_properties_proto_msgTypes[3]
496
+ if x != nil {
497
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
498
+ if ms.LoadMessageInfo() == nil {
499
+ ms.StoreMessageInfo(mi)
500
+ }
501
+ return ms
502
+ }
503
+ return mi.MessageOf(x)
504
+ }
505
+
506
+ // Deprecated: Use NumberValues.ProtoReflect.Descriptor instead.
507
+ func (*NumberValues) Descriptor() ([]byte, []int) {
508
+ return file_v1_properties_proto_rawDescGZIP(), []int{3}
509
+ }
510
+
511
+ func (x *NumberValues) GetValues() []byte {
512
+ if x != nil {
513
+ return x.Values
514
+ }
515
+ return nil
516
+ }
517
+
518
+ type TextValues struct {
519
+ state protoimpl.MessageState `protogen:"open.v1"`
520
+ Values []string `protobuf:"bytes,1,rep,name=values,proto3" json:"values,omitempty"`
521
+ unknownFields protoimpl.UnknownFields
522
+ sizeCache protoimpl.SizeCache
523
+ }
524
+
525
+ func (x *TextValues) Reset() {
526
+ *x = TextValues{}
527
+ mi := &file_v1_properties_proto_msgTypes[4]
528
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
529
+ ms.StoreMessageInfo(mi)
530
+ }
531
+
532
+ func (x *TextValues) String() string {
533
+ return protoimpl.X.MessageStringOf(x)
534
+ }
535
+
536
+ func (*TextValues) ProtoMessage() {}
537
+
538
+ func (x *TextValues) ProtoReflect() protoreflect.Message {
539
+ mi := &file_v1_properties_proto_msgTypes[4]
540
+ if x != nil {
541
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
542
+ if ms.LoadMessageInfo() == nil {
543
+ ms.StoreMessageInfo(mi)
544
+ }
545
+ return ms
546
+ }
547
+ return mi.MessageOf(x)
548
+ }
549
+
550
+ // Deprecated: Use TextValues.ProtoReflect.Descriptor instead.
551
+ func (*TextValues) Descriptor() ([]byte, []int) {
552
+ return file_v1_properties_proto_rawDescGZIP(), []int{4}
553
+ }
554
+
555
+ func (x *TextValues) GetValues() []string {
556
+ if x != nil {
557
+ return x.Values
558
+ }
559
+ return nil
560
+ }
561
+
562
+ type BoolValues struct {
563
+ state protoimpl.MessageState `protogen:"open.v1"`
564
+ Values []bool `protobuf:"varint,1,rep,packed,name=values,proto3" json:"values,omitempty"`
565
+ unknownFields protoimpl.UnknownFields
566
+ sizeCache protoimpl.SizeCache
567
+ }
568
+
569
+ func (x *BoolValues) Reset() {
570
+ *x = BoolValues{}
571
+ mi := &file_v1_properties_proto_msgTypes[5]
572
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
573
+ ms.StoreMessageInfo(mi)
574
+ }
575
+
576
+ func (x *BoolValues) String() string {
577
+ return protoimpl.X.MessageStringOf(x)
578
+ }
579
+
580
+ func (*BoolValues) ProtoMessage() {}
581
+
582
+ func (x *BoolValues) ProtoReflect() protoreflect.Message {
583
+ mi := &file_v1_properties_proto_msgTypes[5]
584
+ if x != nil {
585
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
586
+ if ms.LoadMessageInfo() == nil {
587
+ ms.StoreMessageInfo(mi)
588
+ }
589
+ return ms
590
+ }
591
+ return mi.MessageOf(x)
592
+ }
593
+
594
+ // Deprecated: Use BoolValues.ProtoReflect.Descriptor instead.
595
+ func (*BoolValues) Descriptor() ([]byte, []int) {
596
+ return file_v1_properties_proto_rawDescGZIP(), []int{5}
597
+ }
598
+
599
+ func (x *BoolValues) GetValues() []bool {
600
+ if x != nil {
601
+ return x.Values
602
+ }
603
+ return nil
604
+ }
605
+
606
+ type ObjectValues struct {
607
+ state protoimpl.MessageState `protogen:"open.v1"`
608
+ Values []*Properties `protobuf:"bytes,1,rep,name=values,proto3" json:"values,omitempty"`
609
+ unknownFields protoimpl.UnknownFields
610
+ sizeCache protoimpl.SizeCache
611
+ }
612
+
613
+ func (x *ObjectValues) Reset() {
614
+ *x = ObjectValues{}
615
+ mi := &file_v1_properties_proto_msgTypes[6]
616
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
617
+ ms.StoreMessageInfo(mi)
618
+ }
619
+
620
+ func (x *ObjectValues) String() string {
621
+ return protoimpl.X.MessageStringOf(x)
622
+ }
623
+
624
+ func (*ObjectValues) ProtoMessage() {}
625
+
626
+ func (x *ObjectValues) ProtoReflect() protoreflect.Message {
627
+ mi := &file_v1_properties_proto_msgTypes[6]
628
+ if x != nil {
629
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
630
+ if ms.LoadMessageInfo() == nil {
631
+ ms.StoreMessageInfo(mi)
632
+ }
633
+ return ms
634
+ }
635
+ return mi.MessageOf(x)
636
+ }
637
+
638
+ // Deprecated: Use ObjectValues.ProtoReflect.Descriptor instead.
639
+ func (*ObjectValues) Descriptor() ([]byte, []int) {
640
+ return file_v1_properties_proto_rawDescGZIP(), []int{6}
641
+ }
642
+
643
+ func (x *ObjectValues) GetValues() []*Properties {
644
+ if x != nil {
645
+ return x.Values
646
+ }
647
+ return nil
648
+ }
649
+
650
+ type DateValues struct {
651
+ state protoimpl.MessageState `protogen:"open.v1"`
652
+ Values []string `protobuf:"bytes,1,rep,name=values,proto3" json:"values,omitempty"`
653
+ unknownFields protoimpl.UnknownFields
654
+ sizeCache protoimpl.SizeCache
655
+ }
656
+
657
+ func (x *DateValues) Reset() {
658
+ *x = DateValues{}
659
+ mi := &file_v1_properties_proto_msgTypes[7]
660
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
661
+ ms.StoreMessageInfo(mi)
662
+ }
663
+
664
+ func (x *DateValues) String() string {
665
+ return protoimpl.X.MessageStringOf(x)
666
+ }
667
+
668
+ func (*DateValues) ProtoMessage() {}
669
+
670
+ func (x *DateValues) ProtoReflect() protoreflect.Message {
671
+ mi := &file_v1_properties_proto_msgTypes[7]
672
+ if x != nil {
673
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
674
+ if ms.LoadMessageInfo() == nil {
675
+ ms.StoreMessageInfo(mi)
676
+ }
677
+ return ms
678
+ }
679
+ return mi.MessageOf(x)
680
+ }
681
+
682
+ // Deprecated: Use DateValues.ProtoReflect.Descriptor instead.
683
+ func (*DateValues) Descriptor() ([]byte, []int) {
684
+ return file_v1_properties_proto_rawDescGZIP(), []int{7}
685
+ }
686
+
687
+ func (x *DateValues) GetValues() []string {
688
+ if x != nil {
689
+ return x.Values
690
+ }
691
+ return nil
692
+ }
693
+
694
+ type UuidValues struct {
695
+ state protoimpl.MessageState `protogen:"open.v1"`
696
+ Values []string `protobuf:"bytes,1,rep,name=values,proto3" json:"values,omitempty"`
697
+ unknownFields protoimpl.UnknownFields
698
+ sizeCache protoimpl.SizeCache
699
+ }
700
+
701
+ func (x *UuidValues) Reset() {
702
+ *x = UuidValues{}
703
+ mi := &file_v1_properties_proto_msgTypes[8]
704
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
705
+ ms.StoreMessageInfo(mi)
706
+ }
707
+
708
+ func (x *UuidValues) String() string {
709
+ return protoimpl.X.MessageStringOf(x)
710
+ }
711
+
712
+ func (*UuidValues) ProtoMessage() {}
713
+
714
+ func (x *UuidValues) ProtoReflect() protoreflect.Message {
715
+ mi := &file_v1_properties_proto_msgTypes[8]
716
+ if x != nil {
717
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
718
+ if ms.LoadMessageInfo() == nil {
719
+ ms.StoreMessageInfo(mi)
720
+ }
721
+ return ms
722
+ }
723
+ return mi.MessageOf(x)
724
+ }
725
+
726
+ // Deprecated: Use UuidValues.ProtoReflect.Descriptor instead.
727
+ func (*UuidValues) Descriptor() ([]byte, []int) {
728
+ return file_v1_properties_proto_rawDescGZIP(), []int{8}
729
+ }
730
+
731
+ func (x *UuidValues) GetValues() []string {
732
+ if x != nil {
733
+ return x.Values
734
+ }
735
+ return nil
736
+ }
737
+
738
+ type IntValues struct {
739
+ state protoimpl.MessageState `protogen:"open.v1"`
740
+ // *
741
+ // The values are stored as a byte array, where each 8 bytes represent a single int64 value.
742
+ // The byte array is stored in little-endian order using uint64 encoding.
743
+ Values []byte `protobuf:"bytes,1,opt,name=values,proto3" json:"values,omitempty"`
744
+ unknownFields protoimpl.UnknownFields
745
+ sizeCache protoimpl.SizeCache
746
+ }
747
+
748
+ func (x *IntValues) Reset() {
749
+ *x = IntValues{}
750
+ mi := &file_v1_properties_proto_msgTypes[9]
751
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
752
+ ms.StoreMessageInfo(mi)
753
+ }
754
+
755
+ func (x *IntValues) String() string {
756
+ return protoimpl.X.MessageStringOf(x)
757
+ }
758
+
759
+ func (*IntValues) ProtoMessage() {}
760
+
761
+ func (x *IntValues) ProtoReflect() protoreflect.Message {
762
+ mi := &file_v1_properties_proto_msgTypes[9]
763
+ if x != nil {
764
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
765
+ if ms.LoadMessageInfo() == nil {
766
+ ms.StoreMessageInfo(mi)
767
+ }
768
+ return ms
769
+ }
770
+ return mi.MessageOf(x)
771
+ }
772
+
773
+ // Deprecated: Use IntValues.ProtoReflect.Descriptor instead.
774
+ func (*IntValues) Descriptor() ([]byte, []int) {
775
+ return file_v1_properties_proto_rawDescGZIP(), []int{9}
776
+ }
777
+
778
+ func (x *IntValues) GetValues() []byte {
779
+ if x != nil {
780
+ return x.Values
781
+ }
782
+ return nil
783
+ }
784
+
785
+ type GeoCoordinate struct {
786
+ state protoimpl.MessageState `protogen:"open.v1"`
787
+ Longitude float32 `protobuf:"fixed32,1,opt,name=longitude,proto3" json:"longitude,omitempty"`
788
+ Latitude float32 `protobuf:"fixed32,2,opt,name=latitude,proto3" json:"latitude,omitempty"`
789
+ unknownFields protoimpl.UnknownFields
790
+ sizeCache protoimpl.SizeCache
791
+ }
792
+
793
+ func (x *GeoCoordinate) Reset() {
794
+ *x = GeoCoordinate{}
795
+ mi := &file_v1_properties_proto_msgTypes[10]
796
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
797
+ ms.StoreMessageInfo(mi)
798
+ }
799
+
800
+ func (x *GeoCoordinate) String() string {
801
+ return protoimpl.X.MessageStringOf(x)
802
+ }
803
+
804
+ func (*GeoCoordinate) ProtoMessage() {}
805
+
806
+ func (x *GeoCoordinate) ProtoReflect() protoreflect.Message {
807
+ mi := &file_v1_properties_proto_msgTypes[10]
808
+ if x != nil {
809
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
810
+ if ms.LoadMessageInfo() == nil {
811
+ ms.StoreMessageInfo(mi)
812
+ }
813
+ return ms
814
+ }
815
+ return mi.MessageOf(x)
816
+ }
817
+
818
+ // Deprecated: Use GeoCoordinate.ProtoReflect.Descriptor instead.
819
+ func (*GeoCoordinate) Descriptor() ([]byte, []int) {
820
+ return file_v1_properties_proto_rawDescGZIP(), []int{10}
821
+ }
822
+
823
+ func (x *GeoCoordinate) GetLongitude() float32 {
824
+ if x != nil {
825
+ return x.Longitude
826
+ }
827
+ return 0
828
+ }
829
+
830
+ func (x *GeoCoordinate) GetLatitude() float32 {
831
+ if x != nil {
832
+ return x.Latitude
833
+ }
834
+ return 0
835
+ }
836
+
837
+ type PhoneNumber struct {
838
+ state protoimpl.MessageState `protogen:"open.v1"`
839
+ CountryCode uint64 `protobuf:"varint,1,opt,name=country_code,json=countryCode,proto3" json:"country_code,omitempty"`
840
+ DefaultCountry string `protobuf:"bytes,2,opt,name=default_country,json=defaultCountry,proto3" json:"default_country,omitempty"`
841
+ Input string `protobuf:"bytes,3,opt,name=input,proto3" json:"input,omitempty"`
842
+ InternationalFormatted string `protobuf:"bytes,4,opt,name=international_formatted,json=internationalFormatted,proto3" json:"international_formatted,omitempty"`
843
+ National uint64 `protobuf:"varint,5,opt,name=national,proto3" json:"national,omitempty"`
844
+ NationalFormatted string `protobuf:"bytes,6,opt,name=national_formatted,json=nationalFormatted,proto3" json:"national_formatted,omitempty"`
845
+ Valid bool `protobuf:"varint,7,opt,name=valid,proto3" json:"valid,omitempty"`
846
+ unknownFields protoimpl.UnknownFields
847
+ sizeCache protoimpl.SizeCache
848
+ }
849
+
850
+ func (x *PhoneNumber) Reset() {
851
+ *x = PhoneNumber{}
852
+ mi := &file_v1_properties_proto_msgTypes[11]
853
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
854
+ ms.StoreMessageInfo(mi)
855
+ }
856
+
857
+ func (x *PhoneNumber) String() string {
858
+ return protoimpl.X.MessageStringOf(x)
859
+ }
860
+
861
+ func (*PhoneNumber) ProtoMessage() {}
862
+
863
+ func (x *PhoneNumber) ProtoReflect() protoreflect.Message {
864
+ mi := &file_v1_properties_proto_msgTypes[11]
865
+ if x != nil {
866
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
867
+ if ms.LoadMessageInfo() == nil {
868
+ ms.StoreMessageInfo(mi)
869
+ }
870
+ return ms
871
+ }
872
+ return mi.MessageOf(x)
873
+ }
874
+
875
+ // Deprecated: Use PhoneNumber.ProtoReflect.Descriptor instead.
876
+ func (*PhoneNumber) Descriptor() ([]byte, []int) {
877
+ return file_v1_properties_proto_rawDescGZIP(), []int{11}
878
+ }
879
+
880
+ func (x *PhoneNumber) GetCountryCode() uint64 {
881
+ if x != nil {
882
+ return x.CountryCode
883
+ }
884
+ return 0
885
+ }
886
+
887
+ func (x *PhoneNumber) GetDefaultCountry() string {
888
+ if x != nil {
889
+ return x.DefaultCountry
890
+ }
891
+ return ""
892
+ }
893
+
894
+ func (x *PhoneNumber) GetInput() string {
895
+ if x != nil {
896
+ return x.Input
897
+ }
898
+ return ""
899
+ }
900
+
901
+ func (x *PhoneNumber) GetInternationalFormatted() string {
902
+ if x != nil {
903
+ return x.InternationalFormatted
904
+ }
905
+ return ""
906
+ }
907
+
908
+ func (x *PhoneNumber) GetNational() uint64 {
909
+ if x != nil {
910
+ return x.National
911
+ }
912
+ return 0
913
+ }
914
+
915
+ func (x *PhoneNumber) GetNationalFormatted() string {
916
+ if x != nil {
917
+ return x.NationalFormatted
918
+ }
919
+ return ""
920
+ }
921
+
922
+ func (x *PhoneNumber) GetValid() bool {
923
+ if x != nil {
924
+ return x.Valid
925
+ }
926
+ return false
927
+ }
928
+
929
+ var File_v1_properties_proto protoreflect.FileDescriptor
930
+
931
+ const file_v1_properties_proto_rawDesc = "" +
932
+ "\n" +
933
+ "\x13v1/properties.proto\x12\vweaviate.v1\x1a\x1cgoogle/protobuf/struct.proto\"\x98\x01\n" +
934
+ "\n" +
935
+ "Properties\x12;\n" +
936
+ "\x06fields\x18\x01 \x03(\v2#.weaviate.v1.Properties.FieldsEntryR\x06fields\x1aM\n" +
937
+ "\vFieldsEntry\x12\x10\n" +
938
+ "\x03key\x18\x01 \x01(\tR\x03key\x12(\n" +
939
+ "\x05value\x18\x02 \x01(\v2\x12.weaviate.v1.ValueR\x05value:\x028\x01\"\xa4\x04\n" +
940
+ "\x05Value\x12#\n" +
941
+ "\fnumber_value\x18\x01 \x01(\x01H\x00R\vnumberValue\x12\x1f\n" +
942
+ "\n" +
943
+ "bool_value\x18\x03 \x01(\bH\x00R\tboolValue\x12<\n" +
944
+ "\fobject_value\x18\x04 \x01(\v2\x17.weaviate.v1.PropertiesH\x00R\vobjectValue\x127\n" +
945
+ "\n" +
946
+ "list_value\x18\x05 \x01(\v2\x16.weaviate.v1.ListValueH\x00R\tlistValue\x12\x1f\n" +
947
+ "\n" +
948
+ "date_value\x18\x06 \x01(\tH\x00R\tdateValue\x12\x1f\n" +
949
+ "\n" +
950
+ "uuid_value\x18\a \x01(\tH\x00R\tuuidValue\x12\x1d\n" +
951
+ "\tint_value\x18\b \x01(\x03H\x00R\bintValue\x129\n" +
952
+ "\tgeo_value\x18\t \x01(\v2\x1a.weaviate.v1.GeoCoordinateH\x00R\bgeoValue\x12\x1f\n" +
953
+ "\n" +
954
+ "blob_value\x18\n" +
955
+ " \x01(\tH\x00R\tblobValue\x12;\n" +
956
+ "\vphone_value\x18\v \x01(\v2\x18.weaviate.v1.PhoneNumberH\x00R\n" +
957
+ "phoneValue\x12;\n" +
958
+ "\n" +
959
+ "null_value\x18\f \x01(\x0e2\x1a.google.protobuf.NullValueH\x00R\tnullValue\x12\x1f\n" +
960
+ "\n" +
961
+ "text_value\x18\r \x01(\tH\x00R\ttextValueB\x06\n" +
962
+ "\x04kind\"\xc6\x03\n" +
963
+ "\tListValue\x12@\n" +
964
+ "\rnumber_values\x18\x02 \x01(\v2\x19.weaviate.v1.NumberValuesH\x00R\fnumberValues\x12:\n" +
965
+ "\vbool_values\x18\x03 \x01(\v2\x17.weaviate.v1.BoolValuesH\x00R\n" +
966
+ "boolValues\x12@\n" +
967
+ "\robject_values\x18\x04 \x01(\v2\x19.weaviate.v1.ObjectValuesH\x00R\fobjectValues\x12:\n" +
968
+ "\vdate_values\x18\x05 \x01(\v2\x17.weaviate.v1.DateValuesH\x00R\n" +
969
+ "dateValues\x12:\n" +
970
+ "\vuuid_values\x18\x06 \x01(\v2\x17.weaviate.v1.UuidValuesH\x00R\n" +
971
+ "uuidValues\x127\n" +
972
+ "\n" +
973
+ "int_values\x18\a \x01(\v2\x16.weaviate.v1.IntValuesH\x00R\tintValues\x12:\n" +
974
+ "\vtext_values\x18\b \x01(\v2\x17.weaviate.v1.TextValuesH\x00R\n" +
975
+ "textValuesB\x06\n" +
976
+ "\x04kindJ\x04\b\x01\x10\x02\"&\n" +
977
+ "\fNumberValues\x12\x16\n" +
978
+ "\x06values\x18\x01 \x01(\fR\x06values\"$\n" +
979
+ "\n" +
980
+ "TextValues\x12\x16\n" +
981
+ "\x06values\x18\x01 \x03(\tR\x06values\"$\n" +
982
+ "\n" +
983
+ "BoolValues\x12\x16\n" +
984
+ "\x06values\x18\x01 \x03(\bR\x06values\"?\n" +
985
+ "\fObjectValues\x12/\n" +
986
+ "\x06values\x18\x01 \x03(\v2\x17.weaviate.v1.PropertiesR\x06values\"$\n" +
987
+ "\n" +
988
+ "DateValues\x12\x16\n" +
989
+ "\x06values\x18\x01 \x03(\tR\x06values\"$\n" +
990
+ "\n" +
991
+ "UuidValues\x12\x16\n" +
992
+ "\x06values\x18\x01 \x03(\tR\x06values\"#\n" +
993
+ "\tIntValues\x12\x16\n" +
994
+ "\x06values\x18\x01 \x01(\fR\x06values\"I\n" +
995
+ "\rGeoCoordinate\x12\x1c\n" +
996
+ "\tlongitude\x18\x01 \x01(\x02R\tlongitude\x12\x1a\n" +
997
+ "\blatitude\x18\x02 \x01(\x02R\blatitude\"\x89\x02\n" +
998
+ "\vPhoneNumber\x12!\n" +
999
+ "\fcountry_code\x18\x01 \x01(\x04R\vcountryCode\x12'\n" +
1000
+ "\x0fdefault_country\x18\x02 \x01(\tR\x0edefaultCountry\x12\x14\n" +
1001
+ "\x05input\x18\x03 \x01(\tR\x05input\x127\n" +
1002
+ "\x17international_formatted\x18\x04 \x01(\tR\x16internationalFormatted\x12\x1a\n" +
1003
+ "\bnational\x18\x05 \x01(\x04R\bnational\x12-\n" +
1004
+ "\x12national_formatted\x18\x06 \x01(\tR\x11nationalFormatted\x12\x14\n" +
1005
+ "\x05valid\x18\a \x01(\bR\x05validBt\n" +
1006
+ "#io.weaviate.client.grpc.protocol.v1B\x17WeaviateProtoPropertiesZ4github.com/weaviate/weaviate/grpc/generated;protocolb\x06proto3"
1007
+
1008
+ var (
1009
+ file_v1_properties_proto_rawDescOnce sync.Once
1010
+ file_v1_properties_proto_rawDescData []byte
1011
+ )
1012
+
1013
+ func file_v1_properties_proto_rawDescGZIP() []byte {
1014
+ file_v1_properties_proto_rawDescOnce.Do(func() {
1015
+ file_v1_properties_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_v1_properties_proto_rawDesc), len(file_v1_properties_proto_rawDesc)))
1016
+ })
1017
+ return file_v1_properties_proto_rawDescData
1018
+ }
1019
+
1020
+ var file_v1_properties_proto_msgTypes = make([]protoimpl.MessageInfo, 13)
1021
+ var file_v1_properties_proto_goTypes = []any{
1022
+ (*Properties)(nil), // 0: weaviate.v1.Properties
1023
+ (*Value)(nil), // 1: weaviate.v1.Value
1024
+ (*ListValue)(nil), // 2: weaviate.v1.ListValue
1025
+ (*NumberValues)(nil), // 3: weaviate.v1.NumberValues
1026
+ (*TextValues)(nil), // 4: weaviate.v1.TextValues
1027
+ (*BoolValues)(nil), // 5: weaviate.v1.BoolValues
1028
+ (*ObjectValues)(nil), // 6: weaviate.v1.ObjectValues
1029
+ (*DateValues)(nil), // 7: weaviate.v1.DateValues
1030
+ (*UuidValues)(nil), // 8: weaviate.v1.UuidValues
1031
+ (*IntValues)(nil), // 9: weaviate.v1.IntValues
1032
+ (*GeoCoordinate)(nil), // 10: weaviate.v1.GeoCoordinate
1033
+ (*PhoneNumber)(nil), // 11: weaviate.v1.PhoneNumber
1034
+ nil, // 12: weaviate.v1.Properties.FieldsEntry
1035
+ (structpb.NullValue)(0), // 13: google.protobuf.NullValue
1036
+ }
1037
+ var file_v1_properties_proto_depIdxs = []int32{
1038
+ 12, // 0: weaviate.v1.Properties.fields:type_name -> weaviate.v1.Properties.FieldsEntry
1039
+ 0, // 1: weaviate.v1.Value.object_value:type_name -> weaviate.v1.Properties
1040
+ 2, // 2: weaviate.v1.Value.list_value:type_name -> weaviate.v1.ListValue
1041
+ 10, // 3: weaviate.v1.Value.geo_value:type_name -> weaviate.v1.GeoCoordinate
1042
+ 11, // 4: weaviate.v1.Value.phone_value:type_name -> weaviate.v1.PhoneNumber
1043
+ 13, // 5: weaviate.v1.Value.null_value:type_name -> google.protobuf.NullValue
1044
+ 3, // 6: weaviate.v1.ListValue.number_values:type_name -> weaviate.v1.NumberValues
1045
+ 5, // 7: weaviate.v1.ListValue.bool_values:type_name -> weaviate.v1.BoolValues
1046
+ 6, // 8: weaviate.v1.ListValue.object_values:type_name -> weaviate.v1.ObjectValues
1047
+ 7, // 9: weaviate.v1.ListValue.date_values:type_name -> weaviate.v1.DateValues
1048
+ 8, // 10: weaviate.v1.ListValue.uuid_values:type_name -> weaviate.v1.UuidValues
1049
+ 9, // 11: weaviate.v1.ListValue.int_values:type_name -> weaviate.v1.IntValues
1050
+ 4, // 12: weaviate.v1.ListValue.text_values:type_name -> weaviate.v1.TextValues
1051
+ 0, // 13: weaviate.v1.ObjectValues.values:type_name -> weaviate.v1.Properties
1052
+ 1, // 14: weaviate.v1.Properties.FieldsEntry.value:type_name -> weaviate.v1.Value
1053
+ 15, // [15:15] is the sub-list for method output_type
1054
+ 15, // [15:15] is the sub-list for method input_type
1055
+ 15, // [15:15] is the sub-list for extension type_name
1056
+ 15, // [15:15] is the sub-list for extension extendee
1057
+ 0, // [0:15] is the sub-list for field type_name
1058
+ }
1059
+
1060
+ func init() { file_v1_properties_proto_init() }
1061
+ func file_v1_properties_proto_init() {
1062
+ if File_v1_properties_proto != nil {
1063
+ return
1064
+ }
1065
+ file_v1_properties_proto_msgTypes[1].OneofWrappers = []any{
1066
+ (*Value_NumberValue)(nil),
1067
+ (*Value_BoolValue)(nil),
1068
+ (*Value_ObjectValue)(nil),
1069
+ (*Value_ListValue)(nil),
1070
+ (*Value_DateValue)(nil),
1071
+ (*Value_UuidValue)(nil),
1072
+ (*Value_IntValue)(nil),
1073
+ (*Value_GeoValue)(nil),
1074
+ (*Value_BlobValue)(nil),
1075
+ (*Value_PhoneValue)(nil),
1076
+ (*Value_NullValue)(nil),
1077
+ (*Value_TextValue)(nil),
1078
+ }
1079
+ file_v1_properties_proto_msgTypes[2].OneofWrappers = []any{
1080
+ (*ListValue_NumberValues)(nil),
1081
+ (*ListValue_BoolValues)(nil),
1082
+ (*ListValue_ObjectValues)(nil),
1083
+ (*ListValue_DateValues)(nil),
1084
+ (*ListValue_UuidValues)(nil),
1085
+ (*ListValue_IntValues)(nil),
1086
+ (*ListValue_TextValues)(nil),
1087
+ }
1088
+ type x struct{}
1089
+ out := protoimpl.TypeBuilder{
1090
+ File: protoimpl.DescBuilder{
1091
+ GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
1092
+ RawDescriptor: unsafe.Slice(unsafe.StringData(file_v1_properties_proto_rawDesc), len(file_v1_properties_proto_rawDesc)),
1093
+ NumEnums: 0,
1094
+ NumMessages: 13,
1095
+ NumExtensions: 0,
1096
+ NumServices: 0,
1097
+ },
1098
+ GoTypes: file_v1_properties_proto_goTypes,
1099
+ DependencyIndexes: file_v1_properties_proto_depIdxs,
1100
+ MessageInfos: file_v1_properties_proto_msgTypes,
1101
+ }.Build()
1102
+ File_v1_properties_proto = out.File
1103
+ file_v1_properties_proto_goTypes = nil
1104
+ file_v1_properties_proto_depIdxs = nil
1105
+ }