Skip to content

Commit

Permalink
fix examples.asciidoc to match implementation (#2252)
Browse files Browse the repository at this point in the history
* fix examples.asciidoc to match implementation

Documentation mentions wrong / outdated keyword arguments when compared to the code implementation. These fixes correct the documentation to match the implementation.

Closes #2251

* Fix interensting typo

---------

Co-authored-by: Quentin Pradet <quentin.pradet@elastic.co>
(cherry picked from commit ff2ef4d)
  • Loading branch information
mattiassluis authored and github-actions[bot] committed Nov 30, 2023
1 parent 05757fb commit 685b44a
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions docs/guide/examples.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ the Python client.
=== Indexing a document

To index a document, you need to specify three pieces of information: `index`,
`id`, and a `body`:
`id`, and a `document`:

[source,py]
----------------------------
Expand All @@ -26,7 +26,7 @@ es = Elasticsearch('https://localhost:9200')
doc = {
'author': 'author_name',
'text': 'Interensting content...',
'text': 'Interesting content...',
'timestamp': datetime.now(),
}
resp = es.index(index="test-index", id=1, document=doc)
Expand Down Expand Up @@ -79,7 +79,7 @@ for hit in resp['hits']['hits']:
=== Updating a document

To update a document, you need to specify three pieces of information: `index`,
`id`, and a `body`:
`id`, and a `doc`:

[source,py]
----------------------------
Expand All @@ -90,10 +90,10 @@ client = Elasticsearch('https://localhost:9200')
doc = {
'author': 'author_name',
'text': 'Interensting modified content...',
'text': 'Interesting modified content...',
'timestamp': datetime.now(),
}
resp = client.update(index="test-index", id=1, document=doc)
resp = client.update(index="test-index", id=1, doc=doc)
print(resp['result'])
----------------------------

Expand All @@ -108,4 +108,4 @@ method:
[source,py]
----------------------------
client.delete(index="test-index", id=1)
----------------------------
----------------------------

0 comments on commit 685b44a

Please sign in to comment.