0
如何使用elasticsearch在Java的孩子查詢,以實現以下目標:如何使用elasticsearch在Java中有子查詢?
{
"query": {
"has_child": {
"type": "instance",
"query": {
"has_child": {
"type": "instance_permission",
"query": {
"terms": {
"uuid": {
"index": "user",
"type": "user",
"id": "5",
"path": "uuids"
}
}
}
}
}
}
}
}
我曾嘗試:
TermsLookup termsLookup = new TermsLookup("user", "user", "5", null, "uuids", null);
QueryBuilder qbquery = QueryBuilders.termQuery("uuid", termsLookup);
HasChildQueryBuilder bookNameQuery = QueryBuilders
.hasChildQuery("instance", QueryBuilders
.hasChildQuery("instance_permission", qbquery));
,但返回錯誤。