IndexData is returning an error 'The remote server returned an error: (404) Not Found'

I am using Elasticsearch5.4 and Nest5.4 for creating Index. Its showing an error while executing IndexData

 public bool IndexData<T>(T data, string indexName = null, string mappingType = null)
     where T : class, new()
    {
        if (client == null)
        {
            throw new ArgumentNullException("data");
        }
        var result = this.client.Index<T>(data,
          c => c.Index(indexName).Type(mappingType));           
        return result.IsValid;
    }

Error showing

Invalid NEST response built from a unsuccessful low level call on PUT: /mydocs/indexdocument/2520
# Audit trail of this API call:
- [1] BadResponse: Node: http://elastic:changeme@localhost:9200/ Took: 00:00:00.0370003
 # ServerError: ServerError: 404Type: index_not_found_exception Reason: "no such index and [action.auto_create_index] ([.security,.monitoring*,.watches,.triggered_watches,.watcher-history*]) doesn't match"
# OriginalException: System.Net.WebException: The remote server returned an error: (404) Not Found.
 at System.Net.HttpWebRequest.GetResponse()
at Elasticsearch.Net.HttpConnection.Request[TReturn](RequestData requestData)
# Request:
{"id":2520,"title":"FISMA_Overview.docx","fileExtension":"docx","file":{"_content_length":41040,"_content":"UEsDBBQABgAIAAAAIQBN7NZR0gEAAKAIAAATAMQBW0NvbnRlbnRfVHlwZXNdLnhtbCCiwAEooAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}}
# Response:
 {"error":{"root_cause":[{"type":"index_not_found_exception","reason":"no such index and [action.auto_create_index] ([.security,.monitoring*,.watches,.triggered_watches,.watcher-history*]) doesn't match","index_uuid":"_na_","index":"mydocs"}],"type":"index_not_found_exception","reason":"no such index and [action.auto_create_index] ([.security,.monitoring*,.watches,.triggered_watches,.watcher-history*]) doesn't match","index_uuid":"_na_","index":"mydocs"},"status":404}

Anyone please help.

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