private void fdbQueryVectorMatch(QueryVectorMatch query) throws ElasticException, LSHException {
		String filter = null;
		if (query.bsimFilter != null) {
			ExecutableRecord repexe = null;		// Needed for ExternalFunction filter
			IDElasticResolution idres[] = new IDElasticResolution[query.bsimFilter.numAtoms()];
			for (int i = 0; i < idres.length; ++i) {
				FilterAtom atom = query.bsimFilter.getAtom(i);
				idres[i] = atom.type.generateIDElasticResolution(atom);
				if (idres[i] != null) {
					idres[i].resolve(this, repexe);
				}
			}
			filter = ElasticEffects.createFilter(query.bsimFilter, idres);
		}
		List<VectorResult> vectorList = new ArrayList<>();
		for (Long id : query.vectorIds) {
			VectorResult vecRes = new VectorResult();
			vecRes.vectorid = id;
			vectorList.add(vecRes);
		}
		Iterator<VectorResult> iter1 = vectorList.iterator();
		Iterator<VectorResult> iter2 = vectorList.iterator();
		while (iter1.hasNext()) {
			fetchVectors(iter1, iter2, 50);						// Fetch vector associated with each vectorid
		}
		iter1 = vectorList.iterator();
		iter2 = vectorList.iterator();
		while (iter1.hasNext()) {
			fetchVectorCounts(iter1, iter2, MAX_VECTORCOUNT_WINDOW);	// Fetch hitcount of each vector
		}
		int count = 0;
		DescriptionManager manager = query.matchresponse.manage;
		for (VectorResult vecResult : vectorList) {
			if (count >= query.max) {
				break;
			}
			SignatureRecord srec = manager.newSignature(vecResult.vec, vecResult.hitcount);
			JsonArray descres;
			descres = queryVectorIdMatch(vecResult.vectorid, filter, query.max - count);
			if (descres == null) {
				throw new ElasticException(
					"Error querying vectorid: " + Long.toString(vecResult.vectorid));
			}
			if (descres.size() == 0) {
				if (filter != null) {
					continue; // Filter may have eliminated all results
				}
				// Otherwise this is a sign of corruption in the database
				throw new ElasticException(
					"No functions matching vectorid: " + Long.toString(vecResult.vectorid));
			}
			count += descres.size();
			convertDescriptionRows(null, descres, vecResult, manager, srec);
		}
	}
Entry point for the Elasticsearch version of QueryNearestVector command:
  Query for vectors that are similar to those in the request
@param query is command parameters
@throws ElasticException for communication problems with the server
@throws LSHException if the command is misconfigured
Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/query/elastic/ElasticDatabase.java