-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Description
Elastic.Clients.Elasticsearch version: 8.18.3
Elasticsearch version: 8.10.3
.NET runtime version: .NET 9
Operating system version: Windows 11
Description of the problem including expected versus actual behavior:
DefaultMappingFor does not map type to index. I tried using .DefaultIndex as well and it still does not set the index while searching, it searches through all indices.
Steps to reproduce:
- Create ElasticsearchClientSettings and set DefaultMappingFor(t => t.IndexName("TestIndex")
- Use SearchAsync and create a query.
- Check the response and you can see that it hits all indices.
Expected behavior
I expect the type to be mapped to the index, so I only get result from that index.
Since DefaultMappingFor still exists in 8.18.3 I expect it to work.
Calling .DefaultIndex() also does not seem to work.
Provide DebugInformation
(if relevant):
Valid Elasticsearch response built from a successful (200) low level call on POST: /_search?pretty=true&error_trace=true&_source_includes...
I can't seem to find definitive information on this. Is this intentional? Is mapping the type to a specific index deprecated? I just want to know if I need to implement my own solution to this or if it's a bug.