@Override
	protected void queryNearestVector(QueryNearestVector query) throws SQLException {
		ResponseNearestVector response = query.nearresponse;
		response.totalvec = 0;
		response.totalmatch = 0;
		response.uniquematch = 0;

		int vectormax = query.vectormax;
		if (vectormax == 0) {
			vectormax = 2000000; // Really means a very big limit
		}

		Iterator<FunctionDescription> iter = query.manage.listAllFunctions();
		while (iter.hasNext()) {
			FunctionDescription frec = iter.next();
			SignatureRecord srec = frec.getSignatureRecord();
			if (srec == null) {
				continue;
			}
			LSHVector thevec = srec.getLSHVector();
			double len2 = vectorFactory.getSelfSignificance(thevec);
			if (len2 < query.signifthresh) {
				continue;
			}

			response.totalvec += 1;
			List<VectorResult> resultset = new ArrayList<>();

			queryNearestVector(resultset, thevec, query.thresh, query.signifthresh, vectormax);
			if (resultset.isEmpty()) {
				continue;
			}
			SimilarityVectorResult simres = new SimilarityVectorResult(frec);
			simres.addNotes(resultset);
			response.totalmatch += simres.getTotalCount();
			if (simres.getTotalCount() == 1) {
				response.uniquematch += 1;
			}
			response.result.add(simres);
		}
	}
@param resultset the list of result set objects to populate
@param vec the vector containing the saveSQL query statement
@param simthresh the similarity threshold
@param sigthresh the confidence threshold
@param max the max number of results to return
@return the number of results returned
@throws SQLException if there is a problem creating or executing the query
Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/query/client/PostgresFunctionDatabase.java