private void buildParentScript(StringBuilder buffer) {
		buffer.append("\"inline\": \"");
		for(String val : docValues) {
			buffer.append(val);
		}
		buffer.append("return ");
		boolean needsAnd = false;
		for(Entry<BSimFilterType, List<String>> entry : booleanElements.entrySet()) {
			BSimFilterType filter = entry.getKey();
			String val = filter.buildElasticCombinedClause(entry.getValue());
			if (needsAnd) {
				buffer.append(" && ");
			}
			else {
				needsAnd = true;
			}
			buffer.append(val);
		}
		buffer.append("\"");
		if ((!params.isEmpty()) || (!dateParams.isEmpty())) {
			buffer.append(", \"params\": {");
			boolean needsComma = false;
			for(Entry<String,String> entry : params.entrySet()) {
				if (needsComma) {
					buffer.append(", ");
				}
				else {
					needsComma = true;
				}
				buffer.append('\"').append(entry.getKey()).append("\": \"");
				buffer.append(entry.getValue()).append('\"');
			}
			for(Entry<String,Long> entry : dateParams.entrySet()) {
				if (needsComma) {
					buffer.append(", ");
				}
				else {
					needsComma = true;
				}
				buffer.append('\"').append(entry.getKey()).append("\": ");
				buffer.append(entry.getValue());		// Emit value as a JSON long integer
			}
			buffer.append("} ");
		}
	}
Container for collecting an elasticsearch query filter document from BSimFilter elements
Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/query/elastic/ElasticEffects.java