When it defines the mapping, it uses opensearchapi.CreateRequest() but as far as I can see that doesn’t send anything and would need a Do() call. So is that a no-op or does it have some effect I’m not aware of?
I tried adding a Do() but Opensearch complains about the Document ID being missing like this:
[400 Bad Request] {“error”:{“root_cause”:[{“type”:“illegal_argument_exception”,“reason”:“if _id is specified it must not be empty”}],“type”:“illegal_argument_exception”,“reason”:“if _id is specified it must not be empty”},“status”:400}
So then how am I supposed to create a mapping and should the example be updated?
Thanks for reading.
@nethlaria CreateRequest is not a method, instead, it only initialize parameters for the request. The method ‘Do’ will perform action based on CreateRequest parameters. Can you post your complete code so that i can understand why your request fails? Thanks
@Vijay Thanks for responding. I was really asking about the example code in the User Guide. Let me put it another way: If that CreateRequest does not send anything, what is the mapping string for?