fix(tokenize): use camelCase @SerializedName values on TextAnalyzer + add round-trip test#568
Open
fix(tokenize): use camelCase @SerializedName values on TextAnalyzer + add round-trip test#568
Conversation
There was a problem hiding this comment.
Orca Security Scan Summary
| Status | Check | Issues by priority | |
|---|---|---|---|
| Infrastructure as Code | View in Orca | ||
| SAST | View in Orca | ||
| Secrets | View in Orca | ||
| Vulnerabilities | View in Orca |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The
TextAnalyzerrecord was annotated with snake_case@SerializedNamevalues (ascii_fold,ascii_fold_ignore,stopword_preset), but Weaviate's REST schema expects camelCase (asciiFold,asciiFoldIgnore,stopwordPreset) — so every per-property analyzer setting was silently dropped on the wire. Verified by comparing the stored schema afterProperty.text(... textAnalyzer(TextAnalyzer.of(t -> t.foldAscii(true).keepAscii("é")))): pre-patch the property comes back with notextAnalyzerfield at all; post-patch it stores{ "asciiFold": true, "asciiFoldIgnore": ["é"] }.This PR flips the three
@SerializedNamevalues to camelCase and addsTextAnalyzerITestcovering both the schema round-trip (collection.config.get()returns the persisted analyzer) and the behavioral effect (acafefilter on a foldedCafé Crèmerow only matches the property withfoldAscii(true)). The new test fails on the snake_case version and passes after the fix — confirmed by toggling locally.Test plan
WEAVIATE_VERSION=1.37.2 mvn verify -Dit.test=TextAnalyzerITest -Dmaven.javadoc.skip=true— passes against the patched record, fails 2/2 when the@SerializedNamevalues are reverted to snake_casepytest -m java_v6 -k "Tokenization or SearchProfile") — green against the patched SNAPSHOT🤖 Generated with Claude Code