code: protected BoundedPriorityQueue<Result> computeNearestNeighborsInternal(int k, double[] queryVector)
  			throws Exception {
  		BoundedPriorityQueue<Result> nn = new BoundedPriorityQueue<Result>(new Result(), k);
  
  		double lowest = Double.MAX_VALUE;
  		for (int i = 0; i < (vectorsList.size() / vectorLength); i++) {
  			boolean skip = false;
  			int startIndex = i * vectorLength;
  			double l2distance = 0;
  			for (int j = 0; j < vectorLength; j++) {
  				l2distance += (queryVector[j] - vectorsList.getQuick(startIndex + j))
  						* (queryVector[j] - vectorsList.getQuick(startIndex + j));
  				if (l2distance > lowest) {
  					skip = true;
  					break;
  				}
  			}
  			if (!skip) {
  				nn.offer(new Result(i, l2distance));
  				if (i >= k) {
  					lowest = nn.last().getDistance();
  				}
  			}
  		}
  		return nn;
  	}
docs: Computes the k-nearest neighbors of the given query vector. The search is exhaustive but includes some
  optimizations that make it faster, especially for high dimensional vectors.
  
  @param k
  The number of nearest neighbors to be returned
  @param queryVector
  The query vector
  
  @return A bounded priority queue of Result objects, which contains the k nearest neighbors along with
  their iids and distances from the query vector, ordered by lowest distance.
  @throws Exception
  If the index is not loaded in memory