meilisearch 0.16.0 meilisearch: ^0.16.0 copied to clipboard
Meilisearch Dart is the Meilisearch API client for Dart and Flutter developers.
0.16.0 #
Breaking Changes: #
scoreDetails
feature 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
Faceting
to befinal
, and remove the default values - Mark all
Searcheable<T>
fields in the constructor asrequired
- Bug Fix
Searcheable<T>
had a wrongmatchesPosition
property, which was moved intoMeiliDocumentContainer<T>
Changes: #
- Add
int? total
toTasksResults
- Add
attributesToSearchOn
toSearchQuery
andIndexSearchQuery
- Add
Future<FacetSearchResult> facetSearch(FacetSearchQuery query)
toMeiliSearchIndex
- Add
enum FacetingSortTypes
- Add
Map<String, FacetingSortTypes>? sortFacetValuesBy
toFaceting
- [experimental]* Add
List? vector
toSearchQuery
andIndexSearchQuery
- [experimental]* Add
bool? showRankingScoreDetails
toSearchQuery
andIndexSearchQuery
- Add
bool? showRankingScore
toSearchQuery
andIndexSearchQuery
- Add
MeiliDocumentContainer<T>
- Add
Map<String, dynamic> src
toSearchable
which 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
,query
fromSearchQuery
to the newIndexSearchQuery
. - Changed
deleteDocuments
signature:
// from:
- Future<Task> deleteDocuments(List<Object> ids)
+ Future<Task> deleteDocuments(DeleteDocumentsQuery query)
// to:
- index.deleteDocuments([456, 4])
+ index.deleteDocuments(DeleteDocumentsQuery(ids: [456, 4]))
MeiliSearchIndex.search
now takes aString query
and aSearchQuery
object 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.geoBoundingBox
andMeili.geoRadius
now take record values to represent thelat
/lng
points:
// 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.queries
to 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
RequiredMeiliServerVersion
which documents the version this members were introduced. - Introduce filter expressions for
IS NULL
,IS NOT NULL
,IS EMPTY
,IS NOT EMPTY
. - Added
filter
,filterExpression
parameter toDocumentsQuery
. - Some internal
Queryable
refactoring to unify its behavior and avoid duplicating the code. - Added a workaround for https://github.com/meilisearch/meilisearch/issues/3740 by
jsonEncoding
attribute names when usingfilterExpression
s - A new type is introduced
IndexSearchQuery
which extendsSearchQuery
.- Added
copyWith
toSearchQuery
andIndexSearchQuery
- Added
0.12.0 #
Breaking Changes: #
SwapIndex
class has a newassert
to require at least two items in thethis.indexes
attribute.- 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
csvDelimiter
parameter toaddDocumentsCsv
,addDocumentsCsvInBatches
,updateDocumentsCsv
,updateDocumentsCsvInBatches
MeiliSearchIndex
methods. - Add support for
_geoBoundingBox
infilterExpression
0.11.0 #
Breaking Changes: #
- Changes
Searcheable
,SearchResult
,PaginatedSearchResult
signatures 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
:MeiliSearchClient
classFuture<Map<String, dynamic>> health();
HttpRequest
classMap<String, dynamic> headers();
MeiliSearchIndex
classFuture<Searcheable<Map<String, dynamic>>> search(...);
MeiliSearchIndex
classFuture<Map<String, dynamic>?> getDocument(Object id, {List<String> fields});
MeiliSearchIndex
classFuture<Result<Map<String, dynamic>>> getDocuments({DocumentsQuery? params});
Searcheable<T>.hits
is 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
MultiSearchQuery
class to handle search requests. - Add
Future<MultiSearchResult> multiSearch(MultiSearchQuery requests);
toMeiliSearchClient
.
0.10.1 #
Bug Fixes: #
- Fix the behavior of
client.index.getTasks()
where theindexUid
was not changing correctly after consecutive calls.
0.10.0 #
Changes: #
-
Add
pagination
settings methodsFuture<Pagination> getPagination()
,Future<Task> resetPagination()
,Future<Task> updatePagination(Pagination pagination)
onIndex
instances. -
Add
faceting
settings methodsFuture<Faceting> getFaceting()
,Future<Task> resetFaceting()
,Future<Task> updateFaceting(Faceting faceting)
onIndex
instances. -
Add
typo tolerance
settings methodsFuture<TypoTolerance> getTypoTolerance()
,Future<Task> resetTypoTolerance()
,Future<Task> updateTypoTolerance(TypoTolerance typoTolerance)
onIndex
instances. -
Add filter-builder style:
-
Added
filterExpression
parameter to thesearch
method, which takes aMeiliOperatorExpressionBase
, you can only use the new parameter or the regularfilter
parameter, but not both. If both are provided,filter
parameter will take priority. -
Added new facade class
Meili
which 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 })
toIndex
instances. -
Add
Future<List<Task>> updateDocumentsInBatches(List<Map<String, Object?>> documents, { int batchSize = 1000, String? primaryKey })
toIndex
instances. -
Add support to create documents from ndJson and CSV formats directly from
Index
withaddDocumentsNdjson
,addDocumentsCsv
,updateDocumentsNdjson
, andupdateDocumentsCsv
methods. -
Add support for
Dio
adapter 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-Client
one.
0.9.0 #
Breaking Changes: #
-
The minimum supported Dart runtime is now
2.15
. -
Updated
dio
dependency fromv4
tov5
. -
MeiliSearchClientImpl.connectTimeout
,MeiliSearchClient.connectTimeout
is now aDuration
instead 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
dynamic
keyword by replacing it withObject?
.Queryable.toQuery
was promoted fromMap<String, dynamic>
toMap<String, Object>
due to the use ofremoveEmptyOrNulls
Result<T>
had argument typeT
that 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)
.getDocuments
changed signature fromFuture<Result> getDocuments({DocumentsQuery? params});
toFuture<Result<Map<String, Object?>>> getDocuments({DocumentsQuery? params});
, and now end users can call.map
on the result to use their own DTO classes (usingfromJson
for example).Future<Task> deleteDocuments(List<dynamic> ids);
toFuture<Task> deleteDocuments(List<Object> ids);
since deleting anull
id 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? filter
Future<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#canceledBy
field is now aList<int>
and not anint?
anymore.- Add
indexUid
toTask
Changes #
- Expose these classes:
PaginatedSearchResult
DocumentsQuery
TasksQuery
CancelTasksQuery
DeleteTasksQuery
KeysTasksQuery
IndexesTasksQuery
MatchingStrategy
enumMeiliSearchApiException
andCommunicationException
Task
andTaskError
SwapIndex
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.
SearchResult
now is returned fromsearch
requests when is a non-exhaustive pagination request. A instance ofPaginatedSearchResult
is 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.CancelTasksQuery
has 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.DeleteTasksQuery
has 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 #
TasksQuery
has 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#getDumpStatus
method was removed.MeiliSearchClient#getIndexes
method now return a object typeResult<MeiliSearchIndex>
.TaskInfo
,TaskImpl
,ClientTaskImpl
are now justTask
.- The method
getStatus
was removed in the new class.
- The method
MeiliSearchClient#generateTenantToken
now require aString uid
which is theuid
of theKey
instance used to sign the token.MeiliSearchClient#createDump
now responds withTask
.MeiliSearchClient#getKeys
method now return a object typeFuture<Result<Key>>
.MeiliSearchClient#updateKey
now can just update adescription
and/orname
.MeiliSearchClient#getTasks
method now return a object typeFuture<TasksResults>
.MeiliSearchIndex#getTasks
method now return a object typeFuture<TasksResults>
.MeiliSearchIndex#search
facetsDistribution
is nowfacets
MeiliSearchIndex#search
matches
is nowshowMatchesPosition
MeiliSearchIndex#getDocuments
method now return a object typeFuture<Result>
.MeiliSearchIndex#getDocuments
method now accepts a object as a parameter andoffset
,limit
,attributesToRetrieve
were not longer accepted.nbHits
,exhaustiveNbHits
,facetsDistribution
,exhaustiveFacetsCount
were removed fromSearchResult
.- Remove unused generic
T
inMeiliSearchClient#search
method
Changes #
MeiliSearchClient#getIndexes
accepts a objectIndexesQuery
to filter and paginate the results.MeiliSearchClient#getKeys
accepts a objectKeysQuery
to filter and paginate the results.MeiliSearchClient#getKey
accepts both aKey#uid
orKey#key
value.MeiliSearchClient#getTasks
accepts a objectTasksQuery
to filter and paginate the results.MeiliSearchIndex#getTasks
accepts a objectTasksQuery
to filter and paginate the results.MeiliSearchClient#createKey
can specify auid
(optionally) to create a newKey
.MeiliSearchIndex#getDocuments
accepts a objectDocumentsQuery
to filter and paginate the results.Key
has now aname
anduid
string fields.MeiliSearchIndex#getDocument
accepts a list of fields to reduce the final payload.estimatedTotalHits
,facetDistribution
were added toSearchResult
- Sending a invalid
uid
orapiKey
will raiseInvalidApiKeyException
in 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-Agent
header 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 upgrade
in dependencies (#128) @brunoocasali - Add support to keys (according to v0.25.0 spec) more (#121) @brunoocasali
- Create a new resource class
Key
to represent keys - Create methods to support keys:
client.getKeys
client.getKey
client.createKey
client.updateKey
client.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
getOrCreate
fromMeiliSearchClient
(#119) @brunoocasali - Rename
PendingUpdate
toTaskInfo
(#123) @brunoocasali - Meilisearch v0.25.0 uses
Authorization
header instead ofX-Meili-API-Key
(#121) @brunoocasali - Multiple naming changes regarding the v0.25.0 upgrade (#119, #120, #125, #127) @brunoocasali:
client.getUpdateStatus
toclient.getTask
client.getAllUpdateStatus
toclient.getTasks
client.getKeys
responds with aFuture<List<Key>>
notFuture<Map<String, String>>
index.update
,index.delete
,client.createIndex
,client.deleteIndex
andclient.updateIndex
now responds withFuture<TaskInfo>
index.getAllUpdateStatus
toindex.getTasks
index.getUpdateStatus
toindex.getTask
0.4.0 #
- Rename
errorCode
,errorType
anderrorLink
intocode
,type
andlink
in 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
sort
parameter (#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