Open ththvseo opened 6 years ago
With Elasticsearch 6.x elastigo searches don't work at all ! Error: Error [Content-Type header [] is not supported] Status [406] [406]
.
Please add a header or make it configurable.
In Elasticsearch 6.x Content-Type header is required. https://www.elastic.co/blog/strict-content-type-checking-for-elasticsearch-rest-requests
Don't bother, this project looks dead long time ago - check commits and closed issues history. Move to https://github.com/olivere/elastic, or wait for official client
since ES 5.3, every request without content-type header triggers a warning.
just look at the competition's ticket here: https://github.com/olivere/elastic/issues/511
there is currently no interface available to set the content-type (or other headers), and no code that sets it. (with one exception in
SetBodyJson()
: https://github.com/mattbaird/elastigo/blob/master/lib/request.go#L80 )(a sub-issue is that the header is not set in SetBodyGzip() even when serializing json: https://github.com/mattbaird/elastigo/issues/295 )
an expectation with a go library would be that it should be possible to inject a custom
http.Client
compatible client, which would allow overriding headers.