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

Restrict document ID values #14009

Closed
markwalkom opened this issue Oct 7, 2015 · 6 comments
Closed

Restrict document ID values #14009

markwalkom opened this issue Oct 7, 2015 · 6 comments
Assignees
Labels
discuss :Distributed Indexing/CRUD A catch all label for issues around indexing, updating and getting a doc by id. Not search.

Comments

@markwalkom
Copy link
Contributor

It seems that there are some chars that are not ideal in document IDs, things such as /, probably others.
This is being discussed on a different level in #9059 and I thought I'd also raise this specific one.

From this forum post.

@jpountz
Copy link
Contributor

jpountz commented Oct 7, 2015

+1

@clintongormley
Copy link
Contributor

Actually, I think doc ID values can be pretty much unlimited. As pointed out in the forum post, they just need to be properly encoded in the URL, which all the official clients handle correctly.

@jpountz
Copy link
Contributor

jpountz commented Oct 8, 2015

I don't think encoding is enough. For instance we allow documents to have _search as an id but then you can't GET them.

@clintongormley clintongormley added the :Distributed Indexing/CRUD A catch all label for issues around indexing, updating and getting a doc by id. Not search. label Jan 29, 2016
@clintongormley
Copy link
Contributor

You can always fall back to using mget in these cases.

Related to #9059

@dr0i
Copy link
Contributor

dr0i commented Jul 5, 2016

Actually, I think doc ID values can be pretty much unlimited. As pointed out in the forum post, they just need to be properly encoded in the URL

Right! If it happen that a value of an _id field is already percent encoded (e.g. a%2Fb) the lookup-query would be .../a%252Fb).
Doing an ID lookup, maybe it would be save to say:
"always percent-encode the ID in an ID-query (take the value of _id , percent-encode it and query that) ".

@dnhatn
Copy link
Member

dnhatn commented Mar 19, 2018

Any document id will be handled correctly with a proper url encoding.

@dnhatn dnhatn closed this as completed Mar 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discuss :Distributed Indexing/CRUD A catch all label for issues around indexing, updating and getting a doc by id. Not search.
Projects
None yet
Development

No branches or pull requests

5 participants