String text = IOUtils.toString(in, "UTF-8"); // TODO convert AhoCorasick to use InputStream
Iterator<SearchResult<Match>> searchResults = tree.search(text.toCharArray());
Vertex sourceVertex = (Vertex) data.getElement();
List<Vertex> termMentions = new ArrayList<Vertex>();
while (searchResults.hasNext()) {
SearchResult searchResult = searchResults.next();
VisibilityJson visibilityJson = data.getVisibilitySourceJson();
List<Vertex> newTermMentions = outputResultToTermMention(sourceVertex, searchResult, data.getProperty().getKey(), visibilityJson, data.getVisibility());
termMentions.addAll(newTermMentions);
getGraph().flush();
}