我使用了术语查找功能来通过Elasticsearch快速搜索术语,但是我需要,如果我从中获取术语数据的索引没有我发布的ID,我想从elasticsearch中获取一个例外。有办法实现吗?
答案 0 :(得分:0)
var settings = new ConnectionConfiguration(new Uri("http://example.com:9200"))
.OnRequestCompleted(apiCallDetails =>
{
if (apiCallDetails.HttpStatusCode == 418)
{
throw new TimeForACoffeeException();
}
});
var lowlevelClient = new ElasticLowLevelClient(settings);