Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: Add readme section about dio #380

Merged
merged 3 commits into from
Feb 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 23 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,15 @@

**Meilisearch** is an open-source search engine. [Learn more about Meilisearch.](https://github.com/meilisearch/meilisearch)

## Table of Contents <!-- omit in TOC -->
## Table of Contents <!-- omit from toc -->

- [📖 Documentation](#-documentation)
- [⚡ Supercharge your Meilisearch experience](#-supercharge-your-meilisearch-experience)
- [🔧 Installation](#-installation)
- [🚀 Getting started](#-getting-started)
- [Advanced Configuration](#advanced-configuration)
- [Customizing the dio instance](#customizing-the-dio-instance)
- [Using MeiliDocumentContainer](#using-meilidocumentcontainer)
- [🤖 Compatibility with Meilisearch](#-compatibility-with-meilisearch)
- [💡 Learn more](#-learn-more)
- [⚙️ Contributing](#️-contributing)
Expand Down Expand Up @@ -198,6 +201,25 @@ await index.search('wonder', filter: ['id > 1 AND genres = Action']);
}
```

## Advanced Configuration

### Customizing the dio instance

Meilisearch 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.

### Using MeiliDocumentContainer

The `MeiliDocumentContainer<T>` class contains meilisearch-specific fields (e.g. `rankingScoreDetails`, `_formatted`, `matchesPosition`, etc...).

We define the `mapToContainer()` extension to help you quickly opt-in to this class, example:

```dart
final res = await index
.search("hello world")
.asSearchResult() //or .asPaginatedResult() if using page parameters
.mapToContainer();
```

## 🤖 Compatibility with Meilisearch

This 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.
Expand Down
Loading