Skip to content
Merged
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.1"]
["1.32.24", "1.33.11", "1.34.7", "1.35.2", "1.36.9", "1.37.2"]
Comment thread
g-despot marked this conversation as resolved.
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6

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, 1);
V137(1, 37, 2);

public final SemanticVersion semver;

Expand Down
63 changes: 63 additions & 0 deletions src/it/java/io/weaviate/integration/CollectionsITest.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
import io.weaviate.client6.v1.api.collections.Quantization;
import io.weaviate.client6.v1.api.collections.ReferenceProperty;
import io.weaviate.client6.v1.api.collections.Replication;
import io.weaviate.client6.v1.api.collections.TextAnalyzer;
import io.weaviate.client6.v1.api.collections.Tokenization;
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;
Expand Down Expand Up @@ -399,6 +401,67 @@ public void test_dropVectorIndex() throws IOException {
.matches(VectorIndex::isNone).as("is 'none'");
}

@Test
public void testTextAnalyzer() throws Exception {
Weaviate.Version.V137.orSkip();

var nsTextAnalyzer = ns("TextAnalyzer");
var textAnalyzer = client.collections.create(nsTextAnalyzer, c -> c
.properties(
Property.text("text_default",
p -> p.tokenization(Tokenization.WORD)),
Property.text("text_folded",
p -> p.tokenization(Tokenization.WORD)
.textAnalyzer(TextAnalyzer.of(t -> t.foldAscii(true)))),
Property.text("text_folded_keep_e",
p -> p.tokenization(Tokenization.WORD)
.textAnalyzer(TextAnalyzer.of(t -> t
.foldAscii(true)
.keepAscii("é")))),
Property.text("name_en",
p -> p.tokenization(Tokenization.WORD)
.textAnalyzer(TextAnalyzer.of(t -> t.stopwordPreset("en")))),
Property.text("name_none",
p -> p.tokenization(Tokenization.WORD)
.textAnalyzer(TextAnalyzer.of(t -> t.stopwordPreset("none"))))));

Assertions.assertThat(textAnalyzer.config.get())
.get()
.extracting(CollectionConfig::properties, InstanceOfAssertFactories.list(Property.class))
.allSatisfy(property -> {
var analyzer = property.textAnalyzer();
switch (property.propertyName()) {
case "text_default":
Assertions.assertThat(analyzer)
.as("default property has no textAnalyzer config")
.isNull();
break;
case "text_folded":
Assertions.assertThat(analyzer)
.as("text_folded persists asciiFold=true")
.returns(true, TextAnalyzer::foldAscii);
break;
case "text_folded_keep_e":
Assertions.assertThat(analyzer)
.as("text_folded_keep_e persists asciiFold=true and asciiFoldIgnore=[é]")
.returns(true, TextAnalyzer::foldAscii)
.extracting(TextAnalyzer::keepAscii, InstanceOfAssertFactories.list(String.class))
.containsExactly("é");
break;
case "name_en":
Assertions.assertThat(analyzer)
.as("name_en persists stopwordPreset=en")
.returns("en", TextAnalyzer::stopwordPreset);
break;
case "name_none":
Assertions.assertThat(analyzer)
.as("name_none persists stopwordPreset=none")
.returns("none", TextAnalyzer::stopwordPreset);
break;
}
});
}

@Test
public void test_asyncReplicationConfig() throws IOException {
Weaviate.Version.latest().orSkip();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
import io.weaviate.client6.v1.internal.ObjectBuilder;

public record TextAnalyzer(
@SerializedName("ascii_fold") Boolean foldAscii,
@SerializedName("ascii_fold_ignore") List<String> keepAscii,
@SerializedName("stopword_preset") String stopwordPreset) {
@SerializedName("asciiFold") Boolean foldAscii,
@SerializedName("asciiFoldIgnore") List<String> keepAscii,
@SerializedName("stopwordPreset") String stopwordPreset) {

public static TextAnalyzer of() {
return null;
Expand Down
Loading