Releases: typesense/typesense-go
Releases · typesense/typesense-go
v3.1.0
v3.0.0
What's Changed
- [Breaking Change]
MultiSearchCollectionParameters.collection
is now optional. Fixed issue #168.
searches := api.MultiSearchSearchesParameter{
Searches: []api.MultiSearchCollectionParameters{
{
Q: pointer.String("Company"),
// before
// Collection: "companies",
Collection: pointer.Any("companies"),
},
},
}
- [Breaking Change] Single document index methods now include an additional parameter to specify dirty values behavior.
client.Collection("companies").Documents().Create(context.Background(), document, &api.DocumentIndexParameters{DirtyValues: pointer.Any(api.CoerceOrDrop)})
client.Collection("companies").Documents().Upsert(context.Background(), document, &api.DocumentIndexParameters{DirtyValues: pointer.Any(api.CoerceOrDrop)})
client.Collection("companies").Document("123").Update(context.Background(), document, &api.DocumentIndexParameters{DirtyValues: pointer.Any(api.CoerceOrDrop)})
- [Breaking Change] An additional parameter
*api.ExportDocumentsParams
allows control over export results.
client.Collection("companies").Documents().Export(context.Background(), &api.ExportDocumentsParams{
FilterBy: pointer.String("num_employees>:1000"),
IncludeFields: pointer.String("name"),
ExcludeFields: pointer.String("year"),
})
- [Breaking Change] The import
Action
type is now an enum instead of*string
.
&api.ImportDocumentsParams{
// Action: pointer.String("create"),
Action: pointer.Any(api.Create),
}
- [Breaking Change] The
Query
andMatch
fields in override rules are now optional.
api.SearchOverrideRule{
// before
// Query: "apple",
// Match: "exact",
Query: pointer.String("apple"),
Match: pointer.Any(api.Exact),
}
- [Breaking Change]
SearchParameters
fieldsQ
andQueryBy
are now optional.
preset := &api.PresetUpsertSchema{}
preset.Value.FromSearchParameters(api.SearchParameters{
Q: pointer.Any("company"),
QueryBy: pointer.String("name"),
})
Features:
- Added Analytics and Conversation APIs, updated override and search parameters.
- Allowed embedding of separate API keys for each search in multi-search.
- Added a generic
pointer.Any()
helper function that converts any type into a pointer. This is especially useful for parameters of enum types.
// before
var upsertAction api.IndexDocumentParamsAction = "upsert"
&api.IndexDocumentParams{
Action: &upsertAction,
}
// after
&api.IndexDocumentParams{
Action: pointer.Any(api.Upsert),
}
Fixes:
- Fixed issue #147.
- Fixed issue #189.
v2.0.0
v1.1.0
- Add generics support (document operations are now optionally [typed](https://github.com/typesense/typesense-go?tab=readme-ov- file#typed-document-operations))
- Bump oapi-codegen to v2
- Run mockgen and oapi-codegen via go run
- Pull latest api changes
v1.0.0
v1.0
There is a breaking change in the client interface that warranted a major version release: