{"id":13721408,"url":"https://github.com/meilisearch/meilisearch-dart","last_synced_at":"2025-05-07T13:32:38.940Z","repository":{"id":36951711,"uuid":"319059109","full_name":"meilisearch/meilisearch-dart","owner":"meilisearch","description":"The Meilisearch API client written for Dart","archived":false,"fork":false,"pushed_at":"2025-04-30T07:47:59.000Z","size":1019,"stargazers_count":85,"open_issues_count":30,"forks_count":30,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-05-04T04:09:36.876Z","etag":null,"topics":["client","dart","flutter","meilisearch","meilisearch-dart","sdk"],"latest_commit_sha":null,"homepage":"https://meilisearch.com","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/meilisearch.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-12-06T14:58:42.000Z","updated_at":"2025-04-30T07:30:40.000Z","dependencies_parsed_at":"2023-09-12T22:34:53.458Z","dependency_job_id":"56a5bdae-3084-4790-9d9e-f00cf6111b80","html_url":"https://github.com/meilisearch/meilisearch-dart","commit_stats":null,"previous_names":["curquiza/meilisearch-dart"],"tags_count":31,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meilisearch%2Fmeilisearch-dart","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meilisearch%2Fmeilisearch-dart/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meilisearch%2Fmeilisearch-dart/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meilisearch%2Fmeilisearch-dart/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/meilisearch","download_url":"https://codeload.github.com/meilisearch/meilisearch-dart/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252886833,"owners_count":21819788,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["client","dart","flutter","meilisearch","meilisearch-dart","sdk"],"created_at":"2024-08-03T01:01:16.691Z","updated_at":"2025-05-07T13:32:38.934Z","avatar_url":"https://github.com/meilisearch.png","language":"Dart","funding_links":[],"categories":["Integrations"],"sub_categories":["Official Integrations"],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://raw.githubusercontent.com/meilisearch/integration-guides/main/assets/logos/meilisearch_dart.svg\" alt=\"Meilisearch\" width=\"200\" height=\"200\" /\u003e\n\u003c/p\u003e\n\n\u003ch1 align=\"center\"\u003eMeilisearch Dart\u003c/h1\u003e\n\n\u003ch4 align=\"center\"\u003e\n  \u003ca href=\"https://github.com/meilisearch/meilisearch\"\u003eMeilisearch\u003c/a\u003e |\n\u003ca href=\"https://www.meilisearch.com/cloud?utm_campaign=oss\u0026utm_source=github\u0026utm_medium=meilisearch-dart\"\u003eMeilisearch Cloud\u003c/a\u003e |\n  \u003ca href=\"https://www.meilisearch.com/docs\"\u003eDocumentation\u003c/a\u003e |\n  \u003ca href=\"https://discord.meilisearch.com\"\u003eDiscord\u003c/a\u003e |\n  \u003ca href=\"https://roadmap.meilisearch.com/tabs/1-under-consideration\"\u003eRoadmap\u003c/a\u003e |\n  \u003ca href=\"https://www.meilisearch.com\"\u003eWebsite\u003c/a\u003e |\n  \u003ca href=\"https://www.meilisearch.com/docs/faq\"\u003eFAQ\u003c/a\u003e\n\u003c/h4\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://pub.dev/packages/meilisearch\"\u003e\u003cimg src=\"https://img.shields.io/pub/v/meilisearch\" alt=\"Pub Version\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/meilisearch/meilisearch-dart/actions\"\u003e\u003cimg src=\"https://github.com/meilisearch/meilisearch-dart/workflows/Tests/badge.svg\" alt=\"GitHub Workflow Status\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/meilisearch/meilisearch-dart/blob/main/LICENSE\"\u003e\u003cimg src=\"https://img.shields.io/badge/license-MIT-informational\" alt=\"License\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://ms-bors.herokuapp.com/repositories/66\"\u003e\u003cimg src=\"https://bors.tech/images/badge_small.svg\" alt=\"Bors enabled\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://codecov.io/gh/meilisearch/meilisearch-dart\"\u003e\u003cimg src=\"https://codecov.io/gh/meilisearch/meilisearch-dart/branch/main/graph/badge.svg\" alt=\"Code Coverage\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e⚡ The Meilisearch API client written in Dart\u003c/p\u003e\n\n**Meilisearch Dart** is the Meilisearch API client for Dart and Flutter developers.\n\n**Meilisearch** is an open-source search engine. [Learn more about Meilisearch.](https://github.com/meilisearch/meilisearch)\n\n## Table of Contents \u003c!-- omit from toc --\u003e\n\n- [📖 Documentation](#-documentation)\n- [⚡ Supercharge your Meilisearch experience](#-supercharge-your-meilisearch-experience)\n- [🔧 Installation](#-installation)\n- [🚀 Getting started](#-getting-started)\n- [Advanced Configuration](#advanced-configuration)\n  - [Customizing the dio instance](#customizing-the-dio-instance)\n  - [Using MeiliDocumentContainer](#using-meilidocumentcontainer)\n- [🤖 Compatibility with Meilisearch](#-compatibility-with-meilisearch)\n- [💡 Learn more](#-learn-more)\n- [⚙️ Contributing](#️-contributing)\n\n## 📖 Documentation\n\nThis readme contains all the documentation you need to start using this Meilisearch SDK.\n\nFor general information on how to use Meilisearch—such as our API reference, tutorials, guides, and in-depth articles—refer to our [main documentation website](https://www.meilisearch.com/docs/).\n\n\n## 🔧 Installation\n\nYou can install the **meilisearch** package by adding a few lines into `pubspec.yaml` file.\n\n```yaml\ndependencies:\n  meilisearch: ^0.17.0\n```\n\nThen open your terminal and update dart packages.\n\n```bash\npub get\n```\n\n### Run Meilisearch \u003c!-- omit in toc --\u003e\n\n⚡️ **Launch, scale, and streamline in minutes with Meilisearch Cloud**—no maintenance, no commitment, cancel anytime. [Try it free now](https://cloud.meilisearch.com/login?utm_campaign=oss\u0026utm_source=github\u0026utm_medium=meilisearch-dart).\n\n🪨  Prefer to self-host? [Download and deploy](https://www.meilisearch.com/docs/learn/self_hosted/getting_started_with_self_hosted_meilisearch?utm_campaign=oss\u0026utm_source=github\u0026utm_medium=meilisearch-dart) our fast, open-source search engine on your own infrastructure.\n\n## 🚀 Getting started\n\n#### Add Documents \u003c!-- omit in toc --\u003e\n\n```dart\nimport 'package:meilisearch/meilisearch.dart';\n\nvoid main() async {\n  var client = MeiliSearchClient('http://127.0.0.1:7700', 'masterKey');\n\n  // An index is where the documents are stored.\n  var index = client.index('movies');\n\n  const documents = [\n    { 'id': 1, 'title': 'Carol', 'genres': ['Romance', 'Drama'] },\n    { 'id': 2, 'title': 'Wonder Woman', 'genres': ['Action', 'Adventure'] },\n    { 'id': 3, 'title': 'Life of Pi', 'genres': ['Adventure', 'Drama'] },\n    { 'id': 4, 'title': 'Mad Max: Fury Road', 'genres': ['Adventure', 'Science Fiction'] },\n    { 'id': 5, 'title': 'Moana', 'genres': ['Fantasy', 'Action']},\n    { 'id': 6, 'title': 'Philadelphia', 'genres': ['Drama'] },\n  ]\n\n  // If the index 'movies' does not exist, Meilisearch creates it when you first add the documents.\n  var task = await index.addDocuments(documents); // =\u003e { \"uid\": 0 }\n}\n```\n\nWith the `uid`, you can check the status (`enqueued`, `canceled`, `processing`, `succeeded` or `failed`) of your documents addition using the [task](https://www.meilisearch.com/docs/learn/advanced/asynchronous_operations#task-status).\n\n#### Basic Search \u003c!-- omit in toc --\u003e\n\n```dart\n// Meilisearch is typo-tolerant:\nvar result = await index.search('carlo');\n\nprint(result.hits);\n```\n\nJSON Output:\n\n```json\n[\n  {\n    \"id\": 1,\n    \"title\": \"Carol\",\n    \"genres\": [\"Romance\", \"Drama\"]\n  }\n]\n```\n\n#### Custom Search \u003c!-- omit in toc --\u003e\n\nAll the supported options are described in the [search parameters](https://www.meilisearch.com/docs/reference/api/search#search-parameters) section of the documentation.\n\n```dart\nvar result = await index.search(\n  'carol',\n  attributesToHighlight: ['title'],\n);\n```\n\nJSON output:\n\n```json\n{\n    \"hits\": [\n        {\n            \"id\": 1,\n            \"title\": \"Carol\",\n            \"_formatted\": {\n                \"id\": 1,\n                \"title\": \"\u003cem\u003eCarol\u003c/em\u003e\"\n            }\n        }\n    ],\n    \"offset\": 0,\n    \"limit\": 20,\n    \"processingTimeMs\": 0,\n    \"query\": \"carol\"\n}\n```\n\n#### Custom Search With Filters \u003c!-- omit in toc --\u003e\n\nIf you want to enable filtering, you must add your attributes to the `filterableAttributes` index setting.\n\n```dart\nawait index.updateFilterableAttributes(['id', 'genres']);\n```\n\nYou only need to perform this operation once.\n\nNote that MeiliSearch will rebuild your index whenever you update `filterableAttributes`.\nDepending on the size of your dataset, this might take time. You can track the process using the [task status](https://www.meilisearch.com/docs/learn/advanced/asynchronous_operations#task-status).\n\nThen, you can perform the search:\n\n```dart\nawait index.search('wonder', filter: ['id \u003e 1 AND genres = Action']);\n```\n\n```json\n{\n  \"hits\": [\n    {\n      \"id\": 2,\n      \"title\": \"Wonder Woman\",\n      \"genres\": [\"Action\",\"Adventure\"]\n    }\n  ],\n  \"offset\": 0,\n  \"limit\": 20,\n  \"estimatedTotalHits\": 1,\n  \"processingTimeMs\": 0,\n  \"query\": \"wonder\"\n}\n```\n\n## Advanced Configuration\n\n### Customizing the dio instance\n\nMeilisearch uses [dio](https://pub.dev/packages/dio) internally to send requests, you can provide it with your own interceptors or adapter using the `MeiliSearchClient.withCustomDio` constructor.\n\n### Using MeiliDocumentContainer\n\nThe `MeiliDocumentContainer\u003cT\u003e` class contains meilisearch-specific fields (e.g. `rankingScoreDetails`, `_formatted`, `matchesPosition`, etc...).\n\nWe define the `mapToContainer()` extension to help you quickly opt-in to this class, example:\n\n```dart\nfinal res = await index \n      .search(\"hello world\") \n      .asSearchResult() //or .asPaginatedResult() if using page parameters\n      .mapToContainer(); \n```\n\n## 🤖 Compatibility with Meilisearch\n\nThis package guarantees compatibility with [version v1.x of Meilisearch](https://github.com/meilisearch/meilisearch/releases/tag/latest), but some features may not be present. Please check the [issues](https://github.com/meilisearch/meilisearch-dart/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22+label%3Aenhancement) for more info.\n\n## 💡 Learn more\n\nThe following sections in our main documentation website may interest you:\n\n- **Manipulate documents**: see the [API references](https://www.meilisearch.com/docs/reference/api/documents) or read more about [documents](https://www.meilisearch.com/docs/learn/core_concepts/documents).\n- **Search**: see the [API references](https://www.meilisearch.com/docs/reference/api/search) or follow our guide on [search parameters](https://www.meilisearch.com/docs/reference/api/search#search-parameters).\n- **Manage the indexes**: see the [API references](https://www.meilisearch.com/docs/reference/api/indexes) or read more about [indexes](https://www.meilisearch.com/docs/learn/core_concepts/indexes).\n- **Configure the index settings**: see the [API references](https://www.meilisearch.com/docs/reference/api/settings) or follow our guide on [settings parameters](https://www.meilisearch.com/docs/learn/configuration/settings).\n\n## ⚙️ Contributing\n\nAny new contribution is more than welcome in this project!\n\nIf you want to know more about the development workflow or want to contribute, please visit our [contributing guidelines](./CONTRIBUTING.md) for detailed instructions!\n\n\u003chr\u003e\n\n**Meilisearch** provides and maintains many **SDKs and Integration tools** like this one. We want to provide everyone with an **amazing search experience for any kind of project**. If you want to contribute, make suggestions, or just know what's going on right now, visit us in the [integration-guides](https://github.com/meilisearch/integration-guides) repository.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmeilisearch%2Fmeilisearch-dart","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmeilisearch%2Fmeilisearch-dart","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmeilisearch%2Fmeilisearch-dart/lists"}