code: public List<Pair<Double, Integer>> queryWithDistances(INDArray query, int numResults) {
          return RPUtils.queryAllWithDistances(query,this.data, trees,numResults,similarityFunction);
      }
docs: Query all with the distances
  sorted by index
  @param query the query vector
  @param numResults the number of results to return
  @return a list of samples