diff --git a/hugegraph-api/src/main/java/com/baidu/hugegraph/api/traversers/EdgesAPI.java b/hugegraph-api/src/main/java/com/baidu/hugegraph/api/traversers/EdgesAPI.java index 1e7c01898c..9f1d191d3b 100644 --- a/hugegraph-api/src/main/java/com/baidu/hugegraph/api/traversers/EdgesAPI.java +++ b/hugegraph-api/src/main/java/com/baidu/hugegraph/api/traversers/EdgesAPI.java @@ -111,10 +111,13 @@ public String scan(@Context GraphManager manager, ConditionQuery query = new ConditionQuery(HugeType.EDGE_OUT); query.scan(start, end); - query.limit(Query.DEFAULT_CAPACITY); query.page(page); + boolean paging = page != null; + if (paging) { + query.limit(Query.DEFAULT_CAPACITY); + } Iterator edges = g.edges(query); - return manager.serializer(g).writeEdges(edges, true); + return manager.serializer(g).writeEdges(edges, paging); } } diff --git a/hugegraph-api/src/main/java/com/baidu/hugegraph/api/traversers/VerticesAPI.java b/hugegraph-api/src/main/java/com/baidu/hugegraph/api/traversers/VerticesAPI.java index 96952898d2..c57b7a3504 100644 --- a/hugegraph-api/src/main/java/com/baidu/hugegraph/api/traversers/VerticesAPI.java +++ b/hugegraph-api/src/main/java/com/baidu/hugegraph/api/traversers/VerticesAPI.java @@ -111,10 +111,13 @@ public String scan(@Context GraphManager manager, ConditionQuery query = new ConditionQuery(HugeType.VERTEX); query.scan(start, end); - query.limit(Query.DEFAULT_CAPACITY); query.page(page); + boolean paging = page != null; + if (paging) { + query.limit(Query.DEFAULT_CAPACITY); + } Iterator vertices = g.vertices(query); - return manager.serializer(g).writeVertices(vertices, true); + return manager.serializer(g).writeVertices(vertices, paging); } }