@Override
	protected int queryNearestVector(List<VectorResult> resultset, LSHVector vec, double simthresh,
			double sigthresh, int max) throws SQLException {
		VectorCompare comp;
		List<VectorResult> resultsToSort = new ArrayList<>();
		for (VectorStoreEntry entry : vectorStore) {
			if (entry.selfSig() < sigthresh) {
				continue;
			}
			vec.compare(entry.vec(), comp = new VectorCompare());
			double cosine = comp.dotproduct / (vec.getLength() * entry.vec().getLength());
			if (cosine <= simthresh) {
				continue;
			}
			double sig = vectorFactory.calculateSignificance(comp);
			if (sig <= sigthresh) {
				continue;
			}
			resultsToSort
					.add(new VectorResult(entry.id(), entry.count(), cosine, sig, entry.vec()));
		}
		resultsToSort.sort((r1, r2) -> Double.compare(r2.sim, r1.sim));
		int maxResults = Math.min(max, resultsToSort.size());
		for (int i = 0; i < maxResults; ++i) {
			resultset.add(resultsToSort.get(i));
		}
		return resultset.size();
	}
Create vector map which maps vector ID to {@link VectorStoreEntry}
@return vector map
@throws SQLException if error occurs while reading map data
Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/query/file/H2FileFunctionDatabase.java