.NET Client max_children in nested sorting

Hi.
I need to set the property max_children in a nested sort im .NET client.

This question was already answered for version 6.x here: Closed Discussion and here: Stack Overflow, but I didn't found it for Version 7.x

The solution there doesn't work. Explained Here

I've opened https://github.com/elastic/elasticsearch-net/pull/4596 to add in the next release.

For now, you'd be able to submit an API call to the low level client with max_children, and return a high level response. For example,

var client = new ElasticClient();

var searchResponse = client.LowLevel.Search<SearchResponse<MyDocument>>(
    "my_index", 
    PostData.Serializable(
	new 
	{
		query = new
		{
			match_all = new {}
		},
		sort = new object[]
		{
			new Dictionary<string, object>
			{
				{
					"tags.added", new
					{
						nested = new
						{
							path = "tags",
							filter = new
							{
								match_all = new { }
							},
							max_children = 50
						}
					}
				}
			}
		}
	}));

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.