private JsonArray queryVectorIdMatch(long vectorId, String filter, int maxDocuments)
			throws ElasticException {
		StringBuilder buffer = new StringBuilder();
		buffer.append("{ \"size\": ").append(maxDocuments);
		buffer.append(", \"_source\": { \"excludes\": [ \"childid\" ] }");
		buffer.append(", \"query\": { ");
		buffer.append("    \"bool\": { ");
		buffer.append("      \"must\": { ");
		buffer.append("        \"term\": { \"id_signature\": \"");
		Base64Lite.encodeLongBase64(buffer, vectorId);
		buffer.append("\" } }");
		if (filter != null) {
			buffer.append(filter);
		}
		buffer.append("} } }");
		JsonObject resp = connection.executeStatement(ElasticConnection.GET, "executable/_search",
			buffer.toString());
		JsonObject baseHits = (JsonObject) resp.get("hits");
		JsonObject totalRec = (JsonObject) baseHits.get("total");
		long total = totalRec.get("value").getAsLong();
		if (total == 0) {
			return new JsonArray();
		}
		JsonArray hitsArray = (JsonArray) baseHits.get("hits");
		return hitsArray;
	}
Query for function documents that match a given vector id and
passes additional filters. The filter must already be encoded as a JSON fragment.
@param vectorId is the vector id to match
@param filter is the JSON fragment describing the filter
@param maxDocuments is the maximum number of documents to return
@return list of matching functions as JSON documents
@throws ElasticException for communication problems with the server
Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/query/elastic/ElasticDatabase.java