protected int countExecutables(String filter) throws ElasticException {
		StringBuilder buffer = new StringBuilder();
		buffer.append("{ \"query\": {");
		buffer.append("  \"bool\": {");
		buffer.append("    \"must\": {");
		buffer.append("      \"exists\": { \"field\": \"md5\" } }");
		if (filter != null) {
			buffer.append(", ");
			buffer.append(filter);
		}
		buffer.append("}}}");
		JsonObject resp = connection.executeStatement(ElasticConnection.GET, "executable/_count",
			buffer.toString());
		Long res = resp.get("count").getAsLong();
		return res.intValue();
	}
Place the same query for executables as {@link #queryExecutables(DescriptionManager, List, int, String, boolean, String)}.
Except we only return the count of matching records.
@param filter is the option filter options for the count
@return the number of matching executables matching the filter
@throws ElasticException is there is a server-side issue with the query
Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/query/elastic/ElasticDatabase.java