Skip to content

Commit ba77b65

Browse files
committed
fix(docs): update API part in README.md
1 parent df6833a commit ba77b65

File tree

1 file changed

+69
-61
lines changed

1 file changed

+69
-61
lines changed

README.md

Lines changed: 69 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -251,12 +251,18 @@ await index.search(
251251
{
252252
"id": 2,
253253
"title": "Wonder Woman",
254-
"genres": ["Action","Adventure"]
254+
"genres": [
255+
"Action",
256+
"Adventure"
257+
]
255258
},
256259
{
257260
"id": 5,
258261
"title": "Moana",
259-
"genres": ["Fantasy","Action"]
262+
"genres": [
263+
"Fantasy",
264+
"Action"
265+
]
260266
}
261267
],
262268
"offset": 0,
@@ -271,6 +277,7 @@ await index.search(
271277
"Adventure": 1
272278
}
273279
}
280+
}
274281
```
275282

276283
#### Abortable Search <!-- omit in toc -->
@@ -319,251 +326,252 @@ If you want to know more about the development workflow or want to contribute, p
319326

320327
### Search <!-- omit in toc -->
321328

322-
- Make a search request:
329+
- [Make a search request:](https://docs.meilisearch.com/reference/api/search.html)
323330

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

326-
- Make a search request using GET method (slower than the search method):
333+
- [Make a search request using GET method (slower than the search method):](https://docs.meilisearch.com/reference/api/search.html#search-in-an-index-with-get-route
334+
)
327335

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

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

332-
- List all indexes:
340+
- [List all indexes:](https://docs.meilisearch.com/reference/api/indexes.html#list-all-indexes)
333341

334342
`client.listIndexes(): Promise<IndexResponse[]>`
335343

336-
- Create new index:
344+
- [Create new index:](https://docs.meilisearch.com/reference/api/indexes.html#create-an-index)
337345

338346
`client.createIndex<T>(uid: string, options?: IndexOptions): Promise<Index<T>>`
339347

340-
- Create a local reference to an index:
348+
- [Create a local reference to an index:](https://docs.meilisearch.com/reference/api/indexes.html#create-an-index)
341349

342350
`client.index<T>(uid: string): Index<T>`
343351

344-
- Get an index:
352+
- [Get an index:]()
345353

346354
`client.getIndex<T>(uid: string): Promise<Index<T>>`
347355

348-
- Get or create index if it does not exist
356+
- [Get or create index if it does not exist:]()
349357

350358
`client.getOrCreateIndex<T>(uid: string, options?: IndexOptions): Promise<Index<T>>`
351359

352-
- Get Index information:
360+
- [Get Index information:](https://docs.meilisearch.com/reference/api/indexes.html#get-one-index)
353361

354362
`index.getRawInfo(): Promise<IndexResponse>`
355363

356-
- Update Index:
364+
- [Update Index:](https://docs.meilisearch.com/reference/api/indexes.html#update-an-index)
357365

358366
`client.updateIndex(uid: string, options: IndexOptions): Promise<Index>`
359367
Or using the index object:
360368
`index.update(data: IndexOptions): Promise<Index>`
361369

362-
- Delete Index:
370+
- [Delete Index:](https://docs.meilisearch.com/reference/api/indexes.html#delete-an-index)
363371

364372
`client.deleteIndex(uid): Promise<void>`
365-
Or using the index object:
366-
`index.delete(): Promise<void>`
373+
[Or using the index object:]()
367374

375+
`index.delete(): Promise<void>`
368376

369-
- Get specific index stats
377+
- [Get specific index stats:]()
370378

371379
`index.getStats(): Promise<IndexStats>`
372380

373-
- Return Index instance with updated information:
381+
- [Return Index instance with updated information:]()
374382

375383
`index.fetchInfo(): Promise<Index>`
376384

377-
- Get Primary Key of an Index:
385+
- [Get Primary Key of an Index:]()
378386

379387
`index.fetchPrimaryKey(): Promise<string | undefined>`
380388

381389
### Updates <!-- omit in toc -->
382390

383-
- Get One update info:
391+
- [Get One update info:](https://docs.meilisearch.com/reference/api/updates.html#get-an-update-status)
384392

385393
`index.getUpdateStatus(updateId: number): Promise<Update>`
386394

387-
- Get all updates info:
395+
- [Get all updates info:](https://docs.meilisearch.com/reference/api/updates.html#get-all-update-status)
388396

389397
`index.getAllUpdateStatus(): Promise<Update[]>`
390398

391-
- Wait for pending update:
399+
- [Wait for pending update:]()
392400

393401
`index.waitForPendingUpdate(updateId: number, { timeOutMs?: number, intervalMs?: number }): Promise<Update>`
394402

395403
### Documents <!-- omit in toc -->
396404

397-
- Add or replace multiple documents:
405+
- [Add or replace multiple documents:](https://docs.meilisearch.com/reference/api/documents.html#add-or-replace-documents)
398406

399407
`index.addDocuments(documents: Document<T>[]): Promise<EnqueuedUpdate>`
400408

401-
- Add or update multiple documents:
409+
- [Add or update multiple documents:](https://docs.meilisearch.com/reference/api/documents.html#add-or-update-documents)
402410

403411
`index.updateDocuments(documents: Document<T>[]): Promise<EnqueuedUpdate>`
404412

405-
- Get Documents:
413+
- [Get Documents:](https://docs.meilisearch.com/reference/api/documents.html#get-documents)
406414

407415
`index.getDocuments(params: getDocumentsParams): Promise<Document<T>[]>`
408416

409-
- Get one document:
417+
- [Get one document:](https://docs.meilisearch.com/reference/api/documents.html#get-one-document)
410418

411419
`index.getDocument(documentId: string): Promise<Document<T>>`
412420

413-
- Delete one document:
421+
- [Delete one document:](https://docs.meilisearch.com/reference/api/documents.html#delete-one-document)
414422

415423
`index.deleteDocument(documentId: string | number): Promise<EnqueuedUpdate>`
416424

417-
- Delete multiple documents:
425+
- [Delete multiple documents:](https://docs.meilisearch.com/reference/api/documents.html#delete-documents)
418426

419427
`index.deleteDocuments(documentsIds: string[] | number[]): Promise<EnqueuedUpdate>`
420428

421-
- Delete all documents:
429+
- [Delete all documents:](https://docs.meilisearch.com/reference/api/documents.html#delete-all-documents)
422430

423431
`index.deleteAllDocuments(): Promise<Types.EnqueuedUpdate>`
424432

425433
### Settings <!-- omit in toc -->
426434

427-
- Get settings:
435+
- [Get settings:](https://docs.meilisearch.com/reference/api/settings.html#get-settings)
428436

429437
`index.getSettings(): Promise<Settings>`
430438

431-
- Update settings:
439+
- [Update settings:](https://docs.meilisearch.com/reference/api/settings.html#update-settings)
432440

433441
`index.updateSettings(settings: Settings): Promise<EnqueuedUpdate>`
434442

435-
- Reset settings:
443+
- [Reset settings:](https://docs.meilisearch.com/reference/api/settings.html#reset-settings)
436444

437445
`index.resetSettings(): Promise<EnqueuedUpdate>`
438446

439447
### Synonyms <!-- omit in toc -->
440448

441-
- Get synonyms:
449+
- [Get synonyms:](https://docs.meilisearch.com/reference/api/synonyms.html#get-synonyms)
442450

443451
`index.getSynonyms(): Promise<object>`
444452

445-
- Update synonyms:
453+
- [Update synonyms:](https://docs.meilisearch.com/reference/api/synonyms.html#update-synonyms)
446454

447455
`index.updateSynonyms(synonyms: Synonyms): Promise<EnqueuedUpdate>`
448456

449-
- Reset synonyms:
457+
- [Reset synonyms:](https://docs.meilisearch.com/reference/api/synonyms.html#reset-synonyms)
450458

451459
`index.resetSynonyms(): Promise<EnqueuedUpdate>`
452460

453461
### Stop-words <!-- omit in toc -->
454462

455-
- Get Stop Words
463+
- [Get Stop Words](https://docs.meilisearch.com/reference/api/stop_words.html#get-stop-words)
456464
`index.getStopWords(): Promise<string[]>`
457465

458-
- Update Stop Words
466+
- [Update Stop Words](https://docs.meilisearch.com/reference/api/stop_words.html#update-stop-words)
459467
`index.updateStopWords(stopWords: string[] | null ): Promise<EnqueuedUpdate>`
460468

461-
- Reset Stop Words
469+
- [Reset Stop Words](https://docs.meilisearch.com/reference/api/stop_words.html#reset-stop-words)
462470
`index.resetStopWords(): Promise<EnqueuedUpdate>`
463471

464472
### Ranking rules <!-- omit in toc -->
465473

466-
- Get Ranking Rules
474+
- [Get Ranking Rules](https://docs.meilisearch.com/reference/api/ranking_rules.html#get-ranking-rules)
467475
`index.getRankingRules(): Promise<string[]>`
468476

469-
- Update Ranking Rules
477+
- [Update Ranking Rules](https://docs.meilisearch.com/reference/api/ranking_rules.html#update-ranking-rules)
470478
`index.updateRankingRules(rankingRules: string[] | null): Promise<EnqueuedUpdate>`
471479

472-
- Reset Ranking Rules
480+
- [Reset Ranking Rules](https://docs.meilisearch.com/reference/api/ranking_rules.html#reset-ranking-rules)
473481
`index.resetRankingRules(): Promise<EnqueuedUpdate>`
474482

475483
### Distinct Attribute <!-- omit in toc -->
476484

477-
- Get Distinct Attribute
485+
- [Get Distinct Attribute](https://docs.meilisearch.com/reference/api/distinct_attribute.html#get-distinct-attribute)
478486
`index.getDistinctAttribute(): Promise<string | void>`
479487

480-
- Update Distinct Attribute
488+
- [Update Distinct Attribute](https://docs.meilisearch.com/reference/api/distinct_attribute.html#update-distinct-attribute)
481489
`index.updateDistinctAttribute(distinctAttribute: string | null): Promise<EnqueuedUpdate>`
482490

483-
- Reset Distinct Attribute
491+
- [Reset Distinct Attribute](https://docs.meilisearch.com/reference/api/distinct_attribute.html#reset-distinct-attribute)
484492
`index.resetDistinctAttribute(): Promise<EnqueuedUpdate>`
485493

486494
### Searchable Attributes <!-- omit in toc -->
487495

488-
- Get Searchable Attributes
496+
- [Get Searchable Attributes](https://docs.meilisearch.com/reference/api/searchable_attributes.html#get-searchable-attributes)
489497
`index.getSearchableAttributes(): Promise<string[]>`
490498

491-
- Update Searchable Attributes
499+
- [Update Searchable Attributes](https://docs.meilisearch.com/reference/api/searchable_attributes.html#update-searchable-attributes)
492500
`index.updateSearchableAttributes(searchableAttributes: string[] | null): Promise<EnqueuedUpdate>`
493501

494-
- Reset Searchable Attributes
502+
- [Reset Searchable Attributes](https://docs.meilisearch.com/reference/api/searchable_attributes.html#reset-searchable-attributes)
495503
`index.resetSearchableAttributes(): Promise<EnqueuedUpdate>`
496504

497505
### Displayed Attributes <!-- omit in toc -->
498506

499-
- Get Displayed Attributes
507+
- [Get Displayed Attributes](https://docs.meilisearch.com/reference/api/displayed_attributes.html#get-displayed-attributes)
500508
`index.getDisplayedAttributes(): Promise<string[]>`
501509

502-
- Update Displayed Attributes
510+
- [Update Displayed Attributes](https://docs.meilisearch.com/reference/api/displayed_attributes.html#update-displayed-attributes)
503511
`index.updateDisplayedAttributes(displayedAttributes: string[] | null): Promise<EnqueuedUpdate>`
504512

505-
- Reset Displayed Attributes
513+
- [Reset Displayed Attributes](https://docs.meilisearch.com/reference/api/displayed_attributes.html#reset-displayed-attributes)
506514
`index.resetDisplayedAttributes(): Promise<EnqueuedUpdate>`
507515

508516
### Filterable Attributes <!-- omit in toc -->
509517

510-
- Get Filterable Attributes
518+
- [Get Filterable Attributes](https://docs.meilisearch.com/reference/api/filterable_attributes.html#get-filterable-attributes)
511519
`index.getFilterableAttributes(): Promise<string[]>`
512520

513-
- Update Filterable Attributes
521+
- [Update Filterable Attributes](https://docs.meilisearch.com/reference/api/filterable_attributes.html#update-filterable-attributes)
514522
`index.updateFilterableAttributes(filterableAttributes: string[] | null): Promise<EnqueuedUpdate>`
515523

516-
- Reset Filterable Attributes
524+
- [Reset Filterable Attributes](https://docs.meilisearch.com/reference/api/filterable_attributes.html#reset-filterable-attributes)
517525
`index.resetFilterableAttributes(): Promise<EnqueuedUpdate>`
518526

519527
### Sortable Attributes <!-- omit in toc -->
520528

521-
- Get Sortable Attributes
529+
- [Get Sortable Attributes](https://docs.meilisearch.com/reference/api/sortable_attributes.html#get-sortable-attributes)
522530
`index.getSortableAttributes(): Promise<string[]>`
523531

524-
- Update Sortable Attributes
532+
- [Update Sortable Attributes](https://docs.meilisearch.com/reference/api/sortable_attributes.html#update-sortable-attributes)
525533
`index.updateSortableAttributes(sortableAttributes: string[] | null): Promise<EnqueuedUpdate>`
526534

527-
- Reset Sortable Attributes
535+
- [Reset Sortable Attributes](https://docs.meilisearch.com/reference/api/sortable_attributes.html#reset-sortable-attributes)
528536
`index.resetSortableAttributes(): Promise<EnqueuedUpdate>`
529537

530538
### Keys <!-- omit in toc -->
531539

532-
- Get keys
540+
- [Get keys](https://docs.meilisearch.com/reference/api/keys.html#get-keys)
533541

534542
`client.getKeys(): Promise<Keys>`
535543

536544
### isHealthy <!-- omit in toc -->
537545

538-
- Return `true` or `false` depending on the health of the server.
546+
- [Return `true` or `false` depending on the health of the server](https://docs.meilisearch.com/reference/api/health.html#get-health)
539547

540548
`client.isHealthy(): Promise<boolean>`
541549

542550
### Health <!-- omit in toc -->
543551

544-
- Check if the server is healthy
552+
- [Check if the server is healthy](https://docs.meilisearch.com/reference/api/health.html#get-health)
545553

546554
`client.health(): Promise<Health>`
547555

548556
### Stats <!-- omit in toc -->
549557

550-
- Get database stats
558+
- [Get database stats](https://docs.meilisearch.com/reference/api/stats.html#get-stat-of-an-index)
551559

552560
`client.getStats(): Promise<Stats>`
553561

554562
### Version <!-- omit in toc -->
555563

556-
- Get binary version
564+
- [Get binary version](https://docs.meilisearch.com/reference/api/version.html#get-version-of-meilisearch)
557565

558566
`client.getVersion(): Promise<Version>`
559567

560568
### Dumps <!-- omit in toc -->
561569

562-
- Trigger a dump creation process
570+
- [Trigger a dump creation process](https://docs.meilisearch.com/reference/api/dump.html#create-a-dump)
563571

564572
`client.createDump(): Promise<Types.EnqueuedDump>`
565573

566-
- Get the status of a dump creation process
574+
- [Get the status of a dump creation process](https://docs.meilisearch.com/reference/api/dump.html#get-dump-status)
567575

568576
`client.getDumpStatus(dumpUid: string): Promise<Types.EnqueuedDump>`
569577

0 commit comments

Comments
 (0)