Skip to content
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

making sure id is urlencoded when using updateDocument #734

Merged
merged 1 commit into from
Dec 18, 2014

Conversation

TroodoNmike
Copy link
Contributor

Yesterday I tried to update existing elasticsearch document using Type class. Because all of my documents ids contain forward slashes elastica was throwing an exception and documents were not updated.

So when using:

(existing document)
$doc->getId() -> '/some/path'
$doc->getData() -> array(data here)

Then using
$type->updateDocument($doc);

Documents was not updated.

I have created a test and fix. Let me know if this is valid. Cheers

Mike

@coveralls
Copy link

Coverage Status

Coverage increased (+0.0%) when pulling ecefc85 on TroodoNmike:master into 990b89f on ruflin:master.

@ruflin
Copy link
Owner

ruflin commented Dec 18, 2014

@TroodoNmike I understand the problem and I think it needs to be fixed. Because you brought up the issue I realised we use urlencode(...) for id's in quite a few other locations. The reason I don't like it is because I think the urlencoding is specific to the transport.

I will merge the pull request for now as it is in line with most of the other code parts but I will create a ticket to find a general solution here.

ruflin added a commit that referenced this pull request Dec 18, 2014
making sure id is urlencoded when using updateDocument
@ruflin ruflin merged commit c8b6848 into ruflin:master Dec 18, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants