Skip to content

[Backport 8.6] Add support for pinned query #7582

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

Merged
merged 1 commit into from
Apr 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information.
//
// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗
// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝
// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗
// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝
// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗
// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝
// ------------------------------------------------
//
// This file is automatically generated.
// Please do not edit these files manually.
//
// ------------------------------------------------

#nullable restore

using Elastic.Clients.Elasticsearch.Fluent;
using Elastic.Clients.Elasticsearch.Serialization;
using System;
using System.Collections.Generic;
using System.Linq.Expressions;
using System.Text.Json;
using System.Text.Json.Serialization;

namespace Elastic.Clients.Elasticsearch.QueryDsl;

public sealed partial class PinnedDoc
{
[JsonInclude, JsonPropertyName("_id")]
public Elastic.Clients.Elasticsearch.Id Id { get; set; }
[JsonInclude, JsonPropertyName("_index")]
public Elastic.Clients.Elasticsearch.IndexName Index { get; set; }
}

public sealed partial class PinnedDocDescriptor : SerializableDescriptor<PinnedDocDescriptor>
{
internal PinnedDocDescriptor(Action<PinnedDocDescriptor> configure) => configure.Invoke(this);

public PinnedDocDescriptor() : base()
{
}

private Elastic.Clients.Elasticsearch.Id IdValue { get; set; }
private Elastic.Clients.Elasticsearch.IndexName IndexValue { get; set; }

public PinnedDocDescriptor Id(Elastic.Clients.Elasticsearch.Id id)
{
IdValue = id;
return Self;
}

public PinnedDocDescriptor Index(Elastic.Clients.Elasticsearch.IndexName index)
{
IndexValue = index;
return Self;
}

protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings)
{
writer.WriteStartObject();
writer.WritePropertyName("_id");
JsonSerializer.Serialize(writer, IdValue, options);
writer.WritePropertyName("_index");
JsonSerializer.Serialize(writer, IndexValue, options);
writer.WriteEndObject();
}
}
Loading