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

folder/filename as ID #202

Closed
logemann opened this issue Apr 22, 2018 · 5 comments
Closed

folder/filename as ID #202

logemann opened this issue Apr 22, 2018 · 5 comments
Milestone

Comments

@logemann
Copy link

Tell us where you are using Dejavu (Hosted web app, Chrome extension, Docker Image, Within appbase.io)

Docker Image

What is the version of Dejavu that you are using?

1.6.1

Describe the issue that you are seeing, or the feature request :-), include any screenshots as necessary.

I want to store a folder/filename as ID in elasticsearch. When doing it via cURL directly, i do:

curl -X PUT "localhost:9200/okaydocs/files/aha%2Ffoo.pdf" -H 'Content-Type: application/json' -d' { "Bucket" : "kimchy", "Name" : "foo.pdf" } '

I can delete this easily via cURL:

curl -X DELETE "localhost:9200/okaydocs/files/aha%2Ffoo.pdf"

But when trying to delete it via dejavu, i am getting error because urlencoding will not be used by the webapp.

vendor.min.js:7 DELETE http://localhost:9200/okaydocs/files/aha/foo.pdf? 400 (Bad Request)

If your issue deals with accessing Elasticsearch cluster, share the necessary steps to replicate not needed
If your issue deals with a UI issue, share with us a screenshot of the failing network request or the browser console log showing the error.

not needed

@siddharthlatest
Copy link
Member

@logemann I understand the issue. However, ES doesn't return back the id (via _search endpoint) as aha%2Ffoo, but as aha/foo.

How can dejavu know what ids to transform?

@logemann
Copy link
Author

Dont understand the question. Why dont u just urlencode the ID which you get back from ES and use this for subsequent requests?

@siddharthlatest
Copy link
Member

I am thinking about whether this will have any side-effects. I am trying to find any reading on how Elasticsearch handles URL encoding across versions.

@logemann
Copy link
Author

according to ElasticSearch Reference documentation "/" is a valid character for an ID as are other chars like ".". Given thats the case, an application should handle this scenario. Especially if its a web viewer client for ES ;-)

@siddharthlatest
Copy link
Member

  • Update: We will add URLEncode(..) to all Ids being indexed into Elasticsearch. This will apply to all Insert JSON and Update requests, as well as when importing via importer.

@siddharthlatest siddharthlatest added this to the 1.7.0 milestone May 15, 2018
@siddharthlatest siddharthlatest modified the milestones: 1.7.0, 3.x Dec 29, 2018
@logemann logemann closed this as completed Jul 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants