Map<String, Integer> result = new HashMap<String, Integer>();
try
{
String query = "a_dept:\"" + from +"\" OR b_dept:\"" + from +"\"";
QueryResponse rsp = shootQuery(query, true, "focus_dept");
FacetField relations = rsp.getFacetField("focus_dept");
int otherDPconnected = relations.getValueCount();
query = "a_dept:\"" + from +"\" AND b_dept:\"" + from +"\"";
rsp = shootQuery(query, true, "focus_auth");
relations = rsp.getFacetField("focus_auth");
int internalRPs = relations.getValueCount();
query = "a_dept:\"" + from +"\" OR b_dept:\"" + from +"\"";
rsp = shootQuery(query, true, "focus_auth");
relations = rsp.getFacetField("focus_auth");
int fromOtherDPconnected = relations.getValueCount();
query = "focus_dept:\"" + from +"|||null\" OR focus_dept:\"null|||" + from +"\"";
rsp = shootQuery(query, true, "focus_dept");
relations = rsp.getFacetField("focus_dept");
int externalRPs = (int)rsp.getResults().getNumFound();
int externalCardinality = relations.getValueCount();
//need to remove n row from facet because the first match the department and one or two are matching with external
otherDPconnected = otherDPconnected - 1 - externalCardinality;