Elasticsearch.Net.ElasticsearchClientException

I Use Elasticsearch 7.16.2 on docker and Nest 7.16.0

I added these codes by collecting them from two different classes. It may look complicated

ConnectionSettings conStr = new ConnectionSettings(new Uri("http://localhost:9200"))
                .DisablePing()
                .SniffOnStartup(false)
            .SniffOnConnectionFault(false)
            .EnableApiVersioningHeader();


public IElasticClient elasticClient { get; set; }

public ElasticSearchManager(ConnectionSettings connectionSettings)
{
    elasticClient = new ElasticClient(connectionSettings);
}
        
public List<T> SimpleSearch<T>(string indexName, string searchValue) where T : SearchEngineEntity
{
    SearchDescriptor<T> searchDescriptor = new SearchDescriptor<T>();
    searchDescriptor.Query(q => q
                .MultiMatch(m => m
                    .Type(TextQueryType.MostFields)
                    .Fields(f => f.Fields("searchingArea"))
                    .Query(searchValue.ToLower()))
                );
    searchDescriptor.Index(indexName);
    var result = elasticClient.Search<T>(searchDescriptor);

//error message I received

Invalid NEST response built from a unsuccessful () low level call on POST: /destination_autocomplete/_search?pretty=true&error_trace=true&typed_keys=true

Audit trail of this API call:

  • [1] ProductCheckOnStartup: Took: 00:00:00.0502621
  • [2] ProductCheckFailure: Node: http://localhost:9200/ Took: 00:00:00.0392096

OriginalException: Elasticsearch.Net.ElasticsearchClientException: The client is unable to verify that the server is Elasticsearch due to an unsuccessful product check call. Some functionality may not be compatible if the server is running an unsupported product. Call: Status code unknown from: GET /?pretty=true&error_trace=true

---> Elasticsearch.Net.PipelineException: The client is unable to verify that the server is Elasticsearch due to an unsuccessful product check call. Some functionality may not be compatible if the server is running an unsupported product.

I access through the browser

I found the solution and wanted to share it

http://localhost:9200

instead of

http://host.docker.internal:9200/

it works !

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