다음과 같이 말하면 POCO
이 있습니다.중첩 된 객체의 elasticsearch 버전 2.0.0.0 부분 업데이트에 대한 네스트
public class Graph
{
public string Id { get; set; } // Indexed by this
public List<Node> NodeList { get; set; }
}
public class Node
{
public string Id { get; set; }
public string Name { get; set; }
public List<Edge> EdgeList { get; set; }
}
public class Edge
{
public string Id { get; set; }
public double Cost { get; set; }
}
부분적으로 업데이트 내 Graph
나는 그것이 Id
의에 의해 NodeList
에서 기존 Node
을 발견하고 Name
및 Edge
등록 정보의 갱신 할 . I Node
개체를 내 NodeList
에 새로 추가하고 싶습니다. 기존 업데이트 만 업데이트하려고합니다.
SOFAR 나는 시도했다 :
public void UpdateGraph(string index, Graph graph)
{
var docPath = new DocumentPath<Graph>(graph.Id).Index(index);
try
{
var updateResp = client.Update<Graph, Graph>(docPath, searchDescriptor => searchDescriptor
.Doc(graph)
.RetryOnConflict(4)
.Refresh(true)
);
}
}
을 내 현재 구현에서는 내가 이전 Graph
객체를 대체하고있는 중이을 모두 볼 수 있습니다. 그러나 부분적으로 내 Graph
개체를 업데이트하고 싶습니다. Node
개체의 목록을 매개 변수로 보내려고합니다. NodeList
에서 해당 개체를 찾아서 Node
개체 만 업데이트하십시오.
은 아마 다음과 같은 몇 가지, NodeList
때문에
public void UpdateGraph(string index, List<Node> node)
{
//Code here
}