- .NET Clients: other versions:
- Introduction
- Building
- Breaking Changes
- Elasticsearch.Net
- NEST
- Core
- Indices
- Cluster
- Search
- Aggregations
- Handling Aggregations
- Avg aggregation
- Cardinality aggregation
- Date Histogram aggregation
- Date Range aggregation
- Extended Stats Aggregation
- Filter aggregation
- Geo Distance aggregation
- Geohash Grid aggregation
- Global aggregation
- Histogram aggregation
- IPv4 Range aggregation
- Max aggregation
- Min aggregation
- Missing aggregation
- Percentiles aggregation
- Percentile Ranks aggregation
- Range aggregation
- Nested aggregation
- Reverse Nested aggregation
- Significant Terms aggregation
- Stats aggregation
- Sum aggregation
- Terms aggregation
- Top Hits aggregation
- Value Count aggregation
WARNING: Version 5.x has passed its EOL date.
This documentation is no longer being maintained and may be removed. If you are running this version, we strongly advise you to upgrade. For the latest information, see the current release documentation.
Errors
editErrors
editElasticsearch.Net
will not throw if it gets an HTTP response other than 200 from Elasticsearch,
unless ThrowOnElasticsearchServerExceptions is set.
The response object’s Success
property will be false and .Error
will contain information on the failed response.
You can throw custom exceptions if you need too by specifying a custom connectionhandler
var settings = new ConnectionConfiguration() .SetConnectionStatusHandler(r=> { if (r.HttpStatusCode == 403) throw new MyApplicationNotLoggedInException(); });
Exceptions
editIf a request has been retried the maximum amount of times a MaxRetryException
is thrown.
Note that requests are only retried when Elasticsearch responds with a 503
or an unspecified connection exception (i.e timeout) has occured on a node.
MaxRetryException
will hold the original exception as .InnerException
.
On this page