private ExecutableRecord querySingleExecutable(DescriptionManager manager, String exeName,
			String arch, String compilerName) throws ElasticException, LSHException {
		StringBuilder buffer = new StringBuilder();
		buffer.append("{ \"size\": 4,");
		buffer.append("  \"query\": {");
		buffer.append("  \"bool\": {");
		buffer.append("      \"must\": {");
		buffer.append("        \"term\": { \"name_exec\": \"")
				.append(escape(exeName))
				.append("\" } }");
		if (!StringUtils.isEmpty(arch) || !StringUtils.isEmpty(compilerName)) {
			buffer.append(",   \"filter\": {");
			buffer.append("      \"script\": {");
			buffer.append("        \"script\": {");
			buffer.append("          \"inline\": \"");
			if (StringUtils.isEmpty(arch)) {		// cname only
				buffer.append("doc['name_compiler'].value == params.comp");
			}
			else if (StringUtils.isEmpty(compilerName)) {	// arch only
				buffer.append("doc['architecture'].value == params.arch");
			}
			else {	// Both are provided
				buffer.append(
					"doc['name_compiler'].value == params.comp && doc['architecture'].value == params.arch");
			}
			buffer.append("\",");
			buffer.append("          \"params\": {");
			if (arch.length() != 0) {
				buffer.append(" \"arch\": \"").append(arch);
				if (!StringUtils.isEmpty(compilerName)) {
					buffer.append("\", ");
				}
				else {
					buffer.append("\" ");
				}
			}
			if (!StringUtils.isEmpty(compilerName)) {
				buffer.append(" \"comp\": \"").append(compilerName).append("\" ");
			}
			buffer.append("}}}}");
		}
		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 != 1) {
			return null;		// Either no results, or not unique
		}
		JsonArray hitsArray = (JsonArray) baseHits.get("hits");
		JsonObject exerow = (JsonObject) hitsArray.get(0);
		ExecutableRecord exerec = makeExecutableRecord(manager, exerow);
		return exerec;
	}
Query for a unique executable based on its name and possibly other metadata

@param manager is the container to store the result
@param exeName is the name the executable must match
@param arch is the architecture the executable must match (may be zero length)
@param compilerName is the compiler name the executable must match (may be zero length)
@return the unique resulting ExecutableRecord or null, if none or more than 1 is found
@throws ElasticException for communication problems with the server
@throws LSHException for problems adding new records to the container
Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/query/elastic/ElasticDatabase.java