meilisearch / meilisearch-dart Goto Github PK
View Code? Open in Web Editor NEWThe Meilisearch API client written for Dart
Home Page: https://meilisearch.com
License: MIT License
The Meilisearch API client written for Dart
Home Page: https://meilisearch.com
License: MIT License
Maybe I'm wrong, but the analytics are not sent correctly. That's my bad @brunoocasali, I should have better reviewed your PR! Sorry I don't know how I managed to miss that! 🙈
Here:
We should send the name of the integration + the number of the version, otherwise we cannot extract correctly the analytics if we do this in every SDK.
According to spec, it should be User-agent: Meilisearch Dart (<integration dart version>)
Also, if you are a maintainer, please add any clarification and instructions about this issue.
Sorry if this is already wholly/partially implemented. Feel free to let me know about the state of this issue in the repo.
Related to meilisearch/integration-guides#213
matchingStrategy
yet. To close this issue #207 should be done first.
Add the new code samples into the file .code-samples.meilisearch.yml
:
TODO:
search_parameter_guide_matching_strategy_1
big fat liar
with "matchingStrategy": "last"
in a movies
index.search_parameter_guide_matching_strategy_2
big fat liar
with "matchingStrategy": "all"
in a movies
index.For example, in Javascript, the code-samples required to fix the issue are:
client.index('movies').search('big fat liar', { matchingStrategy: 'last' })
and also
client.index('movies').search('big fat liar', { matchingStrategy: 'all' })
so the final version inside of the samples should be:
search_parameter_guide_matching_strategy_1: |-
client.index('movies').search('big fat liar', { matchingStrategy: 'last' })
search_parameter_guide_matching_strategy_2: |-
client.index('movies').search('big fat liar', { matchingStrategy: 'all' })
Also, if you are a maintainer, please add any clarification and instructions about this issue.
Related to:
Add a pagination
index settings resource to manage customization of the maximum number of reachable documents during the search at the index level.
pagination
object on /indexes/:index_uid/settings
endpoints.GET/PATCH/DELETE
- /indexes/:index_uid/settings/pagination
endpoints.The pagination
object definition is made of the following properties:
maxTotalHits
type (int
)More information about what each field does could be checked in the spec.
Check the other customization methods for reference like: synonyms
, searchableAttributes
, filterableAttributes
.
TODO:
pagination
/indexes/:index_uid/settings/pagination
/indexes/:index_uid/settings/pagination
/indexes/:index_uid/settings/pagination
To keep the getting started simple to try, but to also make documentation examples compatible with the getting started, we are replacing book
examples with movies
examples.
The Movie dataset is used throughout the documentation. The only place where book is used is in the tests (which can stay as it is) and in our getting started.
const index = client.index('movies')
Provided dataset should be changed with the following:
const documents = [
{ id: 1, title: 'Carol', genres: ['Romance', 'Drama'] },
{ id: 2, title: 'Wonder Woman', genres: ['Action', 'Adventure'] },
{ id: 3, title: 'Life of Pi', genres: ['Adventure', 'Drama'] },
{ id: 4, title: 'Mad Max: Fury Road', genres: ['Adventure', 'Science Fiction'] },
{ id: 5, title: 'Moana', genres: ['Fantasy', 'Action']},
{ id: 6, title: 'Philadelphia', genres: ['Drama'] },
]
// If the index 'movies' does not exist, MeiliSearch creates it when you first add the documents.
can you add indexUid property to Task class?. I try to use post man and get Task it return Task and have a property indexUid I want use it but in meilisearch-dart not included the property.
Also, if you are a maintainer, feel free to add any clarification and instruction about this issue.
Sorry if this is already partially/completely implemented, feel free to let me know about the state of this issue in the repo.
Related to meilisearch/integration-guides#120
This SDK provides a method to get an index (getIndex
) and this method returns an instance of Index
. Some users want to get the raw version of the index, I mean the exact JSON response returned by the MeiliSearch server, not an instance.
Some SDKs already provide a way to get this raw index information but this is not convenient, example in PHP:
$client->index('movies')->fetchRawInfo();
We need to add the getRawIndex
method, accessible from the Client
instance, to make it more convient.
Prototype:
getRawIndex(string indexUID) -> object/struct/dict of the MeiliSearch response
Ex in PHP:
$client->getRawIndex('movies');
TODO:
getRawIndex()
method to the Client
instance without duplicating the code (if fetchRawInfo()
already exists for example)Discussion and motivations here: meilisearch/integration-guides#145
Two examples to run MeiliSearch are present in our repository documentations:
Installation section
.Development Workflow
section.TODO: change both examples in README.md and CONTRIBUTING.md the same way as we have already done it in this PR meilisearch/meilisearch-python#348
Also, if you are a maintainer, feel free to add any clarification and instruction about this issue.
Sorry if this is already wholly/partially implemented. Feel free to let me know about the state of this issue in the repo.
Related to meilisearch/integration-guides#185
Check the integration-guides issue for more information and the complete description about what should be done here (each TODO item has its report in the #185).
TODO:
description
into overview
and genre
into genres
settings_guide_sortable_1
code sampleslanding_getting_started_1
code samplesindex.getKeys()
method based on this route: https://docs.meilisearch.com/reference/api/keys.htmlWe are really open to contributions! Feel free to ask any questions if anything is not clear 🙂
Description
import of dart:mirrors is not supported in the current Dart runtime
Expected behavior
should work without any issues.
Current behavior
after import meilisearch in data module.
Screenshots or Logs
E/flutter ( 6594): [ERROR:flutter/shell/common/shell.cc(93)] Dart Error: error: import of dart:mirrors is not supported in the current Dart runtime
E/flutter ( 6594): [ERROR:flutter/runtime/dart_isolate.cc(143)] Could not prepare isolate.
E/flutter ( 6594): [ERROR:flutter/runtime/runtime_controller.cc(385)] Could not create root isolate.
Restarted application in 2,146ms.
Environment (please complete the following information):
index.getVersion()
method based on this route: https://docs.meilisearch.com/reference/api/version.htmlWe are really open to contributions! Feel free to ask any questions if anything is not clear 🙂
index.getAllUpdateStatus()
and index.getUpdateStatus()
methods based on these routes: https://docs.meilisearch.com/reference/api/updates.htmlWe are really open to contributions! Feel free to ask any questions if anything is not clear 🙂
index.getStats()
and client.get_stats()
methods based on these routes: https://docs.meilisearch.com/reference/api/stats.htmlWe are really open to contributions! Feel free to ask any questions if anything is not clear 🙂
Description
The method getDocuments(limit: x)
doesn't work with meilisearch 0.27.1
However search("", limit: x)
as workaround works fine
Expected behavior
Get documents without invalid_api_key error
Current behavior
MeiliSearchApiError - message: The provided API key is invalid. - code: invalid_api_key - type: auth - link: https://docs.meilisearch.com/errors#invalid_api_key
Environment (please complete the following information):
add_documents_json
instead of addDocumentsJson
). Keep the already existing way of naming in this package to stay idiomatic with the language and this repository.
📣 We strongly recommend doing multiple PRs to solve all the points of this issue
MeiliSearch v0.23.0 introduces two changes:
Content-type
header for every route requiring a payload (POST
and PUT
routes)Here are the expected changes to completely close the issue:
Currently, the SDKs always send Content-Type: application/json
to every request. Only the POST
and PUT
requests should send the Content-Type: application/json
and not the DELETE
and GET
ones.
Add the following methods and 🔥 the associated tests 🔥 to ADD the documents. Depending on the format type (csv
or ndjson
) the SDK should send Content-Type: application/x-dnjson
or Content-Type: text/csv
)
addDocumentsJson(string docs, string primaryKey)
addDocumentsCsv(string docs, string primaryKey)
addDocumentsCsvInBatches(string docs, int batchSize, string primaryKey)
addDocumentsNdjson(string docs, string primaryKey)
addDocumentsNdjsonInBatches(string docs, int batchSize, string primaryKey)
Add the following methods and 🔥 the associated tests 🔥 to UPDATE the documents. Depending on the format type (csv
or ndjson
) the SDK should send Content-Type: application/x-dnjson
or Content-Type: text/csv
)
updateDocumentsJson(string docs, string primaryKey)
updateDocumentsCsv(string docs, string primaryKey)
updateDocumentsCsvInBatches(string docs, int batchSize, string primaryKey)
updateDocumentsNdjson(string docs, string primaryKey)
updateDocumentsNdjsonInBatches(string docs, int batchSize, string primaryKey)
docs
are the documents sent as String
primaryKey
is the primary key of the index
batchSize
is the size of the batch. Example: you can send 2000 documents in raw String in docs
and ask for a batchSize
of 1000, so your documents will be sent to MeiliSearch in two batches.
Example of PRs:
Related to: meilisearch/integration-guides#146
If this issue is partially/completely implemented, feel free to let us know.
Also, if you are a maintainer, please add any clarification and instructions about this issue.
Related to:
Add a faceting
index settings resource to manage customization of the maximum value per facet.
faceting
object on /indexes/:index_uid/settings
endpoints.GET/PATCH/DELETE
- /indexes/:index_uid/settings/faceting
endpoints.The faceting
object definition is made of the following properties:
maxValuesPerFacet
type (int
)More information about what each field does could be checked in the spec.
Check the other customization methods for reference like: synonyms
, searchableAttributes
, filterableAttributes
.
TODO:
faceting
/indexes/:index_uid/settings/faceting
/indexes/:index_uid/settings/faceting
/indexes/:index_uid/settings/faceting
Also, if you are a maintainer, feel free to add any clarification and instruction about this issue.
Related to:
Add a typoTolerance
index settings resource to manage customization of the typo tolerance feature at the index level.
typoTolerance
object on /indexes/:index_uid/settings
endpoints.GET/POST/DELETE
- /indexes/:index_uid/settings/typo-tolerance
endpoints.The typoTolerance
object definition is made of the following properties:
enabled
type (boolean
)disableOnAttributes
type (array[string]
)disableOnWords
type (array[string]
)minWordSizeForTypos
type (object
)
oneTypo
type (int
)twoTypos
type (int
)More information about what each field does could be checked in the spec.
Check the other customization methods for reference like: synonyms
, searchableAttributes
, filterableAttributes
.
TODO:
typo-tolerance
/indexes/:index_uid/settings/typo-tolerance
/indexes/:index_uid/settings/typo-tolerance
/indexes/:index_uid/settings/typo-tolerance
I was looking at adding some of the methods listed in the issues, and after cloning I ran the test suite to make sure everything was good before making any changes. In doing this I am getting either test failures or the test suite freezes and never finishes.
One weird thing is when it fails I get different results. For example one time I got +16 -23: Some tests failed.
and another time I got +18 -21: Some tests failed.
. Nothing changed in the code between test runs and I stopped and restarted the MeiliSearch docker container to make sure there was nothing left from the previous run.
I have dart installed through Flutter and the output of flutter doctor -v
is
[✓] Flutter (Channel stable, 2.2.2, on macOS 11.4 20F71 darwin-x64, locale en-US)
• Flutter version 2.2.2 at /Users/paul/development/flutter
• Framework revision d79295af24 (13 days ago), 2021-06-11 08:56:01 -0700
• Engine revision 91c9fc8fe0
• Dart version 2.13.3
[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
• Android SDK at /Users/paul/Library/Android/sdk
• Platform android-30, build-tools 28.0.3
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 11.0.8+10-b944.6916264)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 12.5.1, Build version 12E507
• CocoaPods version 1.10.1
[✓] Android Studio (version 4.2)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 11.0.8+10-b944.6916264)
[✓] VS Code (version 1.57.1)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.23.0
[!] Connected device
! No devices available
This improvement motivation is about letting the user customize the behavior of Meilisearch when retrieving documents according to the query words.
matchingStrategy
parameter to search requests search and searchRaw
.last
or all
.Expected result:
await client.index('movies').search('shifu', matchingStrategy: 'last');
Good to have: Make the last
or all
constants where we could quickly use them without mistakes.
Trying to delete an index that does not exist on the MeiliSearch server will throw an error. To delete it without any error no matter what if it exists or not, we need a new method.
deleteIndexIfExists
: it deletes the index but does not throw any error if the index does not exist.Example: https://github.com/meilisearch/meilisearch-python/pull/268/files
deleteIndexIfExists
might be named differently in this package. Keep the already existing way of naming in this package to stay idiomatic with the language and the repository.
Related to meilisearch/integration-guides#107
Sorry if this is already partially/completely implemented, feel free to let me know about the state of this issue.
Description
request to indexes to search
Screenshots or Logs
Access to XMLHttpRequest at 'http://67.205.159.1xx/indexes/dm_bao_gia/search' from origin 'http://localhost:63584' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
configuration server file:
`server {
# END - Enable CORSserver {
listen 80 default_server;
listen [::]:80 default_server;
server_name _;
access_log /var/log/nginx/meilisearch.access.log;
error_log /var/log/nginx/meilisearch.error.log;
location / {
proxy_pass http://127.0.0.1:7700;
# START - Enable CORS
proxy_hide_header Access-Control-Allow-Origin;
if ($request_method = 'OPTIONS') {
add_header 'Access-Control-Max-Age' 1728000;
add_header "Access-Control-Allow-Origin" *;
add_header "Access-Control-Allow-Methods" "GET, POST, OPTIONS, PUT";
add_header "Access-Control-Allow-Headers" "Authorization, Origin, X-Requested-With, Content-Type, Accept, >
return 204;
}
if ($request_method != 'OPTIONS') {
add_header 'Access-Control-Allow-Origin' '*';
}
# END - Enable CORS
}
}
`
Environment (please complete the following information):
Description
I want to use meilisearch with pagination but the response was only searchable, that do not contain like totalPage field.
Basic example
I have to import 'package:meilisearch/src/paginated_search_result.dart';
which show warnings.
if (searchResult is PaginatedSearchResult) {
int? nextPage = (searchResult.totalPages ?? 1) > page ? page++ : null;
return nextPage;
}
Dio ^3.0.0 is causing lots of dependency issues in my project, as other packages depend on http, which Dio also depends on, and these dependency clashes cannot be resolved. Dio 4.0.0 is stable and null-safe.
I forked this package and have been using it without issue after bumping Dio to ^4.0.0. I'm having a lot of trouble getting docker set up and working on my machine, though, so I haven't been able to run tests and submit a PR.
Can you bump Dio to ^4.0.0? Thanks.
Currently, the geAllIndexes
method returns a raw list of object, but not a list of Index
instance. This is the only index-related method that does not return an Index
instance.
An instance is more convenient to manipulate than a raw object. See this example.
TODO
geAllIndexes
: make it return a list of Index
instancesgeAllRawIndexes
: a method that returns the list of object of indexes, so the response of the MeiliSearch server.Related to meilisearch/integration-guides#122
Sorry if this is already partially/completely implemented, feel free to let me know about the state of this issue.
Also, this issue is generated, and getAllIndexes
might be named differently in this package
Currently only index.getSettings()
, index.updateSettings()
and index.resetSettings
are implemented. These routes manage all the settings by calling this "general" settings route.
But currently in this SDK, no method are implemented to call the sub-routes of each settings.
We need to add the index.getXXX()
, index.updateXXX()
and index.resetXXX()
where XXX
are the following settings:
No need to do it in one big PR, any addition is welcome!
We are really open to contributions! Feel free to ask any questions if anything is not clear 🙂
how can I sort and filter documents like searching? Hope you support these features
Also, if you are a maintainer, feel free to add any clarification and instruction about this issue.
Sorry if this is already partially/completely implemented, feel free to let me know about the state of this issue in the repo.
Related to meilisearch/integration-guides#214
Replace the env var naming from the Dockerfile environment:
MEILISEARCH_HOST
to MEILISEARCH_URL
Also, look for occurrences inside of the docker-compose.yml file.
After, run the tests according to the instructions in the CONTRIBUTING.md.
Also, check for occurences in the Github Actions workflows and inside of the source code.
Future<SearchResult> search<T>()
T isn't used anywhere. I have strict linting and it complains.
When you’ve done the minimum tests, you might think it misses some deeper tests (for example, testing the search with all the possible parameters). If you are tired of doing tests -> open issues! Community might help us on this!
According to the endpoints you’ve implemented here are the tests. They are integration tests, no unit tests: the goal is to check MeiliSearch and the SDK work perfectly together so it might involve you call another method when testing one specific method.
limit
, offset
…) and open issues for the others if you prefer.You might need a waitForPendingUpdate method that make the actions of adding documents and settings asynchronous: this method waits until the update is processed or failed. There is this kind of method in the Dotnet SDK -> Index.cs:232.
client.createDump()
and client.getDumpStatus()
methods based on these routes: https://docs.meilisearch.com/reference/api/dump.htmlWe are really open to contributions! Feel free to ask any questions if anything is not clear 🙂
let me know if that was intentional.
To keep the getting started simple to try, but to also make documentation examples compatible with the getting started, we are replacing book
examples with movies
examples.
The Movie dataset is used throughout the documentation. The only place where book is used is in the tests (which can stay as it is) and in our getting started.
const index = client.index('movies')
Provided dataset should be changed with the following:
const documents = [
{ id: 1, title: 'Carol', genres: ['Romance', 'Drama'] },
{ id: 2, title: 'Wonder Woman', genres: ['Action', 'Adventure'] },
{ id: 3, title: 'Life of Pi', genres: ['Adventure', 'Drama'] },
{ id: 4, title: 'Mad Max: Fury Road', genres: ['Adventure', 'Science Fiction'] },
{ id: 5, title: 'Moana', genres: ['Fantasy', 'Action']},
{ id: 6, title: 'Philadelphia', genres: ['Drama'] },
]
// If the index 'movies' does not exist, MeiliSearch creates it when you first add the documents.
We need methods to add and update the documents of MeiliSearch in batch instead of letting the users call addDocuments
in a loop.
addDocumentsInBatches
addDocumentsInBatches(documents, batchSize = 1000, primaryKey = nil)
batchSize
and primaryKey
are optional parameters
updateDocumentsInBatches
updateDocumentsInBatches(documents, batchSize = 1000, primaryKey = nil)
batchSize
and primaryKey
are optional parameters
Example: meilisearch/meilisearch-python#260
addDocumentsInBatches
and updateDocumentsInBatches
might be named differently in this package. Keep the already existing way of naming in this package to stay idiomatic with the language and the repository.
Also, if you are a maintainer, feel free to add any clarification and instruction about this issue related to the specific languages of the repo.
Related to meilisearch/integration-guides#106
Sorry if this is already partially/completely implemented, feel free to let me know about the state of this issue in the repo.
I'll create a GitHub action for next years.
The message Using Meilisearch server on http://localhost:7700 for running tests.
makes it harder to understand the test running logs.
➜ meilisearch-dart git:(feature/tenant-token) dart test --concurrency=1
00:00 +0: test/get_keys_test.dart: Keys When has master key responds with all keys
Using Meilisearch server on http://localhost:7700 for running tests.
00:00 +1: test/get_keys_test.dart: Keys When has master key gets a key from server by key/uid
Using Meilisearch server on http://localhost:7700 for running tests.
00:00 +2: test/get_keys_test.dart: Keys When has master key creates a new key
Using Meilisearch server on http://localhost:7700 for running tests.
00:00 +3: test/get_keys_test.dart: Keys When has master key creates a new key with expiresAt
Using Meilisearch server on http://localhost:7700 for running tests.
00:00 +4: test/get_keys_test.dart: Keys When has master key updates a key partially
Using Meilisearch server on http://localhost:7700 for running tests.
00:00 +5: test/get_keys_test.dart: Keys When has master key updates key expiresAt
Using Meilisearch server on http://localhost:7700 for running tests.
00:00 +6: test/get_keys_test.dart: Keys When has master key deletes a key
Without it, we just have a compact log that just shows up the errors and all the other information is hidden (much better).
The idea is to remove this message for every test call, but print once before the whole test suite.
I know we have the setUpAll
hook, but to be feasible to use it, I think we will need to improve the whole test suite.
Let's be allies and make this change that means a lot.
Here is a blog post that explain a little more why it's important, and how to easily do it. It will be a bit more complicated with automation, but we still should do it!
As MeiliSearch grows so does its SDKs. More and more SDKs rise from the ground and they all deserve to be as well documented as the core engine itself.
The most common way for a user to understand MeiliSearch is to go to its official documentation. As of yesterday, all examples in the documentation were made with cURL
. Unfortunately, most of our users do not communicate with MeiliSearch directly with cURL
. Which forces them to search for the specific references somewhere else (in the readme's, in the SDKs code itself,..). This makes for unnecessary friction.
We want our documentation to include all SDKs
As a first step, we want all examples to be made using the most possible SDKs. As did Stripe and Algolia.
examples with curl, javascript and soon enough this SDK too!
To achieve this it is expected from this SDK to create a sample file containing all the code samples needed by the documentation.
These are the steps to follow:
The sample file is a yaml file added at the root of each MeiliSearch SDK.
Sample files are created based on the sample-template.yaml
file.
sample-template
file:
get_one_index_1: |-
list_all_indexes_1: |-
create_an_index_1: |-
...
This template is accessible publicly here or in the public directory : .vuepress/public/sample-template.yaml
of the documentation.
The name of the file should be .code-samples.meilisearch.yaml
After creating the sample file with the content of the sample template you should have a file containing all the sampleId
's.
get_one_index_1: |-
list_all_indexes_1: |-
create_an_index_1: |-
...
By the name of the different sampleId
you should know where that code sample will be added to the documentation.
For example, create_an_index_1
is the first example in the API References of the index creation.
Using the already existing cURL
example in the documentation you should see what is expected from that sample. It is very important that you look at the already existing samples in the documentation as it gives you the parameters to use in your sample to match with the rest of the documentation.
Good sample based on documentation:
create_an_index_1: |-
client.createIndex({ uid: 'movies' })
Bad sample that does not match with the response.
create_an_index_1: |-
client.createIndex({ uid: 'otherName' })
Each sample is expected to be written in the respective SDK language.
Javascript example:
get_one_index_1: |-
client.getIndex('movies').show()
list_all_indexes_1: |-
client.listIndexes()
create_an_index_1: |-
client.createIndex({ uid: 'movies' })
...
The complete cURL
sample file is available at the root of the documentation repository.
Every other SDK sample file should be available at the root of their respective repository.
There is one exception to the formatting rule.
When the sampleId
finishes with _md
it means it is expected to be written in markdown format.
JavaScript sample id with _md extension:
Once your sample file is filled with the code samples, you will need to create a pull request on the documentation repository.
Open the following file in your IDE:
.vuepress/code-samples/sdks.json
And add your sample file to the list:
[
...
{
"language": "sdk-language",
"label": "sdk-label",
"url": "url to yaml file"
}
]
The language
key expect a supported language for the code highlight.
The label
key is the name of the tab. While label
and language
could have been the same, it created some conflict (i.e: bash
and cURL
).
The url
is the raw link to access your sample file. It should look like this:
https://raw.githubusercontent.com/[PROJECT]/[REPO]/.code-samples.meilisearch.yaml
Related to meilisearch/integration-guides#155
Following the documentation issue (meilisearch/documentation#1290) and PR (meilisearch/documentation#1214) an additional code-sample must be added in the .code-samples.meilisearch.yaml file at the root of the repository.
Using the following information the code-sample must be created in the repository language.
settings_guide_sortable_1
books
/settings
POST
application/json
{
"sortableAttributes": [
"price",
"author"
]
}
In cURL
the samples is defined the following way:
curl \
-X POST 'http://localhost:7700/indexes/books/settings' \
-H 'Content-Type: application/json' \
--data-binary '{
"sortableAttributes": [
"price",
"author"
]
}'
Add dependabot configuration in the .github folder in order to make the dependencies update automatically!
Tutorial: https://github.blog/changelog/2022-04-05-pub-beta-support-for-dependabot-version-updates/
Reference: dependabot/dependabot-core#2166
Starting from Flutter 2.0 and Dart SDK 1.12.0, dart language now supports sound null safety which requires explicitly defining null values.
Add a test to check the filter
parameter can work with values containing spaces
Example:
"filter": "genre = 'sci fi'"
Related to meilisearch/integration-guides#30
Related to: meilisearch/integration-guides#136
In the README, we want to add the Custom Search With Filters
sub section in the Getting Started
section to make the users are aware of filtering.
This should
Custom Search
sub section---------- beginning of the content
If you want to enable filtering, you must add your attributes to the filterableAttributes
index setting.
--- Add an example corresponding to the current repository. See this example in JS:
await index.updateAttributesForFaceting([
'id',
'genres'
])
--- end of example
You only need to perform this operation once.
Note that MeiliSearch will rebuild your index whenever you update filterableAttributes
. Depending on the size of your dataset, this might take time. You can track the process using the update status.
Then, you can perform the search:
--- Add an example corresponding to the current repository. See this example in JS:
await index.search(
'wonder',
{
filter: ['id > 1 AND genres = Action']
}
)
--- end of example
{
"hits": [
{
"id": 2,
"title": "Wonder Woman",
"genres": ["Action","Adventure"]
}
],
"offset": 0,
"limit": 20,
"nbHits": 1,
"processingTimeMs": 0,
"query": "wonder"
}
--- end of the content
📣 Example of PR: https://github.com/meilisearch/meilisearch-js/pull/1059/files
Description
In IndexSetting
the type for distinctAttribute
is List<String>?
, however MeiliSearch expects a string instead of a list so using this causes an exception.
Expected behavior
No exception when setting the distinct attribute.
Current behavior
An exception is returned when including a distinctAttribute
in the settings: MeiliSearchApiError - message: Json deserialize error: invalid type: sequence, expected a string at line 1 column 244 - errorCode: bad_request - errorType: invalid_request_error - errorLink: https://docs.meilisearch.com/errors#bad_request
Environment (please complete the following information):
During the pre-release week (concerning only the Meili team, don't bother with the details) I need a CI running against the latest RC of MeiliSearch (and not the latest
image). This RC is
Since the CIs of this package run in a Dart container, I don't know how to specify a dynamic variable (get by a script) to define which MeiliSearch version I would like to start.
See the example in the Ruby SDK CI:
https://github.com/meilisearch/meilisearch-ruby/blob/2ce58bdda136c1b672fbbbcdefb41f49a69d85c4/.github/workflows/pre-release-tests.yml#L23-L26
The pre-release-tests.yml
file in this package would start the same:
# Testing the code base against the MeiliSearch pre-releases
name: Pre-Release Tests
# Will only run for PRs and pushes to bump-meilisearch-v*
on:
push:
branches:
- bump-meilisearch-v*
pull_request:
branches:
- bump-meilisearch-v*
jobs:
integration-tests:
timeout-minutes: 10
runs-on: ubuntu-latest
strategy:
matrix:
version: ['2.7', '2.8']
name: integration-tests-against-rc (dart ${{ matrix.version }})
...
I just currently don't know how to run the latest RC of MeiliSearch in this GitHub Action.
EDIT: Oh maybe use the linux-amd64 assets link to download, unzip and run meilisearch with it: https://github.com/meilisearch/MeiliSearch/releases/download/v0.17.0rc0/meilisearch-macos-amd64
Description
Could you add http/2 support to the plugin? I looked at your plugin source code and saw that you are using Dio. on the page of this plugin there is information about using this protocol.
Basic example
dependencies:
dio: ^4.0.0
dio_http2_adapter: ^2.0.0
import 'package:dio/dio.dart';
import 'package:dio_http2_adapter/dio_http2_adapter.dart';
var dio = Dio()
..options.baseUrl = 'https://google.com'
..interceptors.add(LogInterceptor())
..httpClientAdapter = Http2Adapter(
ConnectionManager(
idleTimeout: 10000,
// Ignore bad certificate
onClientCreate: (_, config) => config.onBadCertificate = (_) => true,
),
);
<!-- omit in toc -->
seems to be a customization in GitHub markdown because in the package's pub.dev page those comments are being rendered and shown on the page.
Description
cropLength
in MeiliSearchIndex
accepts a type of List<String>?
, but MeiliiSearch expects an integer here resulting in an exception.
Expected behavior
Crop length can be used without an exception.
Current behavior
Preforming a search with a cropLength
results in an exception: MeiliSearchApiError - message: Json deserialize error: invalid type: sequence, expected usize at line 1 column 58 - errorCode: bad_request - errorType: invalid_request_error - errorLink: https://docs.meilisearch.com/errors#bad_request
Environment (please complete the following information):
Following meilisearch/documentation#1214, we would like to apply some changes in the .code-samples.meilisearch.yaml
file at the root of the repository
get_distinct_attribute_1
, update_distinct_attribute_1
and reset_distinct_attribute_1
: if present, the index name should be shoes
update_distinct_attribute_1
: the distinct attribute passed should be skuid
and not movie_id
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.