Skip to content

Commit 7b92cef

Browse files
curquizaeskombro
andauthored
Add custom search section in Getting Started (#160)
* Add custom search section in Getting Started * Improve the custom example * Update README.md Co-authored-by: Samuel Jimenez <[email protected]> Co-authored-by: Samuel Jimenez <[email protected]>
1 parent a9b9bd8 commit 7b92cef

File tree

1 file changed

+34
-1
lines changed

1 file changed

+34
-1
lines changed

README.md

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ index.add_documents(documents) # => { "updateId": 0 }
7777

7878
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).
7979

80-
#### Search in index <!-- omit in toc -->
80+
#### Basic Search <!-- omit in toc -->
8181

8282
``` python
8383
# MeiliSearch is typo-tolerant:
@@ -98,6 +98,39 @@ Output:
9898
}
9999
```
100100

101+
#### Custom Search <!-- omit in toc -->
102+
103+
All the supported options are described in [the search parameters documentation section](https://docs.meilisearch.com/guides/advanced_guides/search_parameters.html).
104+
105+
```python
106+
index.search(
107+
'prince',
108+
{
109+
'limit': 1,
110+
'attributesToHighlight': ['title']
111+
}
112+
)
113+
```
114+
115+
```json
116+
{
117+
"hits": [
118+
{
119+
"book_id": 456,
120+
"title": "Le Petit Prince",
121+
"_formatted": {
122+
"book_id": 456,
123+
"title": "Le Petit <em>Prince</em>"
124+
}
125+
}
126+
],
127+
"offset": 0,
128+
"limit": 1,
129+
"processingTimeMs": 10,
130+
"query": "prince"
131+
}
132+
```
133+
101134
## 🤖 Compatibility with MeiliSearch
102135

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

0 commit comments

Comments
 (0)