meilisearch 0.17.1
meilisearch: ^0.17.1 copied to clipboard
Meilisearch Dart is the Meilisearch API client for Dart and Flutter developers.
0.17.0 #
Breaking Changes: #
- AI-powered search is now stable. Use it without activating the experimental feature.
0.16.0 #
Breaking Changes: #
scoreDetailsfeature is not experimental anymore. You can directly use showRankingScoreDetails during a search without activating the experimental feature
0.15.0 #
Breaking Changes: #
- Change members of
Facetingto befinal, and remove the default values - Mark all
Searcheable<T>fields in the constructor asrequired - Bug Fix
Searcheable<T>had a wrongmatchesPositionproperty, which was moved intoMeiliDocumentContainer<T>
Changes: #
- Add
int? totaltoTasksResults - Add
attributesToSearchOntoSearchQueryandIndexSearchQuery - Add
Future<FacetSearchResult> facetSearch(FacetSearchQuery query)toMeiliSearchIndex - Add
enum FacetingSortTypes - Add
Map<String, FacetingSortTypes>? sortFacetValuesBytoFaceting - [experimental]* Add
List? vectortoSearchQueryandIndexSearchQuery - [experimental]* Add
bool? showRankingScoreDetailstoSearchQueryandIndexSearchQuery - Add
bool? showRankingScoretoSearchQueryandIndexSearchQuery - Add
MeiliDocumentContainer<T> - Add
Map<String, dynamic> srctoSearchablewhich exposes the raw json object returned from the server. Just in case we don't keep up with new meilisearch releases, the user has a way to access new features.
[experimental]* To adopt a experimental change you must opt-in manually
0.14.0 #
Breaking Changes: #
- Moved
indexUid,queryfromSearchQueryto the newIndexSearchQuery. - Changed
deleteDocumentssignature:
// from:
- Future<Task> deleteDocuments(List<Object> ids)
+ Future<Task> deleteDocuments(DeleteDocumentsQuery query)
// to:
- index.deleteDocuments([456, 4])
+ index.deleteDocuments(DeleteDocumentsQuery(ids: [456, 4]))
MeiliSearchIndex.searchnow takes aString queryand aSearchQueryobject as the only inputs.- Replace any ocurrence of search
index.search('xyz', ....)withindex.search('xyz', SearchQuery(....))
- Replace any ocurrence of search
- await client.index('books').search('query', sort: [], filter: ...);
+ await client.index('books').search('query', SearchQuery(sort: [], filter: ...));
Meili.geoBoundingBoxandMeili.geoRadiusnow take record values to represent thelat/lngpoints:
// Confusing, unclear
- Meili.geoBoundingBox(3,5.3,10,20)
// Not Confusing :)
+ Meili.geoBoundingBox((lat: 3, lng: 5.3), (lat: 10, lng: 20))
// Confusing, unclear
- Meili.geoRadius(3, 5.3, 100)
// Not Confusing :)
+ Meili.geoRadius((lat: 3, lng: 5.3), 100)
- Change
MultiSearchQuery.queriesto be aList<IndexSearchQuery>instead of aList<SearchQuery>:
final result = await client.multiSearch(MultiSearchQuery(queries: [
- SearchQuery(
+ IndexSearchQuery(
query: "",
indexUid: index1.uid,
),
- SearchQuery(
+ IndexSearchQuery(
query: "",
indexUid: index2.uid,
),
];
Changes: #
- Introduce a new annotation
RequiredMeiliServerVersionwhich documents the version this members were introduced. - Introduce filter expressions for
IS NULL,IS NOT NULL,IS EMPTY,IS NOT EMPTY. - Added
filter,filterExpressionparameter toDocumentsQuery. - Some internal
Queryablerefactoring to unify its behavior and avoid duplicating the code. - Added a workaround for https://github.com/meilisearch/meilisearch/issues/3740 by
jsonEncodingattribute names when usingfilterExpressions - A new type is introduced
IndexSearchQuerywhich extendsSearchQuery.- Added
copyWithtoSearchQueryandIndexSearchQuery
- Added
0.12.0 #
Breaking Changes: #
SwapIndexclass has a newassertto require at least two items in thethis.indexesattribute.- Introduces new classes:
FacetStat,MatchPosition. - Change
Searchable<T>to have proper types:
- final Object? facetDistribution;
+ final Map<String, Map<String, int>>? facetDistribution;
- final Object? matchesPosition;
+ final Map<String, List<MatchPosition>>? matchesPosition;
+ final Map<String, FacetStat>? facetStats;
Changes: #
- Add
csvDelimiterparameter toaddDocumentsCsv,addDocumentsCsvInBatches,updateDocumentsCsv,updateDocumentsCsvInBatchesMeiliSearchIndexmethods. - Add support for
_geoBoundingBoxinfilterExpression
0.11.0 #
Breaking Changes: #
- Changes
Searcheable,SearchResult,PaginatedSearchResultsignatures to be genericSearcheable<T>,SearchResult<T>,PaginatedSearchResult<T> - Adds a new
map<TOther>method toSearcheable<T>and its subclasses to map the search result to a different type. - All search operations produce
Searcheable<Map<String, dynamic>>by default, which can be mapped to other types using themap<TOther>method. - Revert some of the
Object?types that were changed fromdynamic:MeiliSearchClientclassFuture<Map<String, dynamic>> health();HttpRequestclassMap<String, dynamic> headers();MeiliSearchIndexclassFuture<Searcheable<Map<String, dynamic>>> search(...);MeiliSearchIndexclassFuture<Map<String, dynamic>?> getDocument(Object id, {List<String> fields});MeiliSearchIndexclassFuture<Result<Map<String, dynamic>>> getDocuments({DocumentsQuery? params});
Searcheable<T>.hitsis non-nullable now, and defaults toconst []
Changes: #
- Introduced new extension methods to help consumers cast
Future<Searchable<T>>to the corresponding type:
final result = await index.search('').then((value) => (value as SearchResult<Map<String, dynamic>>).map(BookDto.fromMap));
final resultPaginated = await index.search('').then((value) => (value as PaginatedSearchResult<Map<String, dynamic>>).map(BookDto.fromMap));
to:
final result = await index.search('').asSearchResult().map(BookDto.fromMap);
final resultPaginated = await index.search('').asPaginatedResult().map(BookDto.fromMap);
0.10.2 #
Changes: #
- Introduce
MultiSearchQueryclass to handle search requests. - Add
Future<MultiSearchResult> multiSearch(MultiSearchQuery requests);toMeiliSearchClient.
0.10.1 #
Bug Fixes: #
- Fix the behavior of
client.index.getTasks()where theindexUidwas not changing correctly after consecutive calls.
0.10.0 #
Changes: #
-
Add
paginationsettings methodsFuture<Pagination> getPagination(),Future<Task> resetPagination(),Future<Task> updatePagination(Pagination pagination)onIndexinstances. -
Add
facetingsettings methodsFuture<Faceting> getFaceting(),Future<Task> resetFaceting(),Future<Task> updateFaceting(Faceting faceting)onIndexinstances. -
Add
typo tolerancesettings methodsFuture<TypoTolerance> getTypoTolerance(),Future<Task> resetTypoTolerance(),Future<Task> updateTypoTolerance(TypoTolerance typoTolerance)onIndexinstances. -
Add filter-builder style:
-
Added
filterExpressionparameter to thesearchmethod, which takes aMeiliOperatorExpressionBase, you can only use the new parameter or the regularfilterparameter, but not both. If both are provided,filterparameter will take priority. -
Added new facade class
Meiliwhich contains static methods to help create filter expressions. -
Added extension method
toMeiliAttribute()to String, which is equivalent toMeili.attr. -
Added extension method
toMeiliValue()toString,num,DateTime,bool, which are equivalent toMeili.value. -
example:This queryawait index.search('prince', filterExpression: Meili.eq(Meili.attribute('tag'), Meili.value("Tale")));is the same asawait index.search('prince', filter: "tag = Tale").
-
-
Add
Future<List<Task>> addDocumentsInBatches(List<Map<String, Object?>> documents, { int batchSize = 1000, String? primaryKey })toIndexinstances. -
Add
Future<List<Task>> updateDocumentsInBatches(List<Map<String, Object?>> documents, { int batchSize = 1000, String? primaryKey })toIndexinstances. -
Add support to create documents from ndJson and CSV formats directly from
IndexwithaddDocumentsNdjson,addDocumentsCsv,updateDocumentsNdjson, andupdateDocumentsCsvmethods. -
Add support for
Dioadapter customization withMeiliSearchClient.withCustomDio(url, apiKey: "secret", interceptors: [interceptor])(e.g: you can use this to inject custom code, support to HTTP/2 and more)
Special thanks to @ahmednfwela 🎉
0.9.1 #
- [web] Fix a bug that affected the web platform regarding the override of
User-Agent. Now the header used to send the client name information is theX-Meilisearch-Clientone.
0.9.0 #
Breaking Changes: #
-
The minimum supported Dart runtime is now
2.15. -
Updated
diodependency fromv4tov5. -
MeiliSearchClientImpl.connectTimeout,MeiliSearchClient.connectTimeoutis now aDurationinstead ofint, and the default isDuration(seconds: 5). -
From
Future<Response<T>> getMethod<T>(String path, {Map<String, dynamic>? queryParameters,});toFuture<Response<T>> getMethod<T>(String path, { Object? data, Map<String, Object?>? queryParameters }) -
Reduce usage of
dynamickeyword by replacing it withObject?.Queryable.toQuerywas promoted fromMap<String, dynamic>toMap<String, Object>due to the use ofremoveEmptyOrNullsResult<T>had argument typeTthat was never used, so it was changed fromList<dynamic> results;toList<T> results;and introduced a new helper functionResult<TTarget> map<TTarget>(TTarget Function(T item) converter).getDocumentschanged signature fromFuture<Result> getDocuments({DocumentsQuery? params});toFuture<Result<Map<String, Object?>>> getDocuments({DocumentsQuery? params});, and now end users can call.mapon the result to use their own DTO classes (usingfromJsonfor example).Future<Task> deleteDocuments(List<dynamic> ids);toFuture<Task> deleteDocuments(List<Object> ids);since deleting anullid was an illegal operation.Future<Task> deleteDocument(dynamic id);toFuture<Task> deleteDocument(Object id);Future<Task> updateDocuments(List<Map<String, dynamic>> documents, {String? primaryKey});toFuture<Task> updateDocuments(List<Map<String, Object?>> documents, {String? primaryKey});Future<Task> addDocuments(List<Map<String, dynamic>> documents, {String? primaryKey});toFuture<Task> addDocuments(List<Map<String, Object?>> documents, {String? primaryKey});Future<Task> deleteDocument(dynamic id);toFuture<Task> deleteDocument(Object id);Future<Map<String, dynamic>?> getDocument(dynamic id, {List<String> fields});toFuture<Map<String, Object?>?> getDocument(Object id, {List<String> fields});Future<Searcheable> search(String? query, {...dynamic filter...})is now aObject? filterFuture<Map<String, dynamic>> getRawIndex(String uid);toFuture<Map<String, Object?>> getRawIndex(String uid);Future<Map<String, dynamic>> health();toFuture<Map<String, Object?>> health();String generateTenantToken(String uid, dynamic searchRules,...toString generateTenantToken(String uid, Object? searchRules,...class TasksResults<T> { ... }toclass TasksResults { ... }
Changes #
- Fix a bug in the creation of keys with an existing
uid.
0.8.0 #
Breaking changes #
TasksQuery#canceledByfield is now aList<int>and not anint?anymore.- Add
indexUidtoTask
Changes #
- Expose these classes:
PaginatedSearchResultDocumentsQueryTasksQueryCancelTasksQueryDeleteTasksQueryKeysTasksQueryIndexesTasksQueryMatchingStrategyenumMeiliSearchApiExceptionandCommunicationExceptionTaskandTaskErrorSwapIndex
0.7.0 [deprecated] #
Changes #
⚠️ Don't use this version if you're using with Flutter or Web. It is not supported due to a mistake in the implementation of the Queryable class.
Please use the next available version.
SearchResultnow is returned fromsearchrequests when is a non-exhaustive pagination request. A instance ofPaginatedSearchResultis returned when the request was made with finite pagination.- Add
Future<Task> swapIndexes(List<SwapIndex> swaps)method to swap indexes. - Add
Future<Task> cancelTasks({CancelTasksQuery? params})to cancel tasks based on the input query params.CancelTasksQueryhas these fields:int? next;DateTime? beforeEnqueuedAt;DateTime? afterEnqueuedAt;DateTime? beforeStartedAt;DateTime? afterStartedAt;DateTime? beforeFinishedAt;DateTime? afterFinishedAt;List<int> uids;List<String> statuses;List<String> types;List<String> indexUids;
- Add
Future<Task> deleteTasks({DeleteTasksQuery? params})delete old processed tasks based on the input query params.DeleteTasksQueryhas these fields:int? next;DateTime? beforeEnqueuedAt;DateTime? afterEnqueuedAt;DateTime? beforeStartedAt;DateTime? afterStartedAt;DateTime? beforeFinishedAt;DateTime? afterFinishedAt;List<int> canceledBy;List<int> uids;List<String> statuses;List<String> types;List<String> indexUids;
Breaking changes #
TasksQueryhas new fields, and some of them were renamed:- those fields were added:
int? canceledBy;DateTime? beforeEnqueuedAt;DateTime? afterEnqueuedAt;DateTime? beforeStartedAt;DateTime? afterStartedAt;DateTime? beforeFinishedAt;DateTime? afterFinishedAt;List<int> uids;
- those were renamed:
List<String> statuses;fromList<String> status;List<String> types;fromList<String> type;List<String> indexUids;fromList<String> indexUid;
- those fields were added:
0.6.0 #
This version makes this package compatible with Meilisearch v0.28.0 and newer
Breaking changes #
MeiliSearchClient#getDumpStatusmethod was removed.MeiliSearchClient#getIndexesmethod now return a object typeResult<MeiliSearchIndex>.TaskInfo,TaskImpl,ClientTaskImplare now justTask.- The method
getStatuswas removed in the new class.
- The method
MeiliSearchClient#generateTenantTokennow require aString uidwhich is theuidof theKeyinstance used to sign the token.MeiliSearchClient#createDumpnow responds withTask.MeiliSearchClient#getKeysmethod now return a object typeFuture<Result<Key>>.MeiliSearchClient#updateKeynow can just update adescriptionand/orname.MeiliSearchClient#getTasksmethod now return a object typeFuture<TasksResults>.MeiliSearchIndex#getTasksmethod now return a object typeFuture<TasksResults>.MeiliSearchIndex#searchfacetsDistributionis nowfacetsMeiliSearchIndex#searchmatchesis nowshowMatchesPositionMeiliSearchIndex#getDocumentsmethod now return a object typeFuture<Result>.MeiliSearchIndex#getDocumentsmethod now accepts a object as a parameter andoffset,limit,attributesToRetrievewere not longer accepted.nbHits,exhaustiveNbHits,facetsDistribution,exhaustiveFacetsCountwere removed fromSearchResult.- Remove unused generic
TinMeiliSearchClient#searchmethod
Changes #
MeiliSearchClient#getIndexesaccepts a objectIndexesQueryto filter and paginate the results.MeiliSearchClient#getKeysaccepts a objectKeysQueryto filter and paginate the results.MeiliSearchClient#getKeyaccepts both aKey#uidorKey#keyvalue.MeiliSearchClient#getTasksaccepts a objectTasksQueryto filter and paginate the results.MeiliSearchIndex#getTasksaccepts a objectTasksQueryto filter and paginate the results.MeiliSearchClient#createKeycan specify auid(optionally) to create a newKey.MeiliSearchIndex#getDocumentsaccepts a objectDocumentsQueryto filter and paginate the results.Keyhas now anameanduidstring fields.MeiliSearchIndex#getDocumentaccepts a list of fields to reduce the final payload.estimatedTotalHits,facetDistributionwere added toSearchResult- Sending a invalid
uidorapiKeywill raiseInvalidApiKeyExceptionin thegenerateTenantToken.
0.5.3 #
This version makes this package compatible with Meilisearch v0.27.0 and newer
Changes #
- Ensure nested field support (#157) @brunoocasali
- Add
highlightPreTag,highlightPostTag,cropMarker, parameters in the search request (#156) @brunoocasali - Fix syntax issue in the README (#162) @mafreud
0.5.2 #
-
- Added new method
generateTenantToken()as a result of the addition of the multi-tenant functionality. This method creates a JWT tenant token that will allow the user to have multi-tenant indexes and thus restrict access to documents based on the end-user making the search request. (#139) @brunoocasali
- Added new method
0.5.1 #
- Add
User-Agentheader to have analytics in every http request (#129) @brunoocasali
0.5.0 #
This version makes this package compatible with Meilisearch v0.25.0 and newer
Changes #
- Add method to responds with raw information from API
client.getRawIndex(#124) @brunoocasali - Run a
pub upgradein dependencies (#128) @brunoocasali - Add support to keys (according to v0.25.0 spec) more (#121) @brunoocasali
- Create a new resource class
Keyto represent keys - Create methods to support keys:
client.getKeysclient.getKeyclient.createKeyclient.updateKeyclient.deleteKey
- Create a new resource class
- Add PATCH method support (#121) @brunoocasali
- Updates regarding code samples:
- setting guide sortable (#117) @alallema
- added all the changed methods based on the new version v0.25.0 (#126) @brunoocasali
Breaking changes #
- Remove
getOrCreatefromMeiliSearchClient(#119) @brunoocasali - Rename
PendingUpdatetoTaskInfo(#123) @brunoocasali - Meilisearch v0.25.0 uses
Authorizationheader instead ofX-Meili-API-Key(#121) @brunoocasali - Multiple naming changes regarding the v0.25.0 upgrade (#119, #120, #125, #127) @brunoocasali:
client.getUpdateStatustoclient.getTaskclient.getAllUpdateStatustoclient.getTasksclient.getKeysresponds with aFuture<List<Key>>notFuture<Map<String, String>>index.update,index.delete,client.createIndex,client.deleteIndexandclient.updateIndexnow responds withFuture<TaskInfo>index.getAllUpdateStatustoindex.getTasksindex.getUpdateStatustoindex.getTask
0.4.0 #
- Rename
errorCode,errorTypeanderrorLinkintocode,typeandlinkin the error handler (#110) @curquiza - Changes related to the next Meilisearch release (v0.24.0) (#109)
0.3.2 #
- Add json content type by default as header to make it compatible with Meilisearch v0.23.0 (#89) @curquiza
0.3.1 #
- Fixed cropLength type (#79) @sanders41
- Fix distinctAttribute in settings (#77) @sanders41
- Changes related to the next Meilisearch release (v0.22.0) (#82)
- Added sortable attributes (#83) @sanders41
- Add
sortparameter (#84) @curquiza
0.3.0 #
This version makes this package compatible with Meilisearch v0.21.0
Changes #
- Update PendingUpdateX (#62) @alallema
- Adding option to specify a connectTimeout duration (#59) @sanders41
- Adding getKeys method (#66) @sanders41
- Adding dump methods (#67) @sanders41
- Adding getVersion method (#68) @sanders41
- Adding sub-settings methods (#70) @sanders41
- Adding index.getStats and client.getStats methods (#69) @sanders41
- Adding getAllUpdateStatus and getUpdateStatus methods (#73) @sanders41
Breaking changes #
- Rename attributes_for_faceting into filterable_attributes (#61) @alallema
- Rename Filters into Filter (#63) @alallema
- Rename attributes for faceting into filterable attributes (#71) @curquiza
- Changes related to the next Meilisearch release (v0.21.0) (#40)
0.2.1 #
- Changes due to the implicit index creation (#48) @alallema
0.2.0 #
0.1.3 #
- Upgrade dependencies
0.1.2 #
- Fix: Rename facetDistribution into facetsDistribution
0.1.1 #
- Add example project
0.1.0+1 #
- Fix image in pub.dev listing
0.1.0 #
- Initial stable release
- Write unit tests
0.0.3-pre #
- Implemented search endpoints
- Implemented settings endpoints
- Implemented document endpoints
0.0.1-pre #
- Initial pre-release
