Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ jobs:
fail-fast: false
matrix:
WEAVIATE_VERSION:
["1.32.24", "1.33.11", "1.34.7", "1.35.2", "1.36.9", "1.37.0-rc.0"]
["1.32.24", "1.33.11", "1.34.7", "1.35.2", "1.36.9", "1.37.0-rc.1"]
steps:
- uses: actions/checkout@v4

Expand Down
2 changes: 1 addition & 1 deletion src/it/java/io/weaviate/containers/Weaviate.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public enum Version {
V134(1, 34, 7),
V135(1, 35, 2),
V136(1, 36, 9),
V137(1, 37, "0-rc.0");
V137(1, 37, "0-rc.1");

public final SemanticVersion semver;

Expand Down
4 changes: 3 additions & 1 deletion src/it/java/io/weaviate/integration/CollectionsITest.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import io.weaviate.client6.v1.api.collections.Replication;
import io.weaviate.client6.v1.api.collections.Replication.AsyncReplicationConfig;
import io.weaviate.client6.v1.api.collections.VectorConfig;
import io.weaviate.client6.v1.api.collections.VectorIndex;
import io.weaviate.client6.v1.api.collections.config.PropertyIndexType;
import io.weaviate.client6.v1.api.collections.config.Shard;
import io.weaviate.client6.v1.api.collections.config.ShardStatus;
Expand Down Expand Up @@ -394,7 +395,8 @@ public void test_dropVectorIndex() throws IOException {
.extracting(CollectionConfig::vectors, InstanceOfAssertFactories.map(String.class, VectorConfig.class))
.hasSize(2)
.extractingByKey("dropme")
.returns(null, VectorConfig::vectorIndex); // A dropped index has not vectorIndex configuration.
.extracting(VectorConfig::vectorIndex)
.matches(VectorIndex::isNone).as("is 'none'");
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import java.util.Map;

import com.google.gson.Gson;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import com.google.gson.TypeAdapter;
import com.google.gson.TypeAdapterFactory;
Expand All @@ -17,6 +18,7 @@
import io.weaviate.client6.v1.api.collections.vectorindex.Flat;
import io.weaviate.client6.v1.api.collections.vectorindex.HFresh;
import io.weaviate.client6.v1.api.collections.vectorindex.Hnsw;
import io.weaviate.client6.v1.api.collections.vectorindex.None;
import io.weaviate.client6.v1.internal.TaggedUnion;
import io.weaviate.client6.v1.internal.json.JsonEnum;

Expand All @@ -28,7 +30,8 @@ enum Kind implements JsonEnum<Kind> {
HNSW("hnsw"),
FLAT("flat"),
DYNAMIC("dynamic"),
HFRESH("hfresh");
HFRESH("hfresh"),
NONE("none");

private static final Map<String, Kind> jsonValueMap = JsonEnum.collectNames(Kind.values());
private final String jsonValue;
Expand Down Expand Up @@ -87,6 +90,11 @@ default HFresh asHFresh() {
return _as(VectorIndex.Kind.HFRESH);
}

/** Is this a "none" vector index? */
default boolean isNone() {
return _is(VectorIndex.Kind.NONE);
}

static enum CustomTypeAdapterFactory implements TypeAdapterFactory {
INSTANCE;

Expand All @@ -102,6 +110,7 @@ private final void init(Gson gson) {
addAdapter(gson, VectorIndex.Kind.FLAT, Flat.class);
addAdapter(gson, VectorIndex.Kind.DYNAMIC, Dynamic.class);
addAdapter(gson, VectorIndex.Kind.HFRESH, HFresh.class);
addAdapter(gson, VectorIndex.Kind.NONE, None.class);
}

@SuppressWarnings("unchecked")
Expand Down Expand Up @@ -148,7 +157,7 @@ public VectorIndex read(JsonReader in) throws IOException {
if (vectorIndexConfig == null || vectorIndexConfig.isJsonNull()) {
// VectorConfig.CustomTypeAdapterFactory cannot provide this
// value for vector indexes that have been dropped.
return null;
vectorIndexConfig = new JsonObject();
}

VectorIndex.Kind kind;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package io.weaviate.client6.v1.api.collections.vectorindex;

import io.weaviate.client6.v1.api.collections.VectorIndex;

public record None() implements VectorIndex {
@Override
public VectorIndex.Kind _kind() {
return VectorIndex.Kind.NONE;
}

@Override
public Object _self() {
return this;
}
}
Loading