public List < Similarity > similar ( Image object , double threshold ) { //return getDatastore().find(Similarity.class).field("firstObject").equal(object).order("similarityScore").asList(); Query < Similarity > q = getDatastore ( ) . createQuery ( Similarity . class ) ; q . or ( q . criteria ( "firstObject" ) . equal ( object ) , q . criteria ( "secondObject" ) . equal ( object ) ) ; return q . order ( "-similarityScore" ) . filter ( "similarityScore >" , threshold ) . asList ( ) ; }
Returns a list of objects that are similar to the specified object