Skip to content

Commit 685441a

Browse files
committed
Merge branch 'master' into marc/build-cleanup
# Conflicts: # src/NRedisStack/Search/FieldName.cs # src/NRedisStack/Search/Schema.cs # src/NRedisStack/SerializedCommand.cs # tests/NRedisStack.Tests/AbstractNRedisStackTest.cs # tests/NRedisStack.Tests/Search/IndexCreationTests.cs
2 parents 05abfff + 54403c7 commit 685441a

File tree

6 files changed

+503
-50
lines changed

6 files changed

+503
-50
lines changed

src/NRedisStack/PublicAPI/PublicAPI.Unshipped.txt

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,63 @@
11
#nullable enable
2+
NRedisStack.Search.Schema.AddFlatVectorField(NRedisStack.Search.FieldName! name, NRedisStack.Search.Schema.VectorField.VectorType type, int dimensions, NRedisStack.Search.Schema.VectorField.VectorDistanceMetric distanceMetric, System.Collections.Generic.Dictionary<string!, object!>? attributes = null, bool missingIndex = false) -> NRedisStack.Search.Schema!
3+
NRedisStack.Search.Schema.AddHnswVectorField(NRedisStack.Search.FieldName! name, NRedisStack.Search.Schema.VectorField.VectorType type, int dimensions, NRedisStack.Search.Schema.VectorField.VectorDistanceMetric distanceMetric, int maxOutgoingConnections = 16, int maxConnectedNeighbors = 200, int maxTopCandidates = 10, double boundaryFactor = 0.01, System.Collections.Generic.Dictionary<string!, object!>? attributes = null, bool missingIndex = false) -> NRedisStack.Search.Schema!
4+
NRedisStack.Search.Schema.AddSvsVanamaVectorField(NRedisStack.Search.FieldName! name, NRedisStack.Search.Schema.VectorField.VectorType type, int dimensions, NRedisStack.Search.Schema.VectorField.VectorDistanceMetric distanceMetric, NRedisStack.Search.Schema.VectorField.VectorCompressionAlgorithm compressionAlgorithm = NRedisStack.Search.Schema.VectorField.VectorCompressionAlgorithm.NotSpecified, int constructionWindowSize = 200, int graphMaxDegree = 32, int searchWindowSize = 10, double rangeSearchApproximationFactor = 0.01, int trainingThreshold = 0, int reducedDimensions = 0, System.Collections.Generic.Dictionary<string!, object!>? attributes = null, bool missingIndex = false) -> NRedisStack.Search.Schema!
5+
NRedisStack.Search.Schema.FlatVectorField
6+
NRedisStack.Search.Schema.FlatVectorField.FlatVectorField(NRedisStack.Search.FieldName! name, NRedisStack.Search.Schema.VectorField.VectorType type, int dimensions, NRedisStack.Search.Schema.VectorField.VectorDistanceMetric distanceMetric, System.Collections.Generic.Dictionary<string!, object!>? attributes = null, bool missingIndex = false) -> void
7+
NRedisStack.Search.Schema.HnswVectorField
8+
NRedisStack.Search.Schema.HnswVectorField.BoundaryFactor.get -> double
9+
NRedisStack.Search.Schema.HnswVectorField.BoundaryFactor.set -> void
10+
NRedisStack.Search.Schema.HnswVectorField.HnswVectorField(NRedisStack.Search.FieldName! name, NRedisStack.Search.Schema.VectorField.VectorType type, int dimensions, NRedisStack.Search.Schema.VectorField.VectorDistanceMetric distanceMetric, System.Collections.Generic.Dictionary<string!, object!>? attributes = null, bool missingIndex = false) -> void
11+
NRedisStack.Search.Schema.HnswVectorField.MaxConnectedNeighbors.get -> int
12+
NRedisStack.Search.Schema.HnswVectorField.MaxConnectedNeighbors.set -> void
13+
NRedisStack.Search.Schema.HnswVectorField.MaxOutgoingConnections.get -> int
14+
NRedisStack.Search.Schema.HnswVectorField.MaxOutgoingConnections.set -> void
15+
NRedisStack.Search.Schema.HnswVectorField.MaxTopCandidates.get -> int
16+
NRedisStack.Search.Schema.HnswVectorField.MaxTopCandidates.set -> void
17+
NRedisStack.Search.Schema.SvsVanamaVectorField
18+
NRedisStack.Search.Schema.SvsVanamaVectorField.CompressionAlgorithm.get -> NRedisStack.Search.Schema.VectorField.VectorCompressionAlgorithm
19+
NRedisStack.Search.Schema.SvsVanamaVectorField.CompressionAlgorithm.set -> void
20+
NRedisStack.Search.Schema.SvsVanamaVectorField.ConstructionWindowSize.get -> int
21+
NRedisStack.Search.Schema.SvsVanamaVectorField.ConstructionWindowSize.set -> void
22+
NRedisStack.Search.Schema.SvsVanamaVectorField.GraphMaxDegree.get -> int
23+
NRedisStack.Search.Schema.SvsVanamaVectorField.GraphMaxDegree.set -> void
24+
NRedisStack.Search.Schema.SvsVanamaVectorField.RangeSearchApproximationFactor.get -> double
25+
NRedisStack.Search.Schema.SvsVanamaVectorField.RangeSearchApproximationFactor.set -> void
26+
NRedisStack.Search.Schema.SvsVanamaVectorField.ReducedDimensions.get -> int
27+
NRedisStack.Search.Schema.SvsVanamaVectorField.ReducedDimensions.set -> void
28+
NRedisStack.Search.Schema.SvsVanamaVectorField.SearchWindowSize.get -> int
29+
NRedisStack.Search.Schema.SvsVanamaVectorField.SearchWindowSize.set -> void
30+
NRedisStack.Search.Schema.SvsVanamaVectorField.SvsVanamaVectorField(NRedisStack.Search.FieldName! name, NRedisStack.Search.Schema.VectorField.VectorType type, int dimensions, NRedisStack.Search.Schema.VectorField.VectorDistanceMetric distanceMetric, System.Collections.Generic.Dictionary<string!, object!>? attributes = null, bool missingIndex = false) -> void
31+
NRedisStack.Search.Schema.SvsVanamaVectorField.TrainingThreshold.get -> int
32+
NRedisStack.Search.Schema.SvsVanamaVectorField.TrainingThreshold.set -> void
33+
NRedisStack.Search.Schema.VectorField.Dimensions.get -> int
34+
NRedisStack.Search.Schema.VectorField.Dimensions.set -> void
35+
NRedisStack.Search.Schema.VectorField.DistanceMetric.get -> NRedisStack.Search.Schema.VectorField.VectorDistanceMetric
36+
NRedisStack.Search.Schema.VectorField.DistanceMetric.set -> void
37+
NRedisStack.Search.Schema.VectorField.Type.get -> NRedisStack.Search.Schema.VectorField.VectorType
38+
NRedisStack.Search.Schema.VectorField.Type.set -> void
39+
NRedisStack.Search.Schema.VectorField.VectorAlgo.SVS_VAMANA = 2 -> NRedisStack.Search.Schema.VectorField.VectorAlgo
40+
NRedisStack.Search.Schema.VectorField.VectorCompressionAlgorithm
41+
NRedisStack.Search.Schema.VectorField.VectorCompressionAlgorithm.LeanVec4x8 = 5 -> NRedisStack.Search.Schema.VectorField.VectorCompressionAlgorithm
42+
NRedisStack.Search.Schema.VectorField.VectorCompressionAlgorithm.LeanVec8x8 = 6 -> NRedisStack.Search.Schema.VectorField.VectorCompressionAlgorithm
43+
NRedisStack.Search.Schema.VectorField.VectorCompressionAlgorithm.LVQ4 = 2 -> NRedisStack.Search.Schema.VectorField.VectorCompressionAlgorithm
44+
NRedisStack.Search.Schema.VectorField.VectorCompressionAlgorithm.LVQ4x4 = 3 -> NRedisStack.Search.Schema.VectorField.VectorCompressionAlgorithm
45+
NRedisStack.Search.Schema.VectorField.VectorCompressionAlgorithm.LVQ4x8 = 4 -> NRedisStack.Search.Schema.VectorField.VectorCompressionAlgorithm
46+
NRedisStack.Search.Schema.VectorField.VectorCompressionAlgorithm.LVQ8 = 1 -> NRedisStack.Search.Schema.VectorField.VectorCompressionAlgorithm
47+
NRedisStack.Search.Schema.VectorField.VectorCompressionAlgorithm.NotSpecified = 0 -> NRedisStack.Search.Schema.VectorField.VectorCompressionAlgorithm
48+
NRedisStack.Search.Schema.VectorField.VectorDistanceMetric
49+
NRedisStack.Search.Schema.VectorField.VectorDistanceMetric.CosineDistance = 3 -> NRedisStack.Search.Schema.VectorField.VectorDistanceMetric
50+
NRedisStack.Search.Schema.VectorField.VectorDistanceMetric.EuclideanDistance = 1 -> NRedisStack.Search.Schema.VectorField.VectorDistanceMetric
51+
NRedisStack.Search.Schema.VectorField.VectorDistanceMetric.InnerProduct = 2 -> NRedisStack.Search.Schema.VectorField.VectorDistanceMetric
52+
NRedisStack.Search.Schema.VectorField.VectorDistanceMetric.NotSpecified = 0 -> NRedisStack.Search.Schema.VectorField.VectorDistanceMetric
53+
NRedisStack.Search.Schema.VectorField.VectorType
54+
NRedisStack.Search.Schema.VectorField.VectorType.BFLOAT16 = 3 -> NRedisStack.Search.Schema.VectorField.VectorType
55+
NRedisStack.Search.Schema.VectorField.VectorType.FLOAT16 = 4 -> NRedisStack.Search.Schema.VectorField.VectorType
56+
NRedisStack.Search.Schema.VectorField.VectorType.FLOAT32 = 1 -> NRedisStack.Search.Schema.VectorField.VectorType
57+
NRedisStack.Search.Schema.VectorField.VectorType.FLOAT64 = 2 -> NRedisStack.Search.Schema.VectorField.VectorType
58+
NRedisStack.Search.Schema.VectorField.VectorType.NotSpecified = 0 -> NRedisStack.Search.Schema.VectorField.VectorType
59+
override NRedisStack.RedisStackCommands.SerializedCommand.ToString() -> string!
60+
static NRedisStack.Search.FieldName.implicit operator NRedisStack.Search.FieldName!(string! name) -> NRedisStack.Search.FieldName!
261
~override NRedisStack.DataTypes.TimeStamp.ToString() -> string
362
~override NRedisStack.DataTypes.TimeStamp.Equals(object obj) -> bool
463
NRedisStack.DataTypes.TimeStamp.Equals(NRedisStack.DataTypes.TimeStamp other) -> bool

src/NRedisStack/RedisStackCommands/SerializedCommand.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,9 @@ public class SerializedCommand(string command, params object[] args)
88
public SerializedCommand(string command, ICollection<object> args) : this(command, args.ToArray())
99
{
1010
}
11+
12+
/// <inheritdoc />
13+
public override string ToString() => Args is { Length: > 0 }
14+
? (Command + " " + string.Join(" ", Args))
15+
: Command;
1116
}
Lines changed: 30 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,40 @@
1-
namespace NRedisStack.Search;
2-
3-
public class FieldName
1+
namespace NRedisStack.Search
42
{
5-
public string Name { get; }
6-
public string? Alias { get; private set; }
7-
8-
public FieldName(string name) : this(name, null) { }
9-
10-
public FieldName(string name, string? attribute)
3+
public class FieldName
114
{
12-
Name = name;
13-
Alias = attribute;
14-
}
5+
public string Name { get; }
6+
public string? Alias { get; private set; }
157

16-
public int AddCommandArguments(List<object> args)
17-
{
18-
args.Add(Name);
19-
if (Alias is null)
8+
public FieldName(string name) : this(name, null) { }
9+
10+
public FieldName(string name, string? attribute)
2011
{
21-
return 1;
12+
this.Name = name;
13+
this.Alias = attribute;
2214
}
2315

24-
args.Add("AS");
25-
args.Add(Alias);
26-
return 3;
27-
}
16+
public int AddCommandArguments(List<object> args)
17+
{
18+
args.Add(Name);
19+
if (Alias is null)
20+
{
21+
return 1;
22+
}
2823

29-
public static FieldName Of(string name)
30-
{
31-
return new(name);
32-
}
24+
args.Add("AS");
25+
args.Add(Alias);
26+
return 3;
27+
}
3328

34-
public FieldName As(string attribute)
35-
{
36-
Alias = attribute;
37-
return this;
29+
public static FieldName Of(string name)
30+
{
31+
return new FieldName(name);
32+
}
33+
34+
public FieldName As(string attribute)
35+
{
36+
this.Alias = attribute;
37+
return this;
38+
}
3839
}
3940
}

0 commit comments

Comments
 (0)