Table of Contents

Class ElasticsearchSearchException

Namespace
Excalibur.Data.ElasticSearch.Exceptions
Assembly
Excalibur.Data.ElasticSearch.dll

Represents an exception that is thrown when an Elasticsearch search query fails.

public sealed class ElasticsearchSearchException : ApiException, ISerializable
Inheritance
ElasticsearchSearchException
Implements
Inherited Members

Remarks

This exception provides detailed information about the failed search operation, including the index name, document type, and API call details.

Constructors

ElasticsearchSearchException()

Initializes a new instance of the ApiException class with a default error message.

public ElasticsearchSearchException()

ElasticsearchSearchException(int, string?, Exception?)

Initializes a new instance of the ApiException class with a specified status code, error message, and inner exception.

public ElasticsearchSearchException(int statusCode, string? message, Exception? innerException)

Parameters

statusCode int

The HTTP status code associated with the exception.

message string

The error message describing the exception. If null, a default message is used.

innerException Exception

The exception that caused the current exception.

Exceptions

ArgumentOutOfRangeException

Thrown if the statusCode is outside the valid range (100-599).

ElasticsearchSearchException(string)

Initializes a new instance of the ApiException class with a specified error message.

public ElasticsearchSearchException(string message)

Parameters

message string

The error message describing the exception.

ElasticsearchSearchException(string, Exception?)

Initializes a new instance of the ApiException class with a specified error message and an inner exception that caused this exception.

public ElasticsearchSearchException(string message, Exception? innerException)

Parameters

message string

The error message describing the exception.

innerException Exception

The exception that caused the current exception.

ElasticsearchSearchException(string, Type?, string, Exception?)

Initializes a new instance of the ElasticsearchSearchException class with the specified details.

public ElasticsearchSearchException(string indexName, Type? documentType, string apiCallDetails, Exception? innerException = null)

Parameters

indexName string

The name of the Elasticsearch index where the search query failed.

documentType Type

The type of the document involved in the search query.

apiCallDetails string

Details about the API call that failed.

innerException Exception

The inner exception that caused this exception, if any.

Exceptions

ArgumentException

Thrown if indexName or apiCallDetails is null, empty, or whitespace.

ArgumentNullException

Thrown if documentType is null.

Properties

ApiCallDetails

Gets details about the API call that failed.

public string ApiCallDetails { get; }

Property Value

string

Details about the API call that failed.

DocumentType

Gets the type of the document involved in the search query.

public Type? DocumentType { get; }

Property Value

Type

The type of the document involved in the search query.

IndexName

Gets the name of the Elasticsearch index where the search query failed.

public string IndexName { get; }

Property Value

string

The name of the Elasticsearch index where the search query failed.