ontology/solr-facet-tree/src/main/java/uk/co/flax/biosolr/builders/ChildNodeFacetTreeBuilder.java
/**
	 * Find all parent nodes for the given set of items.
	 * @param searcher the searcher for the collection being used.
	 * @param facetValues the starting set of node IDs.
	 * @return a map of nodes, keyed by their IDs.
	 * @throws IOException
	 */
Find all parent nodes for the given set of items.
@param searcher the searcher for the collection being used.
@param facetValues the starting set of node IDs.
@return a map of nodes, keyed by their IDs.
Find all parent nodes for the given set of items . @param searcher the searcher for the collection being used . @param facetValues the starting set of node IDs . @return a map of nodes keyed by their IDs .
private Map<String, Set<String>> findParentEntries(SolrIndexSearcher searcher, Collection<String> facetValues)
			throws IOException {
		Map<String, Set<String>> parentEntries = new HashMap<>();
		Set<String> childrenFound = new HashSet<>();
		Set<String> childIds = new HashSet<>(facetValues);
		int count = 0;
		while (childIds.size() > 0 && (maxLevels == 0 || maxLevels >= count)) {
			Map<String, Set<String>> parents = filterEntriesByField(searcher, childIds, childField);
			parentEntries.putAll(parents);
			childrenFound.addAll(childIds);
			childIds = parents.keySet();
			childIds.removeAll(childrenFound);
			count ++;
		};
		return parentEntries;
	}
private Map < String , Set < String > > findParentEntries ( SolrIndexSearcher searcher , Collection < String > facetValues ) throws IOException { Map < String , Set < String > > parentEntries = new HashMap < > ( ) ; Set < String > childrenFound = new HashSet < > ( ) ; Set < String > childIds = new HashSet < > ( facetValues ) ; int count = 0 ; while ( childIds . size ( ) > 0 && ( maxLevels == 0 || maxLevels >= count ) ) { Map < String , Set < String > > parents = filterEntriesByField ( searcher , childIds , childField ) ; parentEntries . putAll ( parents ) ; childrenFound . addAll ( childIds ) ; childIds = parents . keySet ( ) ; childIds . removeAll ( childrenFound ) ; count ++ ; } ; return parentEntries ; }
Find all parent nodes for the given set of items.
Find all parent nodes for the given set of items .
// Find the direct parents for the current child IDs // Get the IDs for all the retrieved nodes - these are the next set of // nodes whose parents should be found. // Strip out any nodes we've already looked up