Skip to content

calling IndexAsync without specifying an index, does not use the default index for the type #8518

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jonyadamit opened this issue May 8, 2025 · 1 comment · Fixed by #8519
Labels
9.x Relates to a 9.x client version Category: Bug

Comments

@jonyadamit
Copy link
Contributor

Elastic.Clients.Elasticsearch version: 9.0.1

Elasticsearch version: 9.0.1

.NET runtime version: 9.0.4

Operating system version: Windows Server 2019 Standard 1809

Description of the problem including expected versus actual behavior:
Type inference for IndexAsync now calls ToString() on the type instead of using the value defined via DefaultMappingFor.

ElasticSearch returns an error:

Invalid index name [My.Own.Namespace.TypeName], must be lowercase

Steps to reproduce:

  1. Create a class MyClass
  2. While setting the connection up, specify that class: connection.DefaultMappingFor(typeof(MyClass), s => s.IndexName("myindexname")
  3. Call IndexAsync

Expected behavior
A document should be indexed.

Provide ConnectionSettings (if relevant):

Provide DebugInformation (if relevant):

@jonyadamit jonyadamit added Category: Bug 9.x Relates to a 9.x client version labels May 8, 2025
@flobernd
Copy link
Member

flobernd commented May 8, 2025

Hi @jonyadamit,

thanks for reporting. This looks like an oversight.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
9.x Relates to a 9.x client version Category: Bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants