Problem to check if an Index Exist using NEST .Net

Hi there!,
Im just trying to check if an index exist previous my query with something like that:

var request = new IndexExistsRequest("my_beautiful_index");
var result = client.IndexExists(request);

But i always get the same response, even with existing indexes.

"Invalid NEST response built from a unsuccessful low level call on HEAD:
/my_beautiful_index\r\n# Audit trail of this API call:

[1] BadResponse: Node: http://bla bla bla@bla bla bla/
Took: 00:00:00.1330788\r\n# OriginalException: System.Net.WebException:
The remote server returned an error: (403) Forbidden.\r\n
at System.Net.HttpWebRequest.GetResponse()\r\n
at Elasticsearch.Net.HttpConnection.Request[TResponse](RequestData requestData)\r\n#
Request:\r\n

Request stream not captured or already read to completion by serializer.
Set DisableDirectStreaming() on ConnectionSettings to force it to be set on the response.>

and my lovely configuration its something like that:

var settings = new ConnectionSettings(node);
settings.DefaultIndex(another_lovely_index_overhere);
settings.DisableDirectStreaming();

var client = new ElasticClient(settings);

any thoughts? Thanks in advance :grinning:

It looks like you either have some kind or auth or proxy in front of Elasticsearch, or are using X-Pack Security with anonymous access and do not have authorization to check if that index exists.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.