Skip to content

Commit 7452863

Browse files
committed
Update the Getting Started
1 parent 1b65abd commit 7452863

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,9 @@ NB: you can also download MeiliSearch from **Homebrew** or **APT**.
6767
import meilisearch
6868

6969
client = meilisearch.Client('http://127.0.0.1:7700', 'masterKey')
70-
index = client.create_index('books') # If your index does not exist
71-
index = client.get_index('books') # If you already created your index
70+
71+
# An index is where the documents are stored.
72+
index = client.index('books')
7273

7374
documents = [
7475
{ 'book_id': 123, 'title': 'Pride and Prejudice' },
@@ -79,6 +80,7 @@ documents = [
7980
{ 'book_id': 42, 'title': 'The Hitchhiker\'s Guide to the Galaxy' }
8081
]
8182

83+
# If the index 'books' does not exist, MeiliSearch creates it when you first add the documents.
8284
index.add_documents(documents) # => { "updateId": 0 }
8385
```
8486

0 commit comments

Comments
 (0)