Skip to content

Commit 34e2d4d

Browse files
committed
Improve the custom example
1 parent 2e2cbda commit 34e2d4d

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

README.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,15 +103,25 @@ Output:
103103
All the supported options are described in [this documentation section](https://docs.meilisearch.com/guides/advanced_guides/search_parameters.html).
104104

105105
```python
106-
index.search('prince', { 'limit': 1 })
106+
index.search(
107+
'prince',
108+
{
109+
'limit': 1,
110+
'attributesToHighlight': ['title']
111+
}
112+
)
107113
```
108114

109115
```json
110116
{
111117
"hits": [
112118
{
113119
"book_id": 456,
114-
"title": "Le Petit Prince"
120+
"title": "Le Petit Prince",
121+
"_formatted": {
122+
"book_id": 456,
123+
"title": "Le Petit <em>Prince</em>",
124+
}
115125
}
116126
],
117127
"offset": 0,

0 commit comments

Comments
 (0)