Skip to content

Commit 0a33f19

Browse files
meili-bors[bot]meili-botbrunoocasali
authored
Merge #323
323: Update version for the next release (v0.14.0) r=brunoocasali a=meili-bot This version introduces features released on Meilisearch v1.2.0 🎉 Check out the changelog of [Meilisearch v1.2.0](https://github.com/meilisearch/meilisearch/releases/tag/v1.2.0) for more information on the changes. ⚠️ If you want to adopt new features of this release, **update the Meilisearch server** to the according version. Check the complete CHANGELOG here: https://github.com/meilisearch/meilisearch-dart/blob/main/CHANGELOG.md ### 💥 Breaking changes - The method `deleteDocuments()` now supports a different behavior. This method now takes a `DeleteDocumentsQuery`, which could contain the filter or the `ids` (aka old behavior). #318 `@ahmednfwela` ⚠️ You must configure the attributes you want to filter using the `MeiliSearchIndex.filterableAttributes()`. ⚠️ Remember to **update your Meilisearch server to v1.2.0 or newer before** adopting it. Still, even being supported, the ability to receive only a list of ids is *deprecated*, and it will be removed soon. ```diff // from: - Future<Task> deleteDocuments(List<Object> ids) + Future<Task> deleteDocuments(DeleteDocumentsQuery query) // to: - index.deleteDocuments([456, 4]) + index.deleteDocuments(DeleteDocumentsQuery(ids: [456, 4])) ``` - Add the ability to set `filter` in the `DocumentsQuery`. When a query with a `filter` is sent to `getDocuments(params: DocumentsQuery)` it will filter the documents like the `search` method. See [the docs on how to use filters](https://www.meilisearch.com/docs/learn/advanced/filtering#filter-basics). #318 `@ahmednfwela` ⚠️ You must configure the attributes you want to filter using the `MeiliSearchIndex.filterableAttributes()`. ⚠️ Remember to **update your Meilisearch server to v1.2.0 or newer before** adopting it. - `MeiliSearchIndex.search` now takes a `String query` and a `SearchQuery` object as the only inputs. #310 `@ahmednfwela` - Replace any occurrence of search `index.search('xyz', ....)` with `index.search('xyz', SearchQuery(....))` ```diff - await client.index('books').search('query', sort: [], filter: ...); + await client.index('books').search('query', SearchQuery(sort: [], filter: ...)); ``` - `Meili.geoBoundingBox` and `Meili.geoRadius` now take record values to represent the `lat`/`lng` points: #310 `@ahmednfwela` ```diff // Confusing, unclear - Meili.geoBoundingBox(3,5.3,10,20) // Not Confusing :) + Meili.geoBoundingBox((lat: 3, lng: 5.3), (lat: 10, lng: 20)) ``` ```diff // Confusing, unclear - Meili.geoRadius(3, 5.3, 100) // Not Confusing :) + Meili.geoRadius((lat: 3, lng: 5.3), 100) ``` - Change `MultiSearchQuery.queries` to be a `List<IndexSearchQuery>` instead of a `List<SearchQuery>`: #310 `@ahmednfwela` ```diff final result = await client.multiSearch(MultiSearchQuery(queries: [ - SearchQuery( + IndexSearchQuery( query: "", indexUid: index1.uid, ), - SearchQuery( + IndexSearchQuery( query: "", indexUid: index2.uid, ), ]; ``` ### Enhancements: - Introduce a new annotation `RequiredMeiliServerVersion` which documents the version these members were introduced. #310 `@ahmednfwela` - Introduce filter expressions for `IS NULL`, `IS NOT NULL`, `IS EMPTY`, `IS NOT EMPTY`. #310 `@ahmednfwela` - Added `filter`, `filterExpression` parameter to `DocumentsQuery`. #310 `@ahmednfwela` - Some internal `Queryable` refactoring to unify its behavior and avoid duplicating the code. #310 `@ahmednfwela` - Added a workaround for meilisearch/meilisearch#3740 by `jsonEncoding` attribute names when using `filterExpression`s #310 `@ahmednfwela` - A new type is introduced `IndexSearchQuery` which extends `SearchQuery`. #310 `@ahmednfwela` - Added `copyWith` to `SearchQuery` and `IndexSearchQuery` #310 `@ahmednfwela` Thanks again to `@brunoocasali,` `@ahmednfwela!` 🎉 Co-authored-by: meili-bot <74670311+meili-bot@users.noreply.github.com> Co-authored-by: Bruno Casali <brunoocasali@gmail.com>
2 parents 3592870 + 9b6ef4d commit 0a33f19

File tree

4 files changed

+70
-6
lines changed

4 files changed

+70
-6
lines changed

CHANGELOG.md

+67-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,69 @@
11
[comment]: <> (All notable changes to this project will be documented in this file.)
22

3+
# 0.14.0
4+
### Breaking Changes:
5+
- Moved `indexUid`, `query` from `SearchQuery` to the new `IndexSearchQuery`.
6+
- Changed `deleteDocuments` signature:
7+
8+
```diff
9+
// from:
10+
- Future<Task> deleteDocuments(List<Object> ids)
11+
+ Future<Task> deleteDocuments(DeleteDocumentsQuery query)
12+
13+
// to:
14+
- index.deleteDocuments([456, 4])
15+
+ index.deleteDocuments(DeleteDocumentsQuery(ids: [456, 4]))
16+
```
17+
18+
- `MeiliSearchIndex.search` now takes a `String query` and a `SearchQuery` object as the only inputs.
19+
- Replace any ocurrence of search `index.search('xyz', ....)` with `index.search('xyz', SearchQuery(....))`
20+
21+
```diff
22+
- await client.index('books').search('query', sort: [], filter: ...);
23+
+ await client.index('books').search('query', SearchQuery(sort: [], filter: ...));
24+
```
25+
26+
- `Meili.geoBoundingBox` and `Meili.geoRadius` now take record values to represent the `lat`/`lng` points:
27+
```diff
28+
// Confusing, unclear
29+
- Meili.geoBoundingBox(3,5.3,10,20)
30+
// Not Confusing :)
31+
+ Meili.geoBoundingBox((lat: 3, lng: 5.3), (lat: 10, lng: 20))
32+
```
33+
```diff
34+
// Confusing, unclear
35+
- Meili.geoRadius(3, 5.3, 100)
36+
// Not Confusing :)
37+
+ Meili.geoRadius((lat: 3, lng: 5.3), 100)
38+
```
39+
40+
- Change `MultiSearchQuery.queries` to be a `List<IndexSearchQuery>` instead of a `List<SearchQuery>`:
41+
```diff
42+
final result = await client.multiSearch(MultiSearchQuery(queries: [
43+
- SearchQuery(
44+
+ IndexSearchQuery(
45+
query: "",
46+
indexUid: index1.uid,
47+
),
48+
- SearchQuery(
49+
+ IndexSearchQuery(
50+
query: "",
51+
indexUid: index2.uid,
52+
),
53+
];
54+
```
55+
56+
### Changes:
57+
58+
- Introduce a new annotation `RequiredMeiliServerVersion` which documents the version this members were introduced.
59+
- Introduce filter expressions for `IS NULL`, `IS NOT NULL`, `IS EMPTY`, `IS NOT EMPTY`.
60+
- Added `filter`, `filterExpression` parameter to `DocumentsQuery`.
61+
- Some internal `Queryable` refactoring to unify its behavior and avoid duplicating the code.
62+
- Added a workaround for https://github.com/meilisearch/meilisearch/issues/3740 by `jsonEncoding` attribute names when using `filterExpression`s
63+
- A new type is introduced `IndexSearchQuery` which extends `SearchQuery`.
64+
- Added `copyWith` to `SearchQuery` and `IndexSearchQuery`
65+
66+
367
# 0.13.0
468

569
### Breaking Changes
@@ -16,7 +80,7 @@
1680
```diff
1781
- final Object? facetDistribution;
1882
+ final Map<String, Map<String, int>>? facetDistribution;
19-
- final Object? matchesPosition;
83+
- final Object? matchesPosition;
2084
+ final Map<String, List<MatchPosition>>? matchesPosition;
2185
+ final Map<String, FacetStat>? facetStats;
2286
```
@@ -37,15 +101,15 @@
37101
- Changes `Searcheable`, `SearchResult`, `PaginatedSearchResult` signatures to be generic `Searcheable<T>`, `SearchResult<T>`, `PaginatedSearchResult<T>`
38102
- Adds a new `map<TOther>` method to `Searcheable<T>` and its subclasses to map the search result to a different type.
39103
- All search operations produce `Searcheable<Map<String, dynamic>>` by default, which can be mapped to other types using the `map<TOther>` method.
40-
- Revert some of the `Object?` types that were changed from `dynamic`:
104+
- Revert some of the `Object?` types that were changed from `dynamic`:
41105
- `MeiliSearchClient` class `Future<Map<String, dynamic>> health();`
42106
- `HttpRequest` class `Map<String, dynamic> headers();`
43107
- `MeiliSearchIndex` class `Future<Searcheable<Map<String, dynamic>>> search(...);`
44108
- `MeiliSearchIndex` class`Future<Map<String, dynamic>?> getDocument(Object id, {List<String> fields});`
45109
- `MeiliSearchIndex` class `Future<Result<Map<String, dynamic>>> getDocuments({DocumentsQuery? params});`
46110
- `Searcheable<T>.hits` is non-nullable now, and defaults to `const []`
47111

48-
### Changes:
112+
### Changes:
49113

50114
- Introduced new extension methods to help consumers cast `Future<Searchable<T>>` to the corresponding type:
51115
```dart

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ You can install the **meilisearch** package by adding a few lines into `pubspec.
4848

4949
```yaml
5050
dependencies:
51-
meilisearch: ^0.13.0
51+
meilisearch: ^0.14.0
5252
```
5353
5454
Then open your terminal and update dart packages.

lib/src/version.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
class Version {
2-
static const String current = '0.13.0';
2+
static const String current = '0.14.0';
33

44
static String get qualifiedVersion {
55
return "Meilisearch Dart (v$current)";

pubspec.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: meilisearch
22
description: Meilisearch Dart is the Meilisearch API client for Dart and Flutter developers.
3-
version: 0.13.0
3+
version: 0.14.0
44
homepage: https://meilisearch.com
55
repository: https://github.com/meilisearch/meilisearch-dart
66
issue_tracker: https://github.com/meilisearch/meilisearch-dart/issues

0 commit comments

Comments
 (0)