标签:update www term comment ide elastics csharp 删除 dex
var list = new List<string> { "1", "2" };
client.UpdateByQuery<PostComment>(s => s
.Index("post_comments")
.Script(s=>s.Source("ctx._source.content=‘*‘"))
.Query(q =>
q.Terms(t => t
.Field(t => t.PostId)
.Terms(list)
)
)
);
POST http://127.0.0.1:9200/post_comments/_update_by_query
Content-Type: application/json
{
"query": {
"terms": {
"postId": [
"1",
"2"
]
}
},
"script": {
"source": "ctx._source.content=‘*‘"
}
}
var list = new List<string> { "1", "2" };
client.DeleteByQuery<PostComment>(s => s
.Index("post_comments")
.Query(q =>
q.Terms(t => t
.Field(t => t.PostId)
.Terms(list)
)
)
);
POST http://127.0.0.1:9200/post_comments/_delete_by_query
Content-Type: application/json
{"query":{"terms":{"postId":["1","2"]}}}
标签:update www term comment ide elastics csharp 删除 dex
原文地址:https://www.cnblogs.com/naergaga/p/13891239.html