int maxPapers = 1000000;
int maxAuthors = 1000000;
// Import Neo4j DB
System.out.println("Reading neo4j db from " + Config.get().neo4jDbPath);
EmbeddedReadOnlyGraphDatabase graphDB = new EmbeddedReadOnlyGraphDatabase(Config.get().neo4jDbPath);
// Get 'author names' and 'paper titles' along with their page ranks into one big list
ArrayList<CompleteEntry> PaperEntryList = new ArrayList<CompleteEntry>(1000000);
ArrayList<CompleteEntry> AuthorEntryList = new ArrayList<CompleteEntry>(500000);
//final int PAPER_TYPE = 0;
//final int AUTHOR_TYPE = 1;
int counter = 0;
for (Node node: graphDB.getAllNodes()) {
if (isPaperNode(node)) {
CompleteEntry entry = new CompleteEntry();
entry.FromPaperNode(node);
PaperEntryList.add(entry);
}
if (isAuthorNode(node)) {
CompleteEntry entry = new CompleteEntry();
entry.FromAuthorNode(node);
AuthorEntryList.add(entry);
}
counter++;
if (counter % 10000 == 0){
IOHelper.log("Adding entries. Processed " + counter + " nodes. Filled " + (PaperEntryList.size() + AuthorEntryList.size())+ " index entries.");
// break;
}
}
// Finished db reading.
graphDB.shutdown();
// sort list by page rank
System.out.println("Sorting index entries.");
Collections.sort(PaperEntryList, new Comparator<CompleteEntry>() {
@Override