Currently working on a proof of concept for a recommendation engine.
Example.
public default GraphTraversal<S, Map<Object, Long>> suggestedFriends(Long limit) {
return out("friendship")
.as("myFriends")
.out("friendship")
.as("friendsOfFriends")
.groupCount()
.by("email")
.order(Scope.local)
.by(Column.values, Order.decr);
}
I'm trying to filter the first steps matched friends before the groupCount.
What would be the correct way of doing this?
EDIT:
Got the desired output agreggating the first step results, and filtering with where
on the second one..
public default GraphTraversal<S, Map<Object, Long>> suggestedFriends(Long limit) {
return out("friendship")
.aggregate("x")
.as("myFriends")
.out("friendship")
.as("friendsOfFriends")
.where(P.without("x"))
.groupCount()
.by("email")
.order(Scope.local)
.by(Column.values, Order.decr)
.limit(Scope.local, limit);
}