-
Notifications
You must be signed in to change notification settings - Fork 1.2k
document for index produces error to get rid of deprecated message for body causes error #1839
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hello! Thanks for opening this issue. I'm seeing from your original DeprecationWarning message that you're potentially mixing up the
Make sure the line number in the DeprecationWarning is matching up with the API call you're modifying. For an example on how to use each of the above APIs without a DeprecationWarning see below: # Index a document
es.index(
index="alive",
document={...}
)
# Create a document
es.create(
index="alive",
id="id",
document={...}
)
# Create an index
es.indices.create(
index="alive",
mappings={...},
ignore=400
) Does this answer your question? |
@ingmarthompson1964 Going to close this question as answered, let me know if this works for you. |
Thank you so much. Your answer solved my problem, and now the deprecated
message is no longer being displayed. I appreciate your help with this.
Thanks so much,
-ingmar
…On Wed, Dec 15, 2021 at 6:01 AM Seth Michael Larson < ***@***.***> wrote:
This message originated outside of DISH and was sent by:
***@***.***
Hello! Thanks for opening this issue. I'm seeing from your original
DeprecationWarning message that you're potentially mixing up the index,
create, and indices.create APIs. The DeprecationWarning mentions the index
API but your examples are all using indices.create:
/mnt/isilon/SCRIPTS/bin/ICD10Import.py:347: DeprecationWarning: The 'body' parameter is deprecated for
the 'index' API and will be removed in a future version. Instead use the 'document' parameter.
See #1698 for more information
Make sure the line number in the DeprecationWarning is matching up with
the API call you're modifying. For an example on how to use each of the
above APIs without a DeprecationWarning see below:
# Index a documentes.index(
index="alive",
document={...}
)
# Create a documentes.create(
index="alive",
id="id",
document={...}
)
# Create an indexes.indices.create(
index="alive",
mappings={...},
ignore=400
)
Does this answer your question?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#1839 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AW5R4T5PYFM4MXOTBFXQRSTURCGNPANCNFSM5KCCPY2A>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
Describe the feature:
Elasticsearch version 7.15
elasticsearch-py
version (elasticsearch.__versionstr__
): 7.15.2Please make sure the major version matches the Elasticsearch server you are running.
Description of the problem including expected versus actual behavior:
I am getting this deprecated message when running a python script in 7.15.2. It says...
/mnt/isilon/SCRIPTS/bin/ICD10Import.py:347: DeprecationWarning: The 'body' parameter is deprecated for the 'index' API and will be removed in a future version. Instead use the 'document' parameter. See #1698 for more information
I have read the suggested URL, and it says to replace body with document in the code as in...
When I do this, I get an error...
So the suggestion as stated in #1698 doesn't seem to work?
I saw another suggestion in https://discuss.elastic.co/ which said using mappings rather than body will get rid of the deprecated message such as
Using this caused the same deprecated message to be displayed.
Steps to reproduce:
Take this python code...
get this message...
change the above code to
and then I get this error...
If I change the code to use mappings such as
It works, but I still get the deprecated message.
What do I need to add to the stated code block in the above to get rid of the deprecated message, since the provided solution in
#1698 doesn't seem to work to get rid of the message.
Thanks,
-Ingmar Thompson
Dish Network
The text was updated successfully, but these errors were encountered: