Skip to content
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

rename ICovariantSearch #3868

Merged
merged 2 commits into from
Jun 26, 2019
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 @@ -3,9 +3,9 @@

namespace Nest
{
// TODO 7.x is this still needed?
/// <summary> Signals the type to deserialize hits into </summary>
[InterfaceDataContract]
public interface ICovariantSearchRequest
public interface ISearchTypeInformation
{
Type ClrType { get; }
}
Expand Down
6 changes: 3 additions & 3 deletions src/Nest/Search/MultiSearch/MultiSearchResponseFormatter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,15 @@ public MultiSearchResponse Deserialize(ref JsonReader reader, IJsonFormatterReso
(doc, desc) => new SearchHitTuple
{
Hit = doc,
Descriptor = new KeyValuePair<string, ICovariantSearchRequest>(desc.Key, desc.Value)
Descriptor = new KeyValuePair<string, ITypedSearchRequest>(desc.Key, desc.Value)
});
break;
case IMultiSearchTemplateRequest multiSearchTemplate:
withMeta = responses.Zip(multiSearchTemplate.Operations,
(doc, desc) => new SearchHitTuple
{
Hit = doc,
Descriptor = new KeyValuePair<string, ICovariantSearchRequest>(desc.Key, desc.Value)
Descriptor = new KeyValuePair<string, ITypedSearchRequest>(desc.Key, desc.Value)
});
break;
default:
Expand Down Expand Up @@ -117,7 +117,7 @@ IDictionary<string, IResponse> collection

internal class SearchHitTuple
{
public KeyValuePair<string, ICovariantSearchRequest> Descriptor { get; set; }
public KeyValuePair<string, ITypedSearchRequest> Descriptor { get; set; }
public ArraySegment<byte> Hit { get; set; }
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/Nest/Search/Scroll/Scroll/ScrollRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

namespace Nest
{
public partial interface IScrollRequest : ICovariantSearchRequest
public partial interface IScrollRequest : ISearchTypeInformation
{
[DataMember(Name ="scroll")]
Time Scroll { get; set; }
Expand All @@ -24,14 +24,14 @@ public ScrollRequest(string scrollId, Time scroll)

public string ScrollId { get; set; }

Type ICovariantSearchRequest.ClrType => null;
Type ISearchTypeInformation.ClrType => null;
}

public partial class ScrollDescriptor<TInferDocument> where TInferDocument : class
{
public ScrollDescriptor(Time scroll, string scrollId) => ScrollId(scrollId).Scroll(scroll);

Type ICovariantSearchRequest.ClrType => typeof(TInferDocument);
Type ISearchTypeInformation.ClrType => typeof(TInferDocument);

Time IScrollRequest.Scroll { get; set; }

Expand Down
8 changes: 4 additions & 4 deletions src/Nest/Search/Search/SearchRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
namespace Nest
{
[ReadAs(typeof(SearchRequest))]
public partial interface ISearchRequest : ICovariantSearchRequest
public partial interface ISearchRequest : ITypedSearchRequest
{
[DataMember(Name = "aggs")]
AggregationDictionary Aggregations { get; set; }
Expand Down Expand Up @@ -119,15 +119,15 @@ public partial class SearchRequest
? HttpMethod.GET
: HttpMethod.POST;

Type ICovariantSearchRequest.ClrType => null;
Type ITypedSearchRequest.ClrType => null;

protected sealed override void RequestDefaults(SearchRequestParameters parameters) => TypedKeys = true;
}

[DataContract]
public partial class SearchRequest<TInferDocument> : ISearchRequest<TInferDocument>
{
Type ICovariantSearchRequest.ClrType => typeof(TInferDocument);
Type ITypedSearchRequest.ClrType => typeof(TInferDocument);
}

/// <summary>
Expand All @@ -142,7 +142,7 @@ public partial class SearchDescriptor<TInferDocument> where TInferDocument : cla
: HttpMethod.POST;

AggregationDictionary ISearchRequest.Aggregations { get; set; }
Type ICovariantSearchRequest.ClrType => typeof(TInferDocument);
Type ITypedSearchRequest.ClrType => typeof(TInferDocument);
IFieldCollapse ISearchRequest.Collapse { get; set; }
Fields ISearchRequest.DocValueFields { get; set; }
bool? ISearchRequest.Explain { get; set; }
Expand Down
6 changes: 3 additions & 3 deletions src/Nest/Search/SearchTemplate/SearchTemplateRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
namespace Nest
{
[ReadAs(typeof(SearchTemplateRequest))]
public partial interface ISearchTemplateRequest : ICovariantSearchRequest
public partial interface ISearchTemplateRequest : ITypedSearchRequest
{
[DataMember(Name ="id")]
string Id { get; set; }
Expand All @@ -26,7 +26,7 @@ public partial class SearchTemplateRequest

public string Source { get; set; }
protected Type ClrType { get; set; }
Type ICovariantSearchRequest.ClrType => ClrType;
Type ITypedSearchRequest.ClrType => ClrType;

protected sealed override void RequestDefaults(SearchTemplateRequestParameters parameters) => TypedKeys = true;
}
Expand All @@ -41,7 +41,7 @@ public class SearchTemplateRequest<T> : SearchTemplateRequest

public partial class SearchTemplateDescriptor<TDocument> where TDocument : class
{
Type ICovariantSearchRequest.ClrType => typeof(TDocument);
Type ITypedSearchRequest.ClrType => typeof(TDocument);

string ISearchTemplateRequest.Id { get; set; }

Expand Down