Skip to content

[Backport 8.0] Prefer Fields type over IEnumerable<Field> #6853

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
Oct 28, 2022
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
Expand Up @@ -41,7 +41,7 @@ public sealed partial class CombinedFieldsQuery : Query

[JsonInclude]
[JsonPropertyName("fields")]
public IList<Elastic.Clients.Elasticsearch.Field> Fields { get; set; }
public Fields Fields { get; set; }

[JsonInclude]
[JsonPropertyName("minimum_should_match")]
Expand Down Expand Up @@ -75,7 +75,7 @@ public CombinedFieldsQueryDescriptor() : base()

private float? BoostValue { get; set; }

private IList<Elastic.Clients.Elasticsearch.Field> FieldsValue { get; set; }
private Fields FieldsValue { get; set; }

private Elastic.Clients.Elasticsearch.MinimumShouldMatch? MinimumShouldMatchValue { get; set; }

Expand Down Expand Up @@ -103,7 +103,7 @@ public CombinedFieldsQueryDescriptor<TDocument> Boost(float? boost)
return Self;
}

public CombinedFieldsQueryDescriptor<TDocument> Fields(IList<Elastic.Clients.Elasticsearch.Field> fields)
public CombinedFieldsQueryDescriptor<TDocument> Fields(Fields fields)
{
FieldsValue = fields;
return Self;
Expand Down Expand Up @@ -193,7 +193,7 @@ public CombinedFieldsQueryDescriptor() : base()

private float? BoostValue { get; set; }

private IList<Elastic.Clients.Elasticsearch.Field> FieldsValue { get; set; }
private Fields FieldsValue { get; set; }

private Elastic.Clients.Elasticsearch.MinimumShouldMatch? MinimumShouldMatchValue { get; set; }

Expand Down Expand Up @@ -221,7 +221,7 @@ public CombinedFieldsQueryDescriptor Boost(float? boost)
return Self;
}

public CombinedFieldsQueryDescriptor Fields(IList<Elastic.Clients.Elasticsearch.Field> fields)
public CombinedFieldsQueryDescriptor Fields(Fields fields)
{
FieldsValue = fields;
return Self;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public sealed partial class LikeDocument

[JsonInclude]
[JsonPropertyName("fields")]
public IList<Elastic.Clients.Elasticsearch.Field>? Fields { get; set; }
public Fields? Fields { get; set; }

[JsonInclude]
[JsonPropertyName("per_field_analyzer")]
Expand Down Expand Up @@ -73,7 +73,7 @@ public LikeDocumentDescriptor() : base()

private object? DocValue { get; set; }

private IList<Elastic.Clients.Elasticsearch.Field>? FieldsValue { get; set; }
private Fields? FieldsValue { get; set; }

private Dictionary<Elastic.Clients.Elasticsearch.Field, string>? PerFieldAnalyzerValue { get; set; }

Expand Down Expand Up @@ -101,7 +101,7 @@ public LikeDocumentDescriptor<TDocument> Doc(object? doc)
return Self;
}

public LikeDocumentDescriptor<TDocument> Fields(IList<Elastic.Clients.Elasticsearch.Field>? fields)
public LikeDocumentDescriptor<TDocument> Fields(Fields? fields)
{
FieldsValue = fields;
return Self;
Expand Down Expand Up @@ -193,7 +193,7 @@ public LikeDocumentDescriptor() : base()

private object? DocValue { get; set; }

private IList<Elastic.Clients.Elasticsearch.Field>? FieldsValue { get; set; }
private Fields? FieldsValue { get; set; }

private Dictionary<Elastic.Clients.Elasticsearch.Field, string>? PerFieldAnalyzerValue { get; set; }

Expand Down Expand Up @@ -221,7 +221,7 @@ public LikeDocumentDescriptor Doc(object? doc)
return Self;
}

public LikeDocumentDescriptor Fields(IList<Elastic.Clients.Elasticsearch.Field>? fields)
public LikeDocumentDescriptor Fields(Fields? fields)
{
FieldsValue = fields;
return Self;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public sealed partial class MoreLikeThisQuery : Query

[JsonInclude]
[JsonPropertyName("fields")]
public IList<Elastic.Clients.Elasticsearch.Field>? Fields { get; set; }
public Fields? Fields { get; set; }

[JsonInclude]
[JsonPropertyName("include")]
Expand Down Expand Up @@ -132,7 +132,7 @@ public MoreLikeThisQueryDescriptor() : base()

private bool? FailOnUnsupportedFieldValue { get; set; }

private IList<Elastic.Clients.Elasticsearch.Field>? FieldsValue { get; set; }
private Fields? FieldsValue { get; set; }

private bool? IncludeValue { get; set; }

Expand Down Expand Up @@ -194,7 +194,7 @@ public MoreLikeThisQueryDescriptor<TDocument> FailOnUnsupportedField(bool? failO
return Self;
}

public MoreLikeThisQueryDescriptor<TDocument> Fields(IList<Elastic.Clients.Elasticsearch.Field>? fields)
public MoreLikeThisQueryDescriptor<TDocument> Fields(Fields? fields)
{
FieldsValue = fields;
return Self;
Expand Down Expand Up @@ -436,7 +436,7 @@ public MoreLikeThisQueryDescriptor() : base()

private bool? FailOnUnsupportedFieldValue { get; set; }

private IList<Elastic.Clients.Elasticsearch.Field>? FieldsValue { get; set; }
private Fields? FieldsValue { get; set; }

private bool? IncludeValue { get; set; }

Expand Down Expand Up @@ -498,7 +498,7 @@ public MoreLikeThisQueryDescriptor FailOnUnsupportedField(bool? failOnUnsupporte
return Self;
}

public MoreLikeThisQueryDescriptor Fields(IList<Elastic.Clients.Elasticsearch.Field>? fields)
public MoreLikeThisQueryDescriptor Fields(Fields? fields)
{
FieldsValue = fields;
return Self;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public sealed partial class QueryStringQuery : Query

[JsonInclude]
[JsonPropertyName("fields")]
public IList<Elastic.Clients.Elasticsearch.Field>? Fields { get; set; }
public Fields? Fields { get; set; }

[JsonInclude]
[JsonPropertyName("fuzziness")]
Expand Down Expand Up @@ -165,7 +165,7 @@ public QueryStringQueryDescriptor() : base()

private bool? EscapeValue { get; set; }

private IList<Elastic.Clients.Elasticsearch.Field>? FieldsValue { get; set; }
private Fields? FieldsValue { get; set; }

private Elastic.Clients.Elasticsearch.Fuzziness? FuzzinessValue { get; set; }

Expand Down Expand Up @@ -265,7 +265,7 @@ public QueryStringQueryDescriptor<TDocument> Escape(bool? escape = true)
return Self;
}

public QueryStringQueryDescriptor<TDocument> Fields(IList<Elastic.Clients.Elasticsearch.Field>? fields)
public QueryStringQueryDescriptor<TDocument> Fields(Fields? fields)
{
FieldsValue = fields;
return Self;
Expand Down Expand Up @@ -559,7 +559,7 @@ public QueryStringQueryDescriptor() : base()

private bool? EscapeValue { get; set; }

private IList<Elastic.Clients.Elasticsearch.Field>? FieldsValue { get; set; }
private Fields? FieldsValue { get; set; }

private Elastic.Clients.Elasticsearch.Fuzziness? FuzzinessValue { get; set; }

Expand Down Expand Up @@ -665,7 +665,7 @@ public QueryStringQueryDescriptor Escape(bool? escape = true)
return Self;
}

public QueryStringQueryDescriptor Fields(IList<Elastic.Clients.Elasticsearch.Field>? fields)
public QueryStringQueryDescriptor Fields(Fields? fields)
{
FieldsValue = fields;
return Self;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public sealed partial class SimpleQueryStringQuery : Query

[JsonInclude]
[JsonPropertyName("fields")]
public IList<Elastic.Clients.Elasticsearch.Field>? Fields { get; set; }
public Fields? Fields { get; set; }

[JsonInclude]
[JsonPropertyName("flags")]
Expand Down Expand Up @@ -109,7 +109,7 @@ public SimpleQueryStringQueryDescriptor() : base()

private Elastic.Clients.Elasticsearch.QueryDsl.Operator? DefaultOperatorValue { get; set; }

private IList<Elastic.Clients.Elasticsearch.Field>? FieldsValue { get; set; }
private Fields? FieldsValue { get; set; }

private Elastic.Clients.Elasticsearch.QueryDsl.SimpleQueryStringFlags? FlagsValue { get; set; }

Expand Down Expand Up @@ -163,7 +163,7 @@ public SimpleQueryStringQueryDescriptor<TDocument> DefaultOperator(Elastic.Clien
return Self;
}

public SimpleQueryStringQueryDescriptor<TDocument> Fields(IList<Elastic.Clients.Elasticsearch.Field>? fields)
public SimpleQueryStringQueryDescriptor<TDocument> Fields(Fields? fields)
{
FieldsValue = fields;
return Self;
Expand Down Expand Up @@ -329,7 +329,7 @@ public SimpleQueryStringQueryDescriptor() : base()

private Elastic.Clients.Elasticsearch.QueryDsl.Operator? DefaultOperatorValue { get; set; }

private IList<Elastic.Clients.Elasticsearch.Field>? FieldsValue { get; set; }
private Fields? FieldsValue { get; set; }

private Elastic.Clients.Elasticsearch.QueryDsl.SimpleQueryStringFlags? FlagsValue { get; set; }

Expand Down Expand Up @@ -383,7 +383,7 @@ public SimpleQueryStringQueryDescriptor DefaultOperator(Elastic.Clients.Elastics
return Self;
}

public SimpleQueryStringQueryDescriptor Fields(IList<Elastic.Clients.Elasticsearch.Field>? fields)
public SimpleQueryStringQueryDescriptor Fields(Fields? fields)
{
FieldsValue = fields;
return Self;
Expand Down