-
Notifications
You must be signed in to change notification settings - Fork 981
Get/update fails for item IDs that contain spaces #1278
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
@cdlate you right, the |
Hey @ezimuel Can I contribute? |
I'll provide a PR for fixing it in elasticsearch-php 7.17.2. You can help me with a review, thanks! |
Released 7.17.2 |
Summary
I want to update or get a record having id containing a space using the PHP client library.
Expected: The record having the correct id is returned/updated
Actual: The record is not found
Code snippet of problem
Test dataset:
Kibana dev tools for inserts:
POST test_index/doc/_bulk
{"index": {"_index": "test_index", "_id": "test test"}}
{"field1": "value1"}
This will return data properly:
GET /test_index/_doc/test%20test
I think the problem is caused by the usage of urlencode instead of rawurlencode in the file AbstractEndPoint, not sure about how many client's methods are affected, not sure if the latest versions are affected, but I highly suspect they are.
See: https://www.php.net/manual/en/function.urldecode.php
See: https://www.php.net/manual/en/function.rawurlencode.php
System details
The text was updated successfully, but these errors were encountered: