Skip to content

Commit

Permalink
Update readme and code samples
Browse files Browse the repository at this point in the history
  • Loading branch information
bidoubiwa committed Jul 29, 2021
1 parent 5ece604 commit 0a664f1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .code-samples.meilisearch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ delete_documents_1: |-
search_post_1: |-
client.index('movies').search('American ninja')
search_get_1: |-
client.index('movies').search('American ninja', {}, 'GET')
client.index('movies').search('American ninja')
get_update_1: |-
client.index('movies').getUpdateStatus(1)
get_all_updates_1: |-
Expand Down
13 changes: 8 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,7 @@ All the supported options are described in the [search parameters](https://docs.
```javascript
await index.search(
'wonder',
{
attributesToHighlight: ['*'],
['*'],
filter: 'id >= 1'
}
)
Expand Down Expand Up @@ -225,7 +224,7 @@ Placeholder search makes it possible to receive hits based on your parameters wi
await index.search(
'',
{
filter: ['genres = fantasy'],
['genres = fantasy'],
facetsDistribution: ['genres']
}
)
Expand Down Expand Up @@ -267,7 +266,7 @@ You can abort a pending search request by providing an [AbortSignal](https://dev
const controller = new AbortController()

index
.search('wonder', {}, 'POST', {
.search('wonder', {}, {
signal: controller.signal,
})
.then((response) => {
Expand Down Expand Up @@ -307,7 +306,11 @@ If you want to know more about the development workflow or want to contribute, p

- Make a search request:

`client.index<T>('xxx').search(query: string, options: SearchParams = {}, method: 'POST' | 'GET' = 'POST', config?: Partial<Request>): Promise<SearchResponse<T>>`
`client.index<T>('xxx').search(query: string, options: SearchParams = {}, config?: Partial<Request>): Promise<SearchResponse<T>>`

- Make a search request using GET method (slower than the search method):

`client.index<T>('xxx').searchGet(query: string, options: SearchParams = {}, config?: Partial<Request>): Promise<SearchResponse<T>>`

### Indexes <!-- omit in toc -->

Expand Down

0 comments on commit 0a664f1

Please sign in to comment.