Open
Description
Elastic.Clients.Elasticsearch version: 8.13.15
Elasticsearch version: 8.13.2
.NET runtime version: .NET 6.0.28 and .NET Framework 4.8.9232.0
Operating system version: Windows 10 Pro
Description of the problem including expected versus actual behavior:
I set the DefaultIndex to "features" while configuring ElasticsearchClientSettings, but the request was sent without using this DefaultIndex.
searchResult.DebugInformation: Valid Elasticsearch response built from a successful (200) low-level call on POST: /_search?typed_keys=true
.
similar to #8151
Steps to reproduce:
var connectionSettings = new ElasticsearchClientSettings(settings.ReadonlyHost);
connectionSettings.DefaultIndex("features");
connectionSettings.RequestTimeout(TimeSpan.FromMinutes(1));
connectionSettings.EnableHttpCompression();
connectionSettings.Authentication(new BasicAuthentication(settings.Login, settings.Password));
var client = new ElasticsearchClient(connectionSettings);
var searchResult = await client.SearchAsync<JsonElement>(s => s
.Aggregations(aggs => aggs.Add("ClassName", agg => agg.Terms(dh => dh.Field("ClassId").Size(100)))));
// or
var searchRequest = new SearchRequest()
{
Size = 10,
Query = new TermQuery(new Field("ClassId")) { Value = FieldValue.Long(75) }
};
var searchResult2 = await client.SearchAsync<JsonElement>(searchRequest);
Expected behavior
I expect http request with index POST: features/_search?typed_keys=true