From 02eef0d93417abc631836db4527cb13144b60c47 Mon Sep 17 00:00:00 2001 From: Hayden Hung Hoang Date: Thu, 11 Sep 2025 00:24:45 +0700 Subject: [PATCH] bump to v4 --- README.md | 8 +-- go.mod | 2 +- typesense/alias.go | 2 +- typesense/alias_test.go | 4 +- typesense/aliases.go | 2 +- typesense/aliases_test.go | 6 +- typesense/analytics_events.go | 2 +- typesense/analytics_events_test.go | 2 +- typesense/analytics_rule.go | 2 +- typesense/analytics_rule_test.go | 4 +- typesense/analytics_rules.go | 2 +- typesense/analytics_rules_test.go | 4 +- typesense/api/circuit/http_client.go | 2 +- typesense/api/circuit/http_client_test.go | 2 +- typesense/api_call.go | 2 +- typesense/api_call_test.go | 2 +- typesense/client.go | 4 +- typesense/client_test.go | 4 +- typesense/collection.go | 2 +- typesense/collection_test.go | 6 +- typesense/collections.go | 2 +- typesense/collections_test.go | 6 +- typesense/conversation_model.go | 2 +- typesense/conversation_model_test.go | 4 +- typesense/conversation_models.go | 2 +- typesense/conversation_models_test.go | 4 +- typesense/document.go | 2 +- typesense/document_test.go | 6 +- typesense/documents.go | 4 +- typesense/documents_test.go | 6 +- typesense/health_test.go | 4 +- typesense/import_test.go | 6 +- typesense/key.go | 2 +- typesense/key_test.go | 4 +- typesense/keys.go | 2 +- typesense/keys_test.go | 6 +- typesense/mocks/mock_client.go | 2 +- typesense/multi_search.go | 2 +- typesense/multi_search_test.go | 6 +- typesense/operations.go | 2 +- typesense/operations_test.go | 4 +- typesense/override.go | 2 +- typesense/override_test.go | 4 +- typesense/overrides.go | 2 +- typesense/overrides_test.go | 6 +- typesense/preset.go | 2 +- typesense/preset_test.go | 4 +- typesense/presets.go | 2 +- typesense/presets_test.go | 4 +- typesense/search_test.go | 6 +- typesense/stats.go | 2 +- typesense/stats_test.go | 4 +- typesense/stemming_dictionaries.go | 2 +- typesense/stemming_dictionary.go | 2 +- typesense/stopword.go | 2 +- typesense/stopword_test.go | 4 +- typesense/stopwords.go | 2 +- typesense/stopwords_test.go | 4 +- typesense/synonym.go | 2 +- typesense/synonym_test.go | 4 +- typesense/synonyms.go | 2 +- typesense/synonyms_test.go | 6 +- typesense/test/alias_test.go | 2 +- typesense/test/aliases_test.go | 2 +- typesense/test/analytics_events_test.go | 2 +- typesense/test/analytics_rules_test.go | 2 +- typesense/test/collection_test.go | 4 +- typesense/test/collections_test.go | 4 +- typesense/test/dbhelpers_test.go | 4 +- typesense/test/doc.go | 2 +- typesense/test/document_test.go | 4 +- typesense/test/documents_test.go | 4 +- typesense/test/import_test.go | 4 +- typesense/test/keys_test.go | 2 +- typesense/test/main_test.go | 2 +- typesense/test/multi_search_test.go | 4 +- typesense/test/overrides_test.go | 4 +- typesense/test/presets_test.go | 2 +- typesense/test/search_test.go | 4 +- typesense/test/setupdb_docker_test.go | 4 +- typesense/test/setupdb_test.go | 2 +- typesense/test/stemming_test.go | 82 +++++++++++------------ typesense/test/stopword_test.go | 4 +- typesense/test/stopwords_test.go | 4 +- typesense/test/synonym_test.go | 2 +- typesense/test/synonyms_test.go | 4 +- 86 files changed, 182 insertions(+), 182 deletions(-) diff --git a/README.md b/README.md index a0dfc62..f7253f6 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ # typesense-go [![Build Status](https://cloud.drone.io/api/badges/typesense/typesense-go/status.svg)](https://cloud.drone.io/typesense/typesense-go) -[![GoReportCard Status](https://goreportcard.com/badge/github.com/typesense/typesense-go/v3)](https://goreportcard.com/report/github.com/typesense/typesense-go/v3) -[![Go Reference](https://pkg.go.dev/badge/github.com/typesense/typesense-go/v3.svg)](https://pkg.go.dev/github.com/typesense/typesense-go/v3) +[![GoReportCard Status](https://goreportcard.com/badge/github.com/typesense/typesense-go/v4)](https://goreportcard.com/report/github.com/typesense/typesense-go/v4) +[![Go Reference](https://pkg.go.dev/badge/github.com/typesense/typesense-go/v4.svg)](https://pkg.go.dev/github.com/typesense/typesense-go/v4) [![GitHub release](https://img.shields.io/github/v/release/typesense/typesense-go)](https://github.com/typesense/typesense-go/releases/latest) [![Gitter](https://badges.gitter.im/typesense-go/community.svg)](https://gitter.im/typesense-go/community) @@ -11,7 +11,7 @@ Go client for the Typesense API: https://github.com/typesense/typesense ## Installation ``` -go get github.com/typesense/typesense-go/v3/typesense +go get github.com/typesense/typesense-go/v4/typesense ``` ## Usage @@ -19,7 +19,7 @@ go get github.com/typesense/typesense-go/v3/typesense Import the the package into your code : ```go -import "github.com/typesense/typesense-go/v3/typesense" +import "github.com/typesense/typesense-go/v4/typesense" ``` Create new client: diff --git a/go.mod b/go.mod index b896374..b30c58c 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/typesense/typesense-go/v3 +module github.com/typesense/typesense-go/v4 go 1.22 diff --git a/typesense/alias.go b/typesense/alias.go index 4c65250..5837a81 100644 --- a/typesense/alias.go +++ b/typesense/alias.go @@ -3,7 +3,7 @@ package typesense import ( "context" - "github.com/typesense/typesense-go/v3/typesense/api" + "github.com/typesense/typesense-go/v4/typesense/api" ) // AliasInterface is a type for Alias API operations diff --git a/typesense/alias_test.go b/typesense/alias_test.go index efa9000..a31f23c 100644 --- a/typesense/alias_test.go +++ b/typesense/alias_test.go @@ -7,8 +7,8 @@ import ( "testing" "github.com/stretchr/testify/assert" - "github.com/typesense/typesense-go/v3/typesense/api" - "github.com/typesense/typesense-go/v3/typesense/mocks" + "github.com/typesense/typesense-go/v4/typesense/api" + "github.com/typesense/typesense-go/v4/typesense/mocks" "go.uber.org/mock/gomock" ) diff --git a/typesense/aliases.go b/typesense/aliases.go index ae33130..fd75390 100644 --- a/typesense/aliases.go +++ b/typesense/aliases.go @@ -3,7 +3,7 @@ package typesense import ( "context" - "github.com/typesense/typesense-go/v3/typesense/api" + "github.com/typesense/typesense-go/v4/typesense/api" ) // AliasesInterface is a type for Aliases API operations diff --git a/typesense/aliases_test.go b/typesense/aliases_test.go index cf2ccdc..1ab5072 100644 --- a/typesense/aliases_test.go +++ b/typesense/aliases_test.go @@ -6,12 +6,12 @@ import ( "net/http" "testing" - "github.com/typesense/typesense-go/v3/typesense/api/pointer" + "github.com/typesense/typesense-go/v4/typesense/api/pointer" "github.com/jinzhu/copier" "github.com/stretchr/testify/assert" - "github.com/typesense/typesense-go/v3/typesense/api" - "github.com/typesense/typesense-go/v3/typesense/mocks" + "github.com/typesense/typesense-go/v4/typesense/api" + "github.com/typesense/typesense-go/v4/typesense/mocks" "go.uber.org/mock/gomock" ) diff --git a/typesense/analytics_events.go b/typesense/analytics_events.go index 7e834a3..fd2a0f3 100644 --- a/typesense/analytics_events.go +++ b/typesense/analytics_events.go @@ -3,7 +3,7 @@ package typesense import ( "context" - "github.com/typesense/typesense-go/v3/typesense/api" + "github.com/typesense/typesense-go/v4/typesense/api" ) type AnalyticsEventsInterface interface { diff --git a/typesense/analytics_events_test.go b/typesense/analytics_events_test.go index 3ca6400..e8c34bb 100644 --- a/typesense/analytics_events_test.go +++ b/typesense/analytics_events_test.go @@ -7,7 +7,7 @@ import ( "testing" "github.com/stretchr/testify/assert" - "github.com/typesense/typesense-go/v3/typesense/api" + "github.com/typesense/typesense-go/v4/typesense/api" ) func TestAnalyticsEventsCreate(t *testing.T) { diff --git a/typesense/analytics_rule.go b/typesense/analytics_rule.go index 675ea29..b00fb57 100644 --- a/typesense/analytics_rule.go +++ b/typesense/analytics_rule.go @@ -3,7 +3,7 @@ package typesense import ( "context" - "github.com/typesense/typesense-go/v3/typesense/api" + "github.com/typesense/typesense-go/v4/typesense/api" ) type AnalyticsRuleInterface interface { diff --git a/typesense/analytics_rule_test.go b/typesense/analytics_rule_test.go index 23600a5..6dccefc 100644 --- a/typesense/analytics_rule_test.go +++ b/typesense/analytics_rule_test.go @@ -6,8 +6,8 @@ import ( "testing" "github.com/stretchr/testify/assert" - "github.com/typesense/typesense-go/v3/typesense/api" - "github.com/typesense/typesense-go/v3/typesense/api/pointer" + "github.com/typesense/typesense-go/v4/typesense/api" + "github.com/typesense/typesense-go/v4/typesense/api/pointer" ) func TestAnalyticsRuleRetrieve(t *testing.T) { diff --git a/typesense/analytics_rules.go b/typesense/analytics_rules.go index 975ab05..aa18e35 100644 --- a/typesense/analytics_rules.go +++ b/typesense/analytics_rules.go @@ -3,7 +3,7 @@ package typesense import ( "context" - "github.com/typesense/typesense-go/v3/typesense/api" + "github.com/typesense/typesense-go/v4/typesense/api" ) type AnalyticsRulesInterface interface { diff --git a/typesense/analytics_rules_test.go b/typesense/analytics_rules_test.go index c985d94..2b4e209 100644 --- a/typesense/analytics_rules_test.go +++ b/typesense/analytics_rules_test.go @@ -7,8 +7,8 @@ import ( "testing" "github.com/stretchr/testify/assert" - "github.com/typesense/typesense-go/v3/typesense/api" - "github.com/typesense/typesense-go/v3/typesense/api/pointer" + "github.com/typesense/typesense-go/v4/typesense/api" + "github.com/typesense/typesense-go/v4/typesense/api/pointer" ) func TestAnalyticsRulesRetrieve(t *testing.T) { diff --git a/typesense/api/circuit/http_client.go b/typesense/api/circuit/http_client.go index 251edb6..f2f0d7d 100644 --- a/typesense/api/circuit/http_client.go +++ b/typesense/api/circuit/http_client.go @@ -5,7 +5,7 @@ package circuit import ( "net/http" - "github.com/typesense/typesense-go/v3/typesense/api" + "github.com/typesense/typesense-go/v4/typesense/api" ) type HTTPRequestDoer interface { diff --git a/typesense/api/circuit/http_client_test.go b/typesense/api/circuit/http_client_test.go index 6075560..160dc9e 100644 --- a/typesense/api/circuit/http_client_test.go +++ b/typesense/api/circuit/http_client_test.go @@ -6,7 +6,7 @@ import ( "testing" "github.com/stretchr/testify/assert" - "github.com/typesense/typesense-go/v3/typesense/api/circuit/mocks" + "github.com/typesense/typesense-go/v4/typesense/api/circuit/mocks" "go.uber.org/mock/gomock" ) diff --git a/typesense/api_call.go b/typesense/api_call.go index ade8d79..1dcf03d 100644 --- a/typesense/api_call.go +++ b/typesense/api_call.go @@ -9,7 +9,7 @@ import ( "net/url" "time" - "github.com/typesense/typesense-go/v3/typesense/api/circuit" + "github.com/typesense/typesense-go/v4/typesense/api/circuit" ) type APICall struct { diff --git a/typesense/api_call_test.go b/typesense/api_call_test.go index 5bc1a04..5e4a5ed 100644 --- a/typesense/api_call_test.go +++ b/typesense/api_call_test.go @@ -10,7 +10,7 @@ import ( "time" "github.com/stretchr/testify/assert" - "github.com/typesense/typesense-go/v3/typesense/api" + "github.com/typesense/typesense-go/v4/typesense/api" ) type serverHandler func(http.ResponseWriter, *http.Request) diff --git a/typesense/client.go b/typesense/client.go index 33feb5e..8c9ea40 100644 --- a/typesense/client.go +++ b/typesense/client.go @@ -7,8 +7,8 @@ import ( "net/http" "time" - "github.com/typesense/typesense-go/v3/typesense/api" - "github.com/typesense/typesense-go/v3/typesense/api/circuit" + "github.com/typesense/typesense-go/v4/typesense/api" + "github.com/typesense/typesense-go/v4/typesense/api/circuit" ) type APIClientInterface interface { diff --git a/typesense/client_test.go b/typesense/client_test.go index 09cb820..92f2686 100644 --- a/typesense/client_test.go +++ b/typesense/client_test.go @@ -7,8 +7,8 @@ import ( "github.com/sony/gobreaker" "github.com/stretchr/testify/assert" - "github.com/typesense/typesense-go/v3/typesense/api" - "github.com/typesense/typesense-go/v3/typesense/api/circuit" + "github.com/typesense/typesense-go/v4/typesense/api" + "github.com/typesense/typesense-go/v4/typesense/api/circuit" ) func TestHttpError(t *testing.T) { diff --git a/typesense/collection.go b/typesense/collection.go index d912d21..7268a77 100644 --- a/typesense/collection.go +++ b/typesense/collection.go @@ -3,7 +3,7 @@ package typesense import ( "context" - "github.com/typesense/typesense-go/v3/typesense/api" + "github.com/typesense/typesense-go/v4/typesense/api" ) // CollectionInterface is a type for Collection API operations diff --git a/typesense/collection_test.go b/typesense/collection_test.go index d55b5f7..388f628 100644 --- a/typesense/collection_test.go +++ b/typesense/collection_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/stretchr/testify/assert" - "github.com/typesense/typesense-go/v3/typesense/api" - "github.com/typesense/typesense-go/v3/typesense/api/pointer" - "github.com/typesense/typesense-go/v3/typesense/mocks" + "github.com/typesense/typesense-go/v4/typesense/api" + "github.com/typesense/typesense-go/v4/typesense/api/pointer" + "github.com/typesense/typesense-go/v4/typesense/mocks" "go.uber.org/mock/gomock" ) diff --git a/typesense/collections.go b/typesense/collections.go index 9ea6e0a..3652675 100644 --- a/typesense/collections.go +++ b/typesense/collections.go @@ -3,7 +3,7 @@ package typesense import ( "context" - "github.com/typesense/typesense-go/v3/typesense/api" + "github.com/typesense/typesense-go/v4/typesense/api" ) // CollectionsInterface is a type for Collections API operations diff --git a/typesense/collections_test.go b/typesense/collections_test.go index a0b1347..18a6e7d 100644 --- a/typesense/collections_test.go +++ b/typesense/collections_test.go @@ -8,9 +8,9 @@ import ( "github.com/jinzhu/copier" "github.com/stretchr/testify/assert" - "github.com/typesense/typesense-go/v3/typesense/api" - "github.com/typesense/typesense-go/v3/typesense/api/pointer" - "github.com/typesense/typesense-go/v3/typesense/mocks" + "github.com/typesense/typesense-go/v4/typesense/api" + "github.com/typesense/typesense-go/v4/typesense/api/pointer" + "github.com/typesense/typesense-go/v4/typesense/mocks" "go.uber.org/mock/gomock" ) diff --git a/typesense/conversation_model.go b/typesense/conversation_model.go index 292323e..88880a4 100644 --- a/typesense/conversation_model.go +++ b/typesense/conversation_model.go @@ -3,7 +3,7 @@ package typesense import ( "context" - "github.com/typesense/typesense-go/v3/typesense/api" + "github.com/typesense/typesense-go/v4/typesense/api" ) type ConversationModelInterface interface { diff --git a/typesense/conversation_model_test.go b/typesense/conversation_model_test.go index 586640b..c209fd6 100644 --- a/typesense/conversation_model_test.go +++ b/typesense/conversation_model_test.go @@ -7,8 +7,8 @@ import ( "testing" "github.com/stretchr/testify/assert" - "github.com/typesense/typesense-go/v3/typesense/api" - "github.com/typesense/typesense-go/v3/typesense/api/pointer" + "github.com/typesense/typesense-go/v4/typesense/api" + "github.com/typesense/typesense-go/v4/typesense/api/pointer" ) func TestConversationModelRetrieve(t *testing.T) { diff --git a/typesense/conversation_models.go b/typesense/conversation_models.go index 4350264..0f88f58 100644 --- a/typesense/conversation_models.go +++ b/typesense/conversation_models.go @@ -3,7 +3,7 @@ package typesense import ( "context" - "github.com/typesense/typesense-go/v3/typesense/api" + "github.com/typesense/typesense-go/v4/typesense/api" ) // ConversationModelsInterface is a type for ConversationModels API operations diff --git a/typesense/conversation_models_test.go b/typesense/conversation_models_test.go index 579f380..4fa78ce 100644 --- a/typesense/conversation_models_test.go +++ b/typesense/conversation_models_test.go @@ -7,8 +7,8 @@ import ( "testing" "github.com/stretchr/testify/assert" - "github.com/typesense/typesense-go/v3/typesense/api" - "github.com/typesense/typesense-go/v3/typesense/api/pointer" + "github.com/typesense/typesense-go/v4/typesense/api" + "github.com/typesense/typesense-go/v4/typesense/api/pointer" ) func TestConversationModelsRetrieve(t *testing.T) { diff --git a/typesense/document.go b/typesense/document.go index 8fecf86..e1e3e11 100644 --- a/typesense/document.go +++ b/typesense/document.go @@ -6,7 +6,7 @@ import ( "io" "strings" - "github.com/typesense/typesense-go/v3/typesense/api" + "github.com/typesense/typesense-go/v4/typesense/api" ) type DocumentInterface[T any] interface { diff --git a/typesense/document_test.go b/typesense/document_test.go index f75ef5b..0bad18c 100644 --- a/typesense/document_test.go +++ b/typesense/document_test.go @@ -6,9 +6,9 @@ import ( "testing" "github.com/stretchr/testify/assert" - "github.com/typesense/typesense-go/v3/typesense/api" - "github.com/typesense/typesense-go/v3/typesense/api/pointer" - "github.com/typesense/typesense-go/v3/typesense/mocks" + "github.com/typesense/typesense-go/v4/typesense/api" + "github.com/typesense/typesense-go/v4/typesense/api/pointer" + "github.com/typesense/typesense-go/v4/typesense/mocks" "go.uber.org/mock/gomock" ) diff --git a/typesense/documents.go b/typesense/documents.go index e95fc3c..18e814a 100644 --- a/typesense/documents.go +++ b/typesense/documents.go @@ -10,8 +10,8 @@ import ( "io" "net/http" - "github.com/typesense/typesense-go/v3/typesense/api" - "github.com/typesense/typesense-go/v3/typesense/api/pointer" + "github.com/typesense/typesense-go/v4/typesense/api" + "github.com/typesense/typesense-go/v4/typesense/api/pointer" ) const ( diff --git a/typesense/documents_test.go b/typesense/documents_test.go index a155f75..59e4580 100644 --- a/typesense/documents_test.go +++ b/typesense/documents_test.go @@ -9,9 +9,9 @@ import ( "testing" "github.com/stretchr/testify/assert" - "github.com/typesense/typesense-go/v3/typesense/api" - "github.com/typesense/typesense-go/v3/typesense/api/pointer" - "github.com/typesense/typesense-go/v3/typesense/mocks" + "github.com/typesense/typesense-go/v4/typesense/api" + "github.com/typesense/typesense-go/v4/typesense/api/pointer" + "github.com/typesense/typesense-go/v4/typesense/mocks" "go.uber.org/mock/gomock" ) diff --git a/typesense/health_test.go b/typesense/health_test.go index 83d902e..6d660a0 100644 --- a/typesense/health_test.go +++ b/typesense/health_test.go @@ -8,8 +8,8 @@ import ( "time" "github.com/stretchr/testify/assert" - "github.com/typesense/typesense-go/v3/typesense/api" - "github.com/typesense/typesense-go/v3/typesense/mocks" + "github.com/typesense/typesense-go/v4/typesense/api" + "github.com/typesense/typesense-go/v4/typesense/mocks" "go.uber.org/mock/gomock" ) diff --git a/typesense/import_test.go b/typesense/import_test.go index 345ae67..be19fd1 100644 --- a/typesense/import_test.go +++ b/typesense/import_test.go @@ -10,9 +10,9 @@ import ( "testing" "github.com/stretchr/testify/assert" - "github.com/typesense/typesense-go/v3/typesense/api" - "github.com/typesense/typesense-go/v3/typesense/api/pointer" - "github.com/typesense/typesense-go/v3/typesense/mocks" + "github.com/typesense/typesense-go/v4/typesense/api" + "github.com/typesense/typesense-go/v4/typesense/api/pointer" + "github.com/typesense/typesense-go/v4/typesense/mocks" "go.uber.org/mock/gomock" ) diff --git a/typesense/key.go b/typesense/key.go index 5edcd03..2ca3fbc 100644 --- a/typesense/key.go +++ b/typesense/key.go @@ -3,7 +3,7 @@ package typesense import ( "context" - "github.com/typesense/typesense-go/v3/typesense/api" + "github.com/typesense/typesense-go/v4/typesense/api" ) type KeyInterface interface { diff --git a/typesense/key_test.go b/typesense/key_test.go index 4cdc933..0f91262 100644 --- a/typesense/key_test.go +++ b/typesense/key_test.go @@ -7,8 +7,8 @@ import ( "testing" "github.com/stretchr/testify/assert" - "github.com/typesense/typesense-go/v3/typesense/api" - "github.com/typesense/typesense-go/v3/typesense/mocks" + "github.com/typesense/typesense-go/v4/typesense/api" + "github.com/typesense/typesense-go/v4/typesense/mocks" "go.uber.org/mock/gomock" ) diff --git a/typesense/keys.go b/typesense/keys.go index ca2bf90..6199c5b 100644 --- a/typesense/keys.go +++ b/typesense/keys.go @@ -8,7 +8,7 @@ import ( "encoding/json" "fmt" - "github.com/typesense/typesense-go/v3/typesense/api" + "github.com/typesense/typesense-go/v4/typesense/api" ) type KeysInterface interface { diff --git a/typesense/keys_test.go b/typesense/keys_test.go index 03f4e12..60d722a 100644 --- a/typesense/keys_test.go +++ b/typesense/keys_test.go @@ -9,9 +9,9 @@ import ( "github.com/jinzhu/copier" "github.com/stretchr/testify/assert" - "github.com/typesense/typesense-go/v3/typesense/api" - "github.com/typesense/typesense-go/v3/typesense/api/pointer" - "github.com/typesense/typesense-go/v3/typesense/mocks" + "github.com/typesense/typesense-go/v4/typesense/api" + "github.com/typesense/typesense-go/v4/typesense/api/pointer" + "github.com/typesense/typesense-go/v4/typesense/mocks" "go.uber.org/mock/gomock" ) diff --git a/typesense/mocks/mock_client.go b/typesense/mocks/mock_client.go index d3f1204..1f14655 100644 --- a/typesense/mocks/mock_client.go +++ b/typesense/mocks/mock_client.go @@ -15,7 +15,7 @@ import ( http "net/http" reflect "reflect" - api "github.com/typesense/typesense-go/v3/typesense/api" + api "github.com/typesense/typesense-go/v4/typesense/api" gomock "go.uber.org/mock/gomock" ) diff --git a/typesense/multi_search.go b/typesense/multi_search.go index 2d8e0d9..19e1cf7 100644 --- a/typesense/multi_search.go +++ b/typesense/multi_search.go @@ -6,7 +6,7 @@ import ( "encoding/json" "io" - "github.com/typesense/typesense-go/v3/typesense/api" + "github.com/typesense/typesense-go/v4/typesense/api" ) type MultiSearchInterface interface { diff --git a/typesense/multi_search_test.go b/typesense/multi_search_test.go index f65e59c..27638b1 100644 --- a/typesense/multi_search_test.go +++ b/typesense/multi_search_test.go @@ -10,9 +10,9 @@ import ( "bytes" "github.com/stretchr/testify/assert" - "github.com/typesense/typesense-go/v3/typesense/api" - "github.com/typesense/typesense-go/v3/typesense/api/pointer" - "github.com/typesense/typesense-go/v3/typesense/mocks" + "github.com/typesense/typesense-go/v4/typesense/api" + "github.com/typesense/typesense-go/v4/typesense/api/pointer" + "github.com/typesense/typesense-go/v4/typesense/mocks" "go.uber.org/mock/gomock" ) diff --git a/typesense/operations.go b/typesense/operations.go index 0ef9756..f33553d 100644 --- a/typesense/operations.go +++ b/typesense/operations.go @@ -3,7 +3,7 @@ package typesense import ( "context" - "github.com/typesense/typesense-go/v3/typesense/api" + "github.com/typesense/typesense-go/v4/typesense/api" ) type OperationsInterface interface { diff --git a/typesense/operations_test.go b/typesense/operations_test.go index 2608d89..f0db888 100644 --- a/typesense/operations_test.go +++ b/typesense/operations_test.go @@ -7,8 +7,8 @@ import ( "testing" "github.com/stretchr/testify/assert" - "github.com/typesense/typesense-go/v3/typesense/api" - "github.com/typesense/typesense-go/v3/typesense/mocks" + "github.com/typesense/typesense-go/v4/typesense/api" + "github.com/typesense/typesense-go/v4/typesense/mocks" "go.uber.org/mock/gomock" ) diff --git a/typesense/override.go b/typesense/override.go index 8768200..6aed173 100644 --- a/typesense/override.go +++ b/typesense/override.go @@ -3,7 +3,7 @@ package typesense import ( "context" - "github.com/typesense/typesense-go/v3/typesense/api" + "github.com/typesense/typesense-go/v4/typesense/api" ) // OverrideInterface is a type for Search Override API operations diff --git a/typesense/override_test.go b/typesense/override_test.go index aafbaff..e88c9db 100644 --- a/typesense/override_test.go +++ b/typesense/override_test.go @@ -7,8 +7,8 @@ import ( "testing" "github.com/stretchr/testify/assert" - "github.com/typesense/typesense-go/v3/typesense/api" - "github.com/typesense/typesense-go/v3/typesense/mocks" + "github.com/typesense/typesense-go/v4/typesense/api" + "github.com/typesense/typesense-go/v4/typesense/mocks" "go.uber.org/mock/gomock" ) diff --git a/typesense/overrides.go b/typesense/overrides.go index a63aa00..9ee9a92 100644 --- a/typesense/overrides.go +++ b/typesense/overrides.go @@ -3,7 +3,7 @@ package typesense import ( "context" - "github.com/typesense/typesense-go/v3/typesense/api" + "github.com/typesense/typesense-go/v4/typesense/api" ) // OverridesInterface is a type for Search Overrides API operations diff --git a/typesense/overrides_test.go b/typesense/overrides_test.go index 649841a..a1eb913 100644 --- a/typesense/overrides_test.go +++ b/typesense/overrides_test.go @@ -6,12 +6,12 @@ import ( "net/http" "testing" - "github.com/typesense/typesense-go/v3/typesense/api/pointer" + "github.com/typesense/typesense-go/v4/typesense/api/pointer" "github.com/jinzhu/copier" "github.com/stretchr/testify/assert" - "github.com/typesense/typesense-go/v3/typesense/api" - "github.com/typesense/typesense-go/v3/typesense/mocks" + "github.com/typesense/typesense-go/v4/typesense/api" + "github.com/typesense/typesense-go/v4/typesense/mocks" "go.uber.org/mock/gomock" ) diff --git a/typesense/preset.go b/typesense/preset.go index 45c23ed..bae041a 100644 --- a/typesense/preset.go +++ b/typesense/preset.go @@ -3,7 +3,7 @@ package typesense import ( "context" - "github.com/typesense/typesense-go/v3/typesense/api" + "github.com/typesense/typesense-go/v4/typesense/api" ) type PresetInterface interface { diff --git a/typesense/preset_test.go b/typesense/preset_test.go index f776559..67a5af9 100644 --- a/typesense/preset_test.go +++ b/typesense/preset_test.go @@ -6,8 +6,8 @@ import ( "testing" "github.com/stretchr/testify/assert" - "github.com/typesense/typesense-go/v3/typesense/api" - "github.com/typesense/typesense-go/v3/typesense/api/pointer" + "github.com/typesense/typesense-go/v4/typesense/api" + "github.com/typesense/typesense-go/v4/typesense/api/pointer" ) func TestPresetRetrieveAsSearchParameters(t *testing.T) { diff --git a/typesense/presets.go b/typesense/presets.go index df6f701..16d1740 100644 --- a/typesense/presets.go +++ b/typesense/presets.go @@ -3,7 +3,7 @@ package typesense import ( "context" - "github.com/typesense/typesense-go/v3/typesense/api" + "github.com/typesense/typesense-go/v4/typesense/api" ) type PresetsInterface interface { diff --git a/typesense/presets_test.go b/typesense/presets_test.go index eab30ce..16533ad 100644 --- a/typesense/presets_test.go +++ b/typesense/presets_test.go @@ -7,8 +7,8 @@ import ( "testing" "github.com/stretchr/testify/assert" - "github.com/typesense/typesense-go/v3/typesense/api" - "github.com/typesense/typesense-go/v3/typesense/api/pointer" + "github.com/typesense/typesense-go/v4/typesense/api" + "github.com/typesense/typesense-go/v4/typesense/api/pointer" ) func TestPresetsRetrieveAsSearchParameters(t *testing.T) { diff --git a/typesense/search_test.go b/typesense/search_test.go index bac406b..36e487d 100644 --- a/typesense/search_test.go +++ b/typesense/search_test.go @@ -8,9 +8,9 @@ import ( "testing" "github.com/stretchr/testify/assert" - "github.com/typesense/typesense-go/v3/typesense/api" - "github.com/typesense/typesense-go/v3/typesense/api/pointer" - "github.com/typesense/typesense-go/v3/typesense/mocks" + "github.com/typesense/typesense-go/v4/typesense/api" + "github.com/typesense/typesense-go/v4/typesense/api/pointer" + "github.com/typesense/typesense-go/v4/typesense/mocks" "go.uber.org/mock/gomock" ) diff --git a/typesense/stats.go b/typesense/stats.go index 61de910..8274300 100644 --- a/typesense/stats.go +++ b/typesense/stats.go @@ -3,7 +3,7 @@ package typesense import ( "context" - "github.com/typesense/typesense-go/v3/typesense/api" + "github.com/typesense/typesense-go/v4/typesense/api" ) type StatsInterface interface { diff --git a/typesense/stats_test.go b/typesense/stats_test.go index bddb65d..7c9d7e7 100644 --- a/typesense/stats_test.go +++ b/typesense/stats_test.go @@ -6,8 +6,8 @@ import ( "testing" "github.com/stretchr/testify/assert" - "github.com/typesense/typesense-go/v3/typesense/api" - "github.com/typesense/typesense-go/v3/typesense/api/pointer" + "github.com/typesense/typesense-go/v4/typesense/api" + "github.com/typesense/typesense-go/v4/typesense/api/pointer" ) func TestStatsRetrieve(t *testing.T) { diff --git a/typesense/stemming_dictionaries.go b/typesense/stemming_dictionaries.go index e97f981..31676ed 100644 --- a/typesense/stemming_dictionaries.go +++ b/typesense/stemming_dictionaries.go @@ -7,7 +7,7 @@ import ( "io" "net/http" - "github.com/typesense/typesense-go/v3/typesense/api" + "github.com/typesense/typesense-go/v4/typesense/api" ) type StemmingDictionariesInterface interface { diff --git a/typesense/stemming_dictionary.go b/typesense/stemming_dictionary.go index 634f50c..2d47109 100644 --- a/typesense/stemming_dictionary.go +++ b/typesense/stemming_dictionary.go @@ -3,7 +3,7 @@ package typesense import ( "context" - "github.com/typesense/typesense-go/v3/typesense/api" + "github.com/typesense/typesense-go/v4/typesense/api" ) type StemmingDictionaryInterface interface { diff --git a/typesense/stopword.go b/typesense/stopword.go index 8c729a0..07c40a5 100644 --- a/typesense/stopword.go +++ b/typesense/stopword.go @@ -3,7 +3,7 @@ package typesense import ( "context" - "github.com/typesense/typesense-go/v3/typesense/api" + "github.com/typesense/typesense-go/v4/typesense/api" ) type StopwordInterface interface { diff --git a/typesense/stopword_test.go b/typesense/stopword_test.go index 8716b58..9bed995 100644 --- a/typesense/stopword_test.go +++ b/typesense/stopword_test.go @@ -6,8 +6,8 @@ import ( "testing" "github.com/stretchr/testify/assert" - "github.com/typesense/typesense-go/v3/typesense/api" - "github.com/typesense/typesense-go/v3/typesense/api/pointer" + "github.com/typesense/typesense-go/v4/typesense/api" + "github.com/typesense/typesense-go/v4/typesense/api/pointer" ) func TestStopwordRetrieve(t *testing.T) { diff --git a/typesense/stopwords.go b/typesense/stopwords.go index e10409e..e8fdcdd 100644 --- a/typesense/stopwords.go +++ b/typesense/stopwords.go @@ -3,7 +3,7 @@ package typesense import ( "context" - "github.com/typesense/typesense-go/v3/typesense/api" + "github.com/typesense/typesense-go/v4/typesense/api" ) type StopwordsInterface interface { diff --git a/typesense/stopwords_test.go b/typesense/stopwords_test.go index 9e7a252..e8c25a6 100644 --- a/typesense/stopwords_test.go +++ b/typesense/stopwords_test.go @@ -7,8 +7,8 @@ import ( "testing" "github.com/stretchr/testify/assert" - "github.com/typesense/typesense-go/v3/typesense/api" - "github.com/typesense/typesense-go/v3/typesense/api/pointer" + "github.com/typesense/typesense-go/v4/typesense/api" + "github.com/typesense/typesense-go/v4/typesense/api/pointer" ) func TestStopwordsRetrieve(t *testing.T) { diff --git a/typesense/synonym.go b/typesense/synonym.go index 3236bd0..0edb80e 100644 --- a/typesense/synonym.go +++ b/typesense/synonym.go @@ -3,7 +3,7 @@ package typesense import ( "context" - "github.com/typesense/typesense-go/v3/typesense/api" + "github.com/typesense/typesense-go/v4/typesense/api" ) // SynonymInterface is a type for Search Synonym API operations diff --git a/typesense/synonym_test.go b/typesense/synonym_test.go index eb591bb..dfc3ad4 100644 --- a/typesense/synonym_test.go +++ b/typesense/synonym_test.go @@ -7,8 +7,8 @@ import ( "testing" "github.com/stretchr/testify/assert" - "github.com/typesense/typesense-go/v3/typesense/api" - "github.com/typesense/typesense-go/v3/typesense/mocks" + "github.com/typesense/typesense-go/v4/typesense/api" + "github.com/typesense/typesense-go/v4/typesense/mocks" "go.uber.org/mock/gomock" ) diff --git a/typesense/synonyms.go b/typesense/synonyms.go index 3d416ca..ed74323 100644 --- a/typesense/synonyms.go +++ b/typesense/synonyms.go @@ -3,7 +3,7 @@ package typesense import ( "context" - "github.com/typesense/typesense-go/v3/typesense/api" + "github.com/typesense/typesense-go/v4/typesense/api" ) // SynonymsInterface is a type for Search Synonyms API operations diff --git a/typesense/synonyms_test.go b/typesense/synonyms_test.go index 143a99b..753d336 100644 --- a/typesense/synonyms_test.go +++ b/typesense/synonyms_test.go @@ -6,12 +6,12 @@ import ( "net/http" "testing" - "github.com/typesense/typesense-go/v3/typesense/api/pointer" + "github.com/typesense/typesense-go/v4/typesense/api/pointer" "github.com/jinzhu/copier" "github.com/stretchr/testify/assert" - "github.com/typesense/typesense-go/v3/typesense/api" - "github.com/typesense/typesense-go/v3/typesense/mocks" + "github.com/typesense/typesense-go/v4/typesense/api" + "github.com/typesense/typesense-go/v4/typesense/mocks" "go.uber.org/mock/gomock" ) diff --git a/typesense/test/alias_test.go b/typesense/test/alias_test.go index f845733..f72c3a4 100644 --- a/typesense/test/alias_test.go +++ b/typesense/test/alias_test.go @@ -8,7 +8,7 @@ import ( "testing" "github.com/stretchr/testify/require" - "github.com/typesense/typesense-go/v3/typesense/api" + "github.com/typesense/typesense-go/v4/typesense/api" ) func TestCollectionAliasRetrieve(t *testing.T) { diff --git a/typesense/test/aliases_test.go b/typesense/test/aliases_test.go index 3e8e195..4ebcdb0 100644 --- a/typesense/test/aliases_test.go +++ b/typesense/test/aliases_test.go @@ -9,7 +9,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/typesense/typesense-go/v3/typesense/api" + "github.com/typesense/typesense-go/v4/typesense/api" ) func TestCollectionAliasUpsertNewAlias(t *testing.T) { diff --git a/typesense/test/analytics_events_test.go b/typesense/test/analytics_events_test.go index 26c84ec..de0a3e4 100644 --- a/typesense/test/analytics_events_test.go +++ b/typesense/test/analytics_events_test.go @@ -8,7 +8,7 @@ import ( "testing" "github.com/stretchr/testify/require" - "github.com/typesense/typesense-go/v3/typesense/api" + "github.com/typesense/typesense-go/v4/typesense/api" ) func TestAnalyticsEventsCreate(t *testing.T) { diff --git a/typesense/test/analytics_rules_test.go b/typesense/test/analytics_rules_test.go index 315ed8c..66f750e 100644 --- a/typesense/test/analytics_rules_test.go +++ b/typesense/test/analytics_rules_test.go @@ -8,7 +8,7 @@ import ( "testing" "github.com/stretchr/testify/require" - "github.com/typesense/typesense-go/v3/typesense/api" + "github.com/typesense/typesense-go/v4/typesense/api" ) func TestAnalyticsRulesUpsert(t *testing.T) { diff --git a/typesense/test/collection_test.go b/typesense/test/collection_test.go index a1cda43..521651e 100644 --- a/typesense/test/collection_test.go +++ b/typesense/test/collection_test.go @@ -8,8 +8,8 @@ import ( "testing" "github.com/stretchr/testify/require" - "github.com/typesense/typesense-go/v3/typesense/api" - "github.com/typesense/typesense-go/v3/typesense/api/pointer" + "github.com/typesense/typesense-go/v4/typesense/api" + "github.com/typesense/typesense-go/v4/typesense/api/pointer" ) func TestCollectionRetrieve(t *testing.T) { diff --git a/typesense/test/collections_test.go b/typesense/test/collections_test.go index 277a58f..ef9af2f 100644 --- a/typesense/test/collections_test.go +++ b/typesense/test/collections_test.go @@ -9,8 +9,8 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/typesense/typesense-go/v3/typesense/api" - "github.com/typesense/typesense-go/v3/typesense/api/pointer" + "github.com/typesense/typesense-go/v4/typesense/api" + "github.com/typesense/typesense-go/v4/typesense/api/pointer" ) func TestCollectionCreate(t *testing.T) { diff --git a/typesense/test/dbhelpers_test.go b/typesense/test/dbhelpers_test.go index 96e4777..7b1aa16 100644 --- a/typesense/test/dbhelpers_test.go +++ b/typesense/test/dbhelpers_test.go @@ -11,8 +11,8 @@ import ( "github.com/google/uuid" "github.com/stretchr/testify/require" - "github.com/typesense/typesense-go/v3/typesense/api" - "github.com/typesense/typesense-go/v3/typesense/api/pointer" + "github.com/typesense/typesense-go/v4/typesense/api" + "github.com/typesense/typesense-go/v4/typesense/api/pointer" ) func newUUIDName(namePrefix string) string { diff --git a/typesense/test/doc.go b/typesense/test/doc.go index db787a6..2c5bcfd 100644 --- a/typesense/test/doc.go +++ b/typesense/test/doc.go @@ -1,3 +1,3 @@ // Package test contains integration tests for the -// github.com/typesense/typesense-go/v3/typesense package. +// github.com/typesense/typesense-go/v4/typesense package. package test diff --git a/typesense/test/document_test.go b/typesense/test/document_test.go index 4e09b26..be617ab 100644 --- a/typesense/test/document_test.go +++ b/typesense/test/document_test.go @@ -8,8 +8,8 @@ import ( "testing" "github.com/stretchr/testify/require" - "github.com/typesense/typesense-go/v3/typesense" - "github.com/typesense/typesense-go/v3/typesense/api" + "github.com/typesense/typesense-go/v4/typesense" + "github.com/typesense/typesense-go/v4/typesense/api" ) func TestDocumentRetrieveGeneric(t *testing.T) { diff --git a/typesense/test/documents_test.go b/typesense/test/documents_test.go index 42ac622..9341fee 100644 --- a/typesense/test/documents_test.go +++ b/typesense/test/documents_test.go @@ -10,8 +10,8 @@ import ( "testing" "github.com/stretchr/testify/require" - "github.com/typesense/typesense-go/v3/typesense/api" - "github.com/typesense/typesense-go/v3/typesense/api/pointer" + "github.com/typesense/typesense-go/v4/typesense/api" + "github.com/typesense/typesense-go/v4/typesense/api/pointer" ) func TestDocumentCreate(t *testing.T) { diff --git a/typesense/test/import_test.go b/typesense/test/import_test.go index 01d3f0e..2ba12c9 100644 --- a/typesense/test/import_test.go +++ b/typesense/test/import_test.go @@ -10,8 +10,8 @@ import ( "testing" "github.com/stretchr/testify/require" - "github.com/typesense/typesense-go/v3/typesense/api" - "github.com/typesense/typesense-go/v3/typesense/api/pointer" + "github.com/typesense/typesense-go/v4/typesense/api" + "github.com/typesense/typesense-go/v4/typesense/api/pointer" ) func TestDocumentsImport(t *testing.T) { diff --git a/typesense/test/keys_test.go b/typesense/test/keys_test.go index 01aea62..be233cb 100644 --- a/typesense/test/keys_test.go +++ b/typesense/test/keys_test.go @@ -9,7 +9,7 @@ import ( "testing" "github.com/stretchr/testify/require" - "github.com/typesense/typesense-go/v3/typesense/api" + "github.com/typesense/typesense-go/v4/typesense/api" ) func TestKeyCreate(t *testing.T) { diff --git a/typesense/test/main_test.go b/typesense/test/main_test.go index 7098b2f..f08dc8f 100644 --- a/typesense/test/main_test.go +++ b/typesense/test/main_test.go @@ -8,7 +8,7 @@ import ( "os" "testing" - "github.com/typesense/typesense-go/v3/typesense" + "github.com/typesense/typesense-go/v4/typesense" ) var typesenseClient *typesense.Client diff --git a/typesense/test/multi_search_test.go b/typesense/test/multi_search_test.go index d54f1eb..90912f4 100644 --- a/typesense/test/multi_search_test.go +++ b/typesense/test/multi_search_test.go @@ -8,8 +8,8 @@ import ( "testing" "github.com/stretchr/testify/require" - "github.com/typesense/typesense-go/v3/typesense/api" - "github.com/typesense/typesense-go/v3/typesense/api/pointer" + "github.com/typesense/typesense-go/v4/typesense/api" + "github.com/typesense/typesense-go/v4/typesense/api/pointer" ) func TestMultiSearch(t *testing.T) { diff --git a/typesense/test/overrides_test.go b/typesense/test/overrides_test.go index 5749e93..fc295e5 100644 --- a/typesense/test/overrides_test.go +++ b/typesense/test/overrides_test.go @@ -9,8 +9,8 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/typesense/typesense-go/v3/typesense/api" - "github.com/typesense/typesense-go/v3/typesense/api/pointer" + "github.com/typesense/typesense-go/v4/typesense/api" + "github.com/typesense/typesense-go/v4/typesense/api/pointer" ) func TestSearchOverrideUpsertNewOverride(t *testing.T) { diff --git a/typesense/test/presets_test.go b/typesense/test/presets_test.go index e7a94d2..94cbb83 100644 --- a/typesense/test/presets_test.go +++ b/typesense/test/presets_test.go @@ -9,7 +9,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/typesense/typesense-go/v3/typesense/api" + "github.com/typesense/typesense-go/v4/typesense/api" ) func presetsCleanUp() { diff --git a/typesense/test/search_test.go b/typesense/test/search_test.go index 5296844..63fddff 100644 --- a/typesense/test/search_test.go +++ b/typesense/test/search_test.go @@ -8,8 +8,8 @@ import ( "testing" "github.com/stretchr/testify/require" - "github.com/typesense/typesense-go/v3/typesense/api" - "github.com/typesense/typesense-go/v3/typesense/api/pointer" + "github.com/typesense/typesense-go/v4/typesense/api" + "github.com/typesense/typesense-go/v4/typesense/api/pointer" ) func TestCollectionSearch(t *testing.T) { diff --git a/typesense/test/setupdb_docker_test.go b/typesense/test/setupdb_docker_test.go index f1ad07f..f67b38a 100644 --- a/typesense/test/setupdb_docker_test.go +++ b/typesense/test/setupdb_docker_test.go @@ -13,8 +13,8 @@ import ( "github.com/testcontainers/testcontainers-go" "github.com/testcontainers/testcontainers-go/wait" - "github.com/typesense/typesense-go/v3/typesense" - "github.com/typesense/typesense-go/v3/typesense/api" + "github.com/typesense/typesense-go/v4/typesense" + "github.com/typesense/typesense-go/v4/typesense/api" ) var typesenseC testcontainers.Container diff --git a/typesense/test/setupdb_test.go b/typesense/test/setupdb_test.go index d25e9f7..b7fbc10 100644 --- a/typesense/test/setupdb_test.go +++ b/typesense/test/setupdb_test.go @@ -9,7 +9,7 @@ import ( "os" "time" - "github.com/typesense/typesense-go/v3/typesense" + "github.com/typesense/typesense-go/v4/typesense" ) func waitHealthyStatus(client *typesense.Client, timeout time.Duration) error { diff --git a/typesense/test/stemming_test.go b/typesense/test/stemming_test.go index d4f73e0..2ec4734 100644 --- a/typesense/test/stemming_test.go +++ b/typesense/test/stemming_test.go @@ -10,50 +10,50 @@ import ( "time" "github.com/stretchr/testify/require" - "github.com/typesense/typesense-go/v3/typesense/api" + "github.com/typesense/typesense-go/v4/typesense/api" ) func TestStemmingDictionary(t *testing.T) { - dictionaryId := fmt.Sprintf("dictionary_%d", time.Now().UnixNano()) - words := []api.StemmingDictionaryWord{ - { - Root: "exampleRoot1", - Word: "exampleWord1", - }, - { - Root: "exampleRoot2", - Word: "exampleWord2", - }, - } + dictionaryId := fmt.Sprintf("dictionary_%d", time.Now().UnixNano()) + words := []api.StemmingDictionaryWord{ + { + Root: "exampleRoot1", + Word: "exampleWord1", + }, + { + Root: "exampleRoot2", + Word: "exampleWord2", + }, + } - t.Run("Upsert", func(t *testing.T) { - result, err := typesenseClient.Stemming().Dictionaries().Upsert( - context.Background(), - dictionaryId, - words, - ) - require.NoError(t, err) - require.Len(t, result, len(words)) - }) + t.Run("Upsert", func(t *testing.T) { + result, err := typesenseClient.Stemming().Dictionaries().Upsert( + context.Background(), + dictionaryId, + words, + ) + require.NoError(t, err) + require.Len(t, result, len(words)) + }) - t.Run("Retrieve Single", func(t *testing.T) { - result, err := typesenseClient.Stemming().Dictionary(dictionaryId).Retrieve(context.Background()) - require.NoError(t, err) - require.Equal(t, dictionaryId, result.Id) - // Convert result.Words to the same type for comparison - retrievedWords := make([]api.StemmingDictionaryWord, len(result.Words)) - for i, w := range result.Words { - retrievedWords[i] = api.StemmingDictionaryWord{ - Root: w.Root, - Word: w.Word, - } - } - require.Equal(t, words, retrievedWords) - }) + t.Run("Retrieve Single", func(t *testing.T) { + result, err := typesenseClient.Stemming().Dictionary(dictionaryId).Retrieve(context.Background()) + require.NoError(t, err) + require.Equal(t, dictionaryId, result.Id) + // Convert result.Words to the same type for comparison + retrievedWords := make([]api.StemmingDictionaryWord, len(result.Words)) + for i, w := range result.Words { + retrievedWords[i] = api.StemmingDictionaryWord{ + Root: w.Root, + Word: w.Word, + } + } + require.Equal(t, words, retrievedWords) + }) - t.Run("List All", func(t *testing.T) { - result, err := typesenseClient.Stemming().Dictionaries().Retrieve(context.Background()) - require.NoError(t, err) - require.Contains(t, *result.JSON200.Dictionaries, dictionaryId) - }) -} \ No newline at end of file + t.Run("List All", func(t *testing.T) { + result, err := typesenseClient.Stemming().Dictionaries().Retrieve(context.Background()) + require.NoError(t, err) + require.Contains(t, *result.JSON200.Dictionaries, dictionaryId) + }) +} diff --git a/typesense/test/stopword_test.go b/typesense/test/stopword_test.go index ed28520..2286700 100644 --- a/typesense/test/stopword_test.go +++ b/typesense/test/stopword_test.go @@ -8,8 +8,8 @@ import ( "testing" "github.com/stretchr/testify/require" - "github.com/typesense/typesense-go/v3/typesense/api" - "github.com/typesense/typesense-go/v3/typesense/api/pointer" + "github.com/typesense/typesense-go/v4/typesense/api" + "github.com/typesense/typesense-go/v4/typesense/api/pointer" ) func TestStopwordRetrieve(t *testing.T) { diff --git a/typesense/test/stopwords_test.go b/typesense/test/stopwords_test.go index 0736aef..985629a 100644 --- a/typesense/test/stopwords_test.go +++ b/typesense/test/stopwords_test.go @@ -9,8 +9,8 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/typesense/typesense-go/v3/typesense/api" - "github.com/typesense/typesense-go/v3/typesense/api/pointer" + "github.com/typesense/typesense-go/v4/typesense/api" + "github.com/typesense/typesense-go/v4/typesense/api/pointer" ) func TestStopwordsUpsert(t *testing.T) { diff --git a/typesense/test/synonym_test.go b/typesense/test/synonym_test.go index 173901d..94d422a 100644 --- a/typesense/test/synonym_test.go +++ b/typesense/test/synonym_test.go @@ -8,7 +8,7 @@ import ( "testing" "github.com/stretchr/testify/require" - "github.com/typesense/typesense-go/v3/typesense/api/pointer" + "github.com/typesense/typesense-go/v4/typesense/api/pointer" ) func TestSearchSynonymRetrieve(t *testing.T) { diff --git a/typesense/test/synonyms_test.go b/typesense/test/synonyms_test.go index 4230173..c8a6c84 100644 --- a/typesense/test/synonyms_test.go +++ b/typesense/test/synonyms_test.go @@ -9,8 +9,8 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/typesense/typesense-go/v3/typesense/api" - "github.com/typesense/typesense-go/v3/typesense/api/pointer" + "github.com/typesense/typesense-go/v4/typesense/api" + "github.com/typesense/typesense-go/v4/typesense/api/pointer" ) func TestSearchSynonymUpsertNewSynonym(t *testing.T) {