Skip to content
Merged
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
109 changes: 57 additions & 52 deletions src/Nest/Domain/Responses/SearchShardsResponse.cs
Original file line number Diff line number Diff line change
@@ -1,53 +1,58 @@
using System.Collections.Generic;
using Nest.Domain;
using Newtonsoft.Json;
using System.Linq.Expressions;
using System;
using System.Linq;

namespace Nest
{
[JsonObject(MemberSerialization.OptIn)]
public interface ISearchShardsResponse : IResponse
{
[JsonProperty("shards")]
IEnumerable<IEnumerable<SearchShard>> Shards { get; }

[JsonProperty("nodes")]
IDictionary<string, SearchNode> Nodes { get; }
}

public class SearchShardsResponse : BaseResponse, ISearchShardsResponse
{
public IEnumerable<IEnumerable<SearchShard>> Shards { get; internal set; }
public IDictionary<string, SearchNode> Nodes { get; internal set; }
}


[JsonObject(MemberSerialization.OptIn)]
public class SearchNode
{
[JsonProperty("name")]
public string Name { get; set; }
[JsonProperty("transport_address")]
public string TransportAddress { get; set; }

}

[JsonObject(MemberSerialization.OptIn)]
public class SearchShard
{
[JsonProperty("name")]
public string State { get; set;}
[JsonProperty("primary")]
public bool Primary { get; set;}
[JsonProperty("node")]
public string Node { get; set;}
[JsonProperty("relocating_node")]
public string RelocatingNode { get; set;}
[JsonProperty("shard")]
public int Shard { get; set;}
[JsonProperty("index")]
public string Index { get; set;}
}
using Nest.Domain;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;

namespace Nest
{
[JsonObject(MemberSerialization.OptIn)]
public interface ISearchShardsResponse : IResponse
{
[JsonProperty("shards")]
IEnumerable<IEnumerable<SearchShard>> Shards { get; }

[JsonProperty("nodes")]
IDictionary<string, SearchNode> Nodes { get; }
}

public class SearchShardsResponse : BaseResponse, ISearchShardsResponse
{
public IEnumerable<IEnumerable<SearchShard>> Shards { get; internal set; }

public IDictionary<string, SearchNode> Nodes { get; internal set; }
}

[JsonObject(MemberSerialization.OptIn)]
public class SearchNode
{
[JsonProperty("name")]
public string Name { get; set; }

[JsonProperty("transport_address")]
public string TransportAddress { get; set; }
}

[JsonObject(MemberSerialization.OptIn)]
public class SearchShard
{
[JsonProperty("state")]
public string State { get; set; }

[JsonProperty("primary")]
public bool Primary { get; set; }

[JsonProperty("node")]
public string Node { get; set; }

[JsonProperty("relocating_node")]
public string RelocatingNode { get; set; }

[JsonProperty("shard")]
public int Shard { get; set; }

[JsonProperty("index")]
public string Index { get; set; }
}
}