Skip to content

Add custom search section in Getting Started #160

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

Merged
merged 3 commits into from
Oct 20, 2020
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
35 changes: 34 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ index.add_documents(documents) # => { "updateId": 0 }

With the `updateId`, you can check the status (`processed` or `failed`) of your documents addition thanks to this [method](https://docs.meilisearch.com/references/updates.html#get-an-update-status).

#### Search in index <!-- omit in toc -->
#### Basic Search <!-- omit in toc -->

``` python
# MeiliSearch is typo-tolerant:
Expand All @@ -98,6 +98,39 @@ Output:
}
```

#### Custom Search <!-- omit in toc -->

All the supported options are described in [the search parameters documentation section](https://docs.meilisearch.com/guides/advanced_guides/search_parameters.html).

```python
index.search(
'prince',
{
'limit': 1,
'attributesToHighlight': ['title']
}
)
```

```json
{
"hits": [
{
"book_id": 456,
"title": "Le Petit Prince",
"_formatted": {
"book_id": 456,
"title": "Le Petit <em>Prince</em>"
}
}
],
"offset": 0,
"limit": 1,
"processingTimeMs": 10,
"query": "prince"
}
```

## 🤖 Compatibility with MeiliSearch

This package only guarantees the compatibility with the [version v0.15.0 of MeiliSearch](https://github.com/meilisearch/MeiliSearch/releases/tag/v0.15.0).
Expand Down