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

ElasticsearchClient should filter index names for invalid characters #1426

Closed
aateeque opened this issue May 29, 2015 · 2 comments
Closed

ElasticsearchClient should filter index names for invalid characters #1426

aateeque opened this issue May 29, 2015 · 2 comments

Comments

@aateeque
Copy link

I have come across Elasticsearch issues when using ElasticsearchClient to publish to an index. The method I am using is:
Elasticsearch.Net.IElasticsearchClient.Index(string index, string type, object body, Func<IndexRequestParameters, IndexRequestParameters> requestParameters = null);

The exception on Elasticsearch server is:
org.elasticsearch.indices.InvalidIndexNameException: [a name with a space] Invalid index name [a name with a space], must not contain the following characters [\, /, *, ?, ", <, >, |, , ,] at org.elasticsearch.cluster.metadata.MetaDataCreateIndexService.validateIndexName(MetaDataCreateIndexService.java:173

In this case I would ElasticsearchClient to throw an exception because of the unescaped invalid characters before it causes problems on the server.

@gmarz
Copy link
Contributor

gmarz commented Jun 3, 2015

Hi @aateeque this has been brought up before, and we decided against doing any client side validation like this. See #1017 for details.

@gmarz gmarz closed this as completed Jun 3, 2015
@aateeque
Copy link
Author

aateeque commented Jun 7, 2015

Thanks @gmarz

mweiden added a commit to HumanCellAtlas/logs that referenced this issue May 30, 2018
elastic/elasticsearch-net#1426

Without validation, JSON keys with invalid characters will be sent to
elasticsearch as indexable fields. This commit fixes this issue.
mweiden added a commit to HumanCellAtlas/logs that referenced this issue May 30, 2018
elastic/elasticsearch-net#1426

Without validation, JSON keys with invalid characters will be sent to
elasticsearch as indexable fields. This commit fixes this issue.
mweiden added a commit to HumanCellAtlas/logs that referenced this issue May 31, 2018
elastic/elasticsearch-net#1426

Without validation, JSON keys with invalid characters will be sent to
elasticsearch as indexable fields. This commit fixes this issue.
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