elasticsearch-net icon indicating copy to clipboard operation
elasticsearch-net copied to clipboard

[FEATURE] Pinned query code-generated descriptor is incomplete

Open stevejgordon opened this issue 1 year ago • 0 comments

It is currently impossible to set the variant for the PinnedQuery type when using the fluent syntax. The code-generator needs work to handle this situation correctly.

Until then, a workaround is to use the fluent QueryDescriptor<T> overload accepting the concrete PinnedQuery instance.

QueryDescriptor<Project> queryDescriptor = new QueryDescriptor<Project>();

var query = PinnedQuery.Ids(new Id[] { 1, 11, 22 });

query.QueryName = "named_query";
query.Boost = 1.1f;
query.Organic = new MatchAllQuery { QueryName = "organic_query" };

queryDescriptor.Pinned(query);

stevejgordon avatar Apr 05 '23 08:04 stevejgordon