Skip to content

MultiGetRequest does not serialize request parameters for SourceConfigParam properly #8267

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
MartinAprimo opened this issue Jul 16, 2024 · 1 comment · Fixed by #8328
Closed
Labels
8.x Relates to a 8.x client version Area: Client Category: Bug

Comments

@MartinAprimo
Copy link

Elastic.Clients.Elasticsearch version: 8.14.6

Elasticsearch version: 8.8.2

.NET runtime version: .NET Framework 4.8.9241.0

Operating system version: Win 11

Description of the problem including expected versus actual behavior:
When I search using MultiGetRequest, the code the SourceConfigParam is not serialized to the URI properly. The URI for the request that is send to elastic looks like
POST: /tenant-1_unittests_uniquekeycacheindex_20240716100527714/_mget?pretty=true&error_trace=true&_source=Elastic.Clients.Elasticsearch.Core.Search.SourceConfigParam&realtime=true&refresh=false
Instead of POST: /_mget?pretty=true&error_trace=true&_source=true&realtime=true&refresh=false

Steps to reproduce:
Small code samle

MultiGetRequest multiGetRequest = new MultiGetRequest()
{
				Docs = new List<MultiGetOperation>(),
				Source = new SourceConfigParam(Elastic.Clients.Elasticsearch.Fields.FromString("entityId")), 
};

foreach (var add in updates[UniqueKeyAction.Add])
{
				MultiGetOperation getOperation = new MultiGetOperation() { 
					Id = new Id(UniqueKeyHelper.GenerateUniqueKeyEntryId(add)), Index = CacheName };
				multiGetRequest.Docs.Add(getOperation);
}

foreach (var update in updates[UniqueKeyAction.Update])
{
				MultiGetOperation getOperation = new MultiGetOperation() { Id = new Id(UniqueKeyHelper.GenerateUniqueKeyEntryId(update)), Index = CacheName };
				multiGetRequest.Docs.Add(getOperation);
}

multiGetRequest.Realtime = true;
multiGetRequest.Refresh = false;
multiGetRequest.RequestConfiguration = new RequestConfiguration
{
				MaxRetries = 0
};

var multiGetResponse = await Client.MultiGetAsync<ElasticUniqueKeyDto>(multiGetRequest).ConfigureAwait(false);

Expected behavior
The URI should (I believe) look like /_mget?pretty=true&error_trace=true&_source=true&realtime=true&refresh=false

Provide ConnectionSettings (if relevant):

Provide DebugInformation (if relevant):

@flobernd
Copy link
Member

flobernd commented Sep 5, 2024

@MartinAprimo Fixed in 8.15.6

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

Successfully merging a pull request may close this issue.

2 participants