File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -67,8 +67,9 @@ NB: you can also download MeiliSearch from **Homebrew** or **APT**.
67
67
import meilisearch
68
68
69
69
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' )
72
73
73
74
documents = [
74
75
{ ' book_id' : 123 , ' title' : ' Pride and Prejudice' },
@@ -79,6 +80,7 @@ documents = [
79
80
{ ' book_id' : 42 , ' title' : ' The Hitchhiker\' s Guide to the Galaxy' }
80
81
]
81
82
83
+ # If the index 'books' does not exist, MeiliSearch creates it when you first add the documents.
82
84
index.add_documents(documents) # => { "updateId": 0 }
83
85
```
84
86
You can’t perform that action at this time.
0 commit comments