Closed jshenpdp closed 2 years ago
You should have a look at the exact output from Elasticsearch. A 4xx response indicates that Elasticsearch didn't understand or denied your request due to an error, and the error message will almost always tell you what exactly it doesn't like.
If you are in the process of updating the library, I advise you to update to the official Elasticsearch driver over at https://github.com/elastic/go-elasticsearch. It recently comes with a so-called Typed API that resembles most of the benefits of this library.
Please use the following questions as a guideline to help me answer your issue/question without further inquiry. Thank you.
Which version of Elastic are you using?
[x] elastic.v7 (for Elasticsearch 7.x) [ ] elastic.v6 (for Elasticsearch 6.x) [ ] elastic.v5 (for Elasticsearch 5.x) [ ] elastic.v3 (for Elasticsearch 2.x) [ ] elastic.v2 (for Elasticsearch 1.x)
Please describe the expected behavior
I am currently migrating our client side ES logic from 6 to 7. As I changed the library from
github.com/olivere/elastic
togithub.com/olivere/elastic/v7
, I am seeing the API call failure as below.Please describe the actual behavior
Currently I am seeing getting client errors from a search:
This only appears after search with aggregation. As the aggregation is removed, the search result returns 200. This only appears after client is using Elasticsearch 7.x This appears after client creates and index and inserts a document into an index:
Any steps to reproduce the behavior?
Client side code to create an index if not created, or use an existing index if already created:
Client side code to insert a document into an index:
Search code:
Also I have a question: The library readme suggests
Is there another library that I need to use?