Releases: meilisearch/meilisearch-go
v0.26.0 🐹
⚠️ Breaking changes: Enhanced Enumeration for Task Types & Statuses
The Meilisearch Go client has undergone a significant enhancement in how it handles task types and statuses. In prior versions, developers interfaced with tasks using generic strings. This methodology, while functional, lacked clarity and posed maintenance challenges.
TaskType
and TaskStatus
have transitioned from generic strings to definitive constants. This change augments code clarity, minimizes potential errors, and paves the way for smoother future updates.
Quick Exemple
// Before:
taskType := "documentDeletion"
...
// After:
taskType := meilisearch.TaskTypeDocumentDeletion
Real world example
// Before:
func Before() {
resp, _ := meilisearchClient.GetTasks(&meilisearch.TasksQuery{
Statuses: []string("enqueued", "processing"),
Types: []string("documentDeletion", "documentAdditionOrUpdate"),
})
for _, task := range resp.Results {
if task.Status == "processing" {
// ...
}
if task.Type == "documentDeletion" {
// ...
}
}
}
// After:
func After() {
resp, _ := meilisearchClient.GetTasks(&meilisearch.TasksQuery{
Statuses: []meilisearch.TaskStatus{
meilisearch.TaskStatusEnqueued,
meilisearch.TaskStatusProcessing,
},
Types: []meilisearch.TaskType{
meilisearch.TaskTypeDocumentDeletion,
meilisearch.TaskTypeDocumentAdditionOrUpdate,
},
})
for _, task := range resp.Results {
if task.Status == meilisearch.TaskStatusProcessing {
// ...
}
if task.Type == meilisearch.TaskTypeDocumentDeletion {
// ...
}
}
}
🚀 Enhancements
Thanks again to @42atomys, @curquiza, @datbeohbbh, and @tadejsv! 🎉
v0.25.1 🐹
🚀 Enhancements
- Add support for attributesToSearchOn (v1.3) (#458) @barribarrier
- Add Total Tasks in task route #636 (#475) @tonyghouse
- Add support for rankingScore (v1.3) (#477) @aooohan
- Add support for vectorSearch (v1.3) (#483) @luigibarbato
🐛 Bug Fixes
Thanks again to @Azanul, @Esmeralda-lad, @alallema, @aooohan, @barribarrier, @brunoocasali, @curquiza, @luigibarbato, @manujz, and @tonyghouse! 🎉
v0.25.0 🐹
Release CHANGELOG:
This version introduces features released on Meilisearch v1.2.0 🎉
Check out the changelog of Meilisearch v1.2.0 for more information on the changes.
🚀 Enhancements
-
Addition of the method
DeleteDocumentsByFilter
, this method takes aninterface{}
which allows you to send different types of filters (string
,[]string
,[]interface{}{[]string{}}
, ...). Thefilter
field works precisely like thefilter
field used on the search method. See the docs on how to use filters. #440 @alallema⚠️ You must configure the attributes you want to filter using theIndex.UpdateFilterableAttributes()
.
⚠️ Remember to update your Meilisearch server to v1.2.0 or newer before adopting it. -
Add the ability to add
Filter
in theDocumentsQuery
. When a query with afilter
is sent togetDocuments
, it will filter the documents like thesearch
method. See the docs on how to use filters. #439 @alallema⚠️ You must configure the attributes you want to filter using theIndex.UpdateFilterableAttributes()
.
⚠️ Remember to update your Meilisearch server to v1.2.0 or newer before adopting it.
v0.24.0 🐹
This version introduces features released on Meilisearch v1.1.0 🎉
Check out the changelog of Meilisearch v1.1.0 for more information on the changes.
🐛 Bug Fixes
- fix(indexes): Fill in
client
forGetIndexes
results (#426) @candiduslynx
⚠️ Breaking changes
- Add the ability to provide a specific
csv-delimiter
when adding and updating documents in CSV format (#424) @alallema- New type
CsvDocumentsQuery{}
- Changed
AddDocumentsCsv()
which takesCsvDocumentsQuery
as a parameter instead of a...string
- Changed
AddDocumentsCsvInBatches()
which takesCsvDocumentsQuery
as a parameter instead of a...string
- Changed
UpdateDocumentsCsv()
which takesCsvDocumentsQuery
as a parameter instead of a...string
- Changed
UpdateDocumentsCsvInBatches()
which takesCsvDocumentsQuery
as a parameter instead of a...string
- New type
🚀 Enhancements
- Add FacetStats field in SearchResponse (#423) @alallema
- New method
client.MultiSearch()
provides the possibility to make multiple requests at once (#422) @alallema
Example:
client.MultiSearch(&MultiSearchRequest{
Queries: []SearchRequest{
{
IndexUID: "movies",
Query: "pooh",
Limit: 5,
},
{
IndexUID: "movies",
Query: "nemo",
Limit: 5,
},
{
IndexUID: "movie_ratings",
Query: "us",
},
},
})
Thanks again to @alallema, @candiduslynx ! 🎉
v0.23.1 🐹
🚀 Enhancements
- Implement
UpdateDocument
methods for CSV & NdJson (#408) @AzanulUpdateDocumentsCsv
UpdateDocumentsCsvInBatches
UpdateDocumentsNdjson
UpdateDocumentsNdjsonInBatches
🐛 Bug Fixes
- Avoid panic when sending
(...[]string{})
inAddDocument()
(#417) @bestgopher
Thanks again to @Azanul, @alallema, @bestgopher, @brunoocasali! 🎉
v0.23.0 🐹
This version makes this package compatible with Meilisearch v1.0.0 🎉
Check out the changelog of Meilisearch vv1.0.0 for more information on the changes(#405).
⚠️ Breaking changes
- KeyParsed struct has been changed; this structure is used to manage the time format when creating a key, however, all the
Key
fields were available in the structure, while only those used to create a key should be available in it.createdAt
has been removedupdatedAt
has been removed
Thanks again to @Thearas, @alallema, @bidoubiwa! 🎉
v0.22.0 🐹
This version makes this package compatible with Meilisearch v0.30.0 🎉
Check out the changelog of Meilisearch v0.30.0 for more information on the changes(#382).
⚠️ Breaking change
- Parameters on
GetTasks
name changes: #390Status
->Statuses
IndexUID
->IndexUIDS
Type
->Types
🚀 Enhancements
- New
pagination
strategy with the search parametersPage
andHitsPerPage
#392 - New filters on
GetTasks
:UID
,BeforeEnqueuedAt
,AfterEnqueuedAt
, ... see #390 - New
client.CancelTasks
method that lets you cancelenqueued
andprocessing
tasks #395 - New
client.DeleteTasks
method that lets you delete tasks #396 - New
client.SwapIndexes
method that lets you swap two indexes #397 - New fields on
Task.Details
#395
Thanks again to @alallema! 🎉
v0.21.1 🐹
🚀 Enhancements
- Rename MEILISEARCH_HOST to MEILISEARCH_URL (#366) @washbin
- add SearchRaw to return raw JSON from search (#377) @ginglis13
Thanks again to @alallema, @austinvazquez, @ginglis13, @shadowshot-x and @washbin! 🎉
v0.21.0 🐹
Check out the changelog of Meilisearch v0.29.0 for more information on the changes.
⚠️ Breaking changes
This breaking change may not affect you, but in any case, you should check your search queries if you want to keep the same behavior from v0.28
.
- The
NOT
filter keyword does not have an implicitlyEXIST
operator anymore. Check out for more information: meilisearch/meilisearch#2486 - Remove
All
from the methods name (#356) @vishalsodani
🚀 Enhancements
- Improve Docker configuration in the package (#301)
- Create key: Add ability to specify the
Uid
andName
value (#342) @dbolkensteyn - Pre-allocate search post body for
Index.Search()
(#341) @trim21 - Ensure support to the new search query parameter
MatchingStrategy
(#348) @brunoocasali - Ensure support to keys with wildcarded actions.
actions
field during key creation now accepts wildcards on actions. For example,indexes.*
provides rights toindexes.create
,indexes.get
,indexes.delete
,indexes.delete
, andindexes.update
. (#349) @brunoocasali
Thanks again to @OptimusePrime, @alallema, @brunoocasali, @dbolkensteyn, @tMinamiii, @trim21 and @vishalsodani! 🎉