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**.
6767import meilisearch
6868
6969client = 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
7374documents = [
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.
8284index.add_documents(documents) # => { "updateId": 0 }
8385```
8486
You can’t perform that action at this time.
0 commit comments