private void fetchVectors(Iterator<VectorResult> iter1, Iterator<VectorResult> iter2,
			int maxDocuments) throws ElasticException {
		if (!iter1.hasNext()) {
			return;
		}
		VectorResult vecRes = iter1.next();
		StringBuilder buffer = new StringBuilder();
		// append the first id
		buffer.append("{ \"ids\": [ ");
		buffer.append('\"');
		Base64Lite.encodeLongBase64(buffer, vecRes.vectorid);
		buffer.append('\"');
		for (int i = 1; i < maxDocuments; ++i) {
			if (!iter1.hasNext()) {
				break;
			}
			vecRes = iter1.next();
			buffer.append(", \"");
			Base64Lite.encodeLongBase64(buffer, vecRes.vectorid);
			buffer.append('\"');
		}
		buffer.append(" ] }");
		JsonObject resp =
			connection.executeStatement(ElasticConnection.GET, "vector/_mget", buffer.toString());
		JsonArray docs = (JsonArray) resp.get("docs");
		char[] vectorDecodeBuffer = Base64VectorFactory.allocateBuffer();
		for (int i = 0; i < maxDocuments; ++i) {
			if (!iter2.hasNext()) {
				break;
			}
			vecRes = iter2.next();
			JsonObject oneResp = (JsonObject) docs.get(i);
			String matchId = oneResp.get("_id").getAsString();
			long matchIdVal = Base64Lite.decodeLongBase64(matchId);
			if (matchIdVal != vecRes.vectorid) {
				throw new ElasticException("Mismatch in vectorid");
			}
			JsonElement source = oneResp.get("_source");
			if (ElasticConnection.isNull(source)) {
				throw new ElasticException("vector document does not exist for id=" + matchId);
			}
			StringReader reader =
				new StringReader(((JsonObject) source).get("features").getAsString());
			try {
				vecRes.vec = vectorFactory.restoreVectorFromBase64(reader, vectorDecodeBuffer);
			}
			catch (IOException e) {
				throw new ElasticException(e.getMessage());
			}
		}
	}
Fetch vectors in bulk from the database, given a list of VectorResults with the vector ids
The vector documents are queried, then the resulting LSHVector objects are filled
in for the VectorResults by parsing the documents. Two iterators pointing to the same list
of VectorResults are required, one for building the query, one for filling in the LSHVectors.
If no exception is thrown, both iterators are advanced the same number of times.
@param iter1 is the iterator to VectorResults to fill in
@param iter2 is a copy of the first iterator
@param maxDocuments is the maximum number of documents to query for
@throws ElasticException for communication problems with the server
Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/query/elastic/ElasticDatabase.java