elasticsearch-net
elasticsearch-net copied to clipboard
[FEATURE] Pinned query code-generated descriptor is incomplete
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);