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

disable ability to make a doc named /test/test/_query #1780

Closed
erickt opened this issue Mar 14, 2012 · 1 comment
Closed

disable ability to make a doc named /test/test/_query #1780

erickt opened this issue Mar 14, 2012 · 1 comment

Comments

@erickt
Copy link
Contributor

erickt commented Mar 14, 2012

I was playing around with delete-by-query, and I found it's possible to make a document with the id _query:

% curl -XPOST "http://localhost:9200/test/test/_query" -d "{}"
{"ok":true,"_index":"test","_type":"test","_id":"_query","_version":1}
% curl -XGET "http://localhost:9200/test/test/_query"
{"_index":"test","_type":"test","_id":"_query","_version":1,"exists":true, "_source" : {}}

Could this be made an error? The only way to get rid of this document is to use delete-by-query:

% curl -XDELETE "http://localhost:9200/test/test/_query"
{"error":null}
% curl -XDELETE "http://localhost:9200/test/test/_query" -d '{"ids":{"values":["_query"]}}'
{"ok":true,"_indices":{"test":{"_shards":{"total":5,"successful":5,"failed":0}}}}
% curl -XGET "http://localhost:9200/test/test/_query"
{"_index":"test","_type":"test","_id":"_query","exists":false}
@clintongormley
Copy link
Contributor

Closing in favour of #6736

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

No branches or pull requests

2 participants