feat(synonyms): add support for V30 synonyms#311
Merged
jasonbosco merged 9 commits intotypesense:masterfrom Aug 19, 2025
Merged
feat(synonyms): add support for V30 synonyms#311jasonbosco merged 9 commits intotypesense:masterfrom
jasonbosco merged 9 commits intotypesense:masterfrom
Conversation
- implement SynonymSets class with retrieve method - add SynonymItemSchema and SynonymSetSchema interfaces - support for new /synonym_sets endpoint - prepare for root-level synonym set management
…tions - implement SynonymSet class with upsert, retrieve, and delete methods - add SynonymSetDeleteSchema and SynonymSetRetrieveSchema interfaces
- add SynonymSets and SynonymSet imports and properties - initialize _synonymSets and individualSynonymSets in constructor - implement synonymSets() method with overloaded signatures
- implement isV30OrAbove function for client version detection - support both nightly builds and versioned releases (v30+) - enable conditional test execution based on Typesense version
…ed skipping - extract typesense client initialization outside describe blocks - add isV30OrAbove utility import to all affected test files - implement describe.skipIf for conditional test execution - skip analytics and synonym tests on Typesense v30+ and nightly builds
- implement test coverage for SynonymSets CRUD operations - test upsert, retrieve, and delete methods for individual synonym sets - include collection-level synonym set retrieval testing - add proper setup and cleanup with beforeEach and afterEach hooks - validate synonym set data structure and API responses
jasonbosco
requested changes
Aug 18, 2025
jasonbosco
approved these changes
Aug 19, 2025
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.
TLDR
Introduce Synonym Sets support in the Typesense client with full API integration, test coverage, and example usage.
Changes
Added Features:
Client Support for Synonym Sets (
Client.ts):synonymSets()method added to theClientclass with overloads for retrieving all sets or accessing individual sets by name._synonymSetsandindividualSynonymSetsfor caching and reuse.Synonym Set Management Classes:
SynonymSet.ts: DefinesSynonymSetclass to handle upsert, retrieve, and delete operations for a specific synonym set.SynonymSets.ts: Manages operations for all synonym sets collectively.Collection Schema (
Collection.ts,Collections.ts,Types.ts):synonym_setsarray.synonym_setsis also supported in search parameters for more refined query behavior.Version Detection Utility (
utils.ts):isV30OrAbove()function added to dynamically skip tests based on Typesense version (supports both nightly and stable v30+ builds).Test Coverage:
New Test Suite for Synonym Sets (
SynonymSets.spec.ts):Conditional Skipping for Existing Tests:
describe.skipIf(await isV30OrAbove(...))to conditionally skip based on version compatibility.Test Refactoring:
describe()blocks to reduce duplication.Documentation Updates:
synonymSets.ts):PR Checklist