Skip to content

Commit

Permalink
Merge #380
Browse files Browse the repository at this point in the history
380: docs: Add readme section about dio r=curquiza a=ahmednfwela

# Pull Request

## Related issue
Fixes #270 
Fixes #356

## What does this PR do?
- Updates readme to include customizing dio

## PR checklist
Please check if your PR fulfills the following requirements:
- [ ] Does this PR fix an existing issue, or have you listed the changes applied in the PR description (and why they are needed)?
- [ ] Have you read the contributing guidelines?
- [ ] Have you made sure that the title is accurate and descriptive of the changes?

Thank you so much for contributing to Meilisearch!


Co-authored-by: Ahmed Fwela <[email protected]>
  • Loading branch information
meili-bors[bot] and ahmednfwela authored Feb 19, 2024
2 parents 15948f6 + 1684d25 commit b8ef30d
Showing 1 changed file with 23 additions and 1 deletion.
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

0 comments on commit b8ef30d

Please sign in to comment.