-
Notifications
You must be signed in to change notification settings - Fork 24.9k
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
[Doc] Update "Java API Administration >> Indices Administration" page #31906
Comments
Pinging @elastic/es-core-infra |
Hi @lockwobr, what seems to be the problem with the created index? I just tried it and it works fine. What version of Elasticsearch are you using? |
The problem is with the mapping it creates, does not seem right and if you try a more complicated example it will error out. Example from the docs creates this mapping:
The I think how the function should be called produces this:
What lead me down this path is if you try this it errors out all together, so I started to read the code an noticed that you need to call the function way differently.
Errors:
After looking at the code figured out if you change the above to it works.
Version
|
@lockwobr wow, great catch. I stand corrected. Thanks for letting us know, this is certainly an error in the documentation in this case and should be corrected. |
Your welcome. I kind of think it should be a bug in the client code too, because I feel it shouldn't really let you call it the way it is in the document. There is a check for it in the code, but its not working it seems. It wants pairs of params, and some how it is if you have one it seems to let pass the check. |
The current docs of the put-mapping Java API is currently broken. It its current form, it creates an index and uses the whole mapping definition given as a JSON string as the type name. Since we didn't check the index created in the IndicesDocumentationIT so far this went unnoticed. This change adds test to catch this error to the documentation test, changes the documentation so it works correctly now and adds an input validation to PutMappingRequest#buildFromSimplifiedDef() which was used internally to reject calls where no mapping definition is given. Closes elastic#31906
I was very much in favour of restricting the client call and make
which is about the same as doing the problematic "addMapping()" call. Since we allow this in REST, we should not really prevent it in the Java API either, although it might not make much sense. I will probably open an issue to discuss whether there is any real reason for having empty mappings. Maybe we want to dissallow this in Rest, but that would have to happen first and needs to be in a mayor version since it would be a breaking change. |
The current docs of the put-mapping Java API is currently broken. It its current form, it creates an index and uses the whole mapping definition given as a JSON string as the type name. Since we didn't check the index created in the IndicesDocumentationIT so far this went unnoticed. This change adds test to catch this error to the documentation test, changes the documentation so it works correctly now and adds an input validation to PutMappingRequest#buildFromSimplifiedDef() which was used internally to reject calls where no mapping definition is given. Closes #31906
The current docs of the put-mapping Java API is currently broken. It its current form, it creates an index and uses the whole mapping definition given as a JSON string as the type name. Since we didn't check the index created in the IndicesDocumentationIT so far this went unnoticed. This change adds test to catch this error to the documentation test, changes the documentation so it works correctly now and adds an input validation to PutMappingRequest#buildFromSimplifiedDef() which was used internally to reject calls where no mapping definition is given. Closes #31906
The current docs of the put-mapping Java API is currently broken. It its current form, it creates an index and uses the whole mapping definition given as a JSON string as the type name. Since we didn't check the index created in the IndicesDocumentationIT so far this went unnoticed. This change adds test to catch this error to the documentation test, changes the documentation so it works correctly now and adds an input validation to PutMappingRequest#buildFromSimplifiedDef() which was used internally to reject calls where no mapping definition is given. Closes #31906
The current docs of the put-mapping Java API is currently broken. It its current form, it creates an index and uses the whole mapping definition given as a JSON string as the type name. Since we didn't check the index created in the IndicesDocumentationIT so far this went unnoticed. This change adds test to catch this error to the documentation test, changes the documentation so it works correctly now and adds an input validation to PutMappingRequest#buildFromSimplifiedDef() which was used internally to reject calls where no mapping definition is given. Closes #31906
The current docs of the put-mapping Java API is currently broken. It its current form, it creates an index and uses the whole mapping definition given as a JSON string as the type name. Since we didn't check the index created in the IndicesDocumentationIT so far this went unnoticed. This change adds test to catch this error to the documentation test, changes the documentation so it works correctly now and adds an input validation to PutMappingRequest#buildFromSimplifiedDef() which was used internally to reject calls where no mapping definition is given. Closes #31906
The current docs of the put-mapping Java API is currently broken. It its current form, it creates an index and uses the whole mapping definition given as a JSON string as the type name. Since we didn't check the index created in the IndicesDocumentationIT so far this went unnoticed. This change adds test to catch this error to the documentation test, changes the documentation so it works correctly now and adds an input validation to PutMappingRequest#buildFromSimplifiedDef() which was used internally to reject calls where no mapping definition is given. Closes #31906
This example in the Java API Administration docs does not work correctly and is very miss leading.
Example reads:
This example works, but it does not create the index correctly it seems, the example should read
The text was updated successfully, but these errors were encountered: