@@ -0,0 +1,1532 @@
+import java.io.*;%0Aimport java.util.*;%0A%0Apublic class QueryFullIndexTwoWord %7B%0A%09public static void main(String%5B%5D args) throws IOException %7B%0A%09%09FileReader fpResult = new FileReader(args%5B1%5D);%0A%09%09BufferedReader fpBufferedResult = new BufferedReader(fpResult);%0A%09%09String lineResult;%0A%09%09String%5B%5D splitLine;%0A%09%09Hashtable%3CString, String%3E hashDoc = new Hashtable%3CString, String%3E();%0A%09%09//Create a HashTable using the full inverted index file from MapReduce program%0A%09%09while ((lineResult = fpBufferedResult.readLine()) != null) %7B%0A%09%09%09splitLine = lineResult.split(%22%5C%5Cs+:%5C%5Cs*%22);%0A%09%09%09hashDoc.put(splitLine%5B0%5D, splitLine%5B1%5D);%0A%09%09%7D%0A%0A%09%09PrintWriter fpOut = new PrintWriter(args%5B2%5D);%0A%09%09FileReader fpQuery = new FileReader(args%5B0%5D);%0A%09%09BufferedReader fpBufferedQuery = new BufferedReader(fpQuery);%0A%09%09String lineQuery;%0A%09%09String%5B%5D lineDocs;%0A%09%09String%5B%5D lineDocSplit;%0A%09%09%0A%09%09while ((lineQuery = fpBufferedQuery.readLine()) != null) %7B%0A%09%09%09//Make sure only one whitespace exist between query words%0A%09%09%09String%5B%5D twoWords = lineQuery.split(%22%5C%5Cs+%22);%0A%09%09%09if (twoWords.length %3E= 2) %7B%0A%09%09%09%09lineDocs = hashDoc.get(twoWords%5B0%5D+%22 %22+twoWords%5B1%5D).split(%22,%5C%5Cs+%22);%0A%09%09%09%09fpOut.println(lineQuery+%22:%22);%0A%09%09%09%09//For every file@offset value do below%0A%09%09%09%09for (int i = 0; i %3C lineDocs.length; i++) %7B%0A%09%09%09%09%09lineDocSplit = lineDocs%5Bi%5D.split(%22@%22);%09%0A%09%09%09%09%09RandomAccessFile docSeeker = new RandomAccessFile(lineDocSplit%5B0%5D, %22r%22);%0A%09%09%09%09%09docSeeker.seek(Long.parseLong(lineDocSplit%5B1%5D));%0A%09%09%09%09%09fpOut.println(lineDocs%5Bi%5D+%22 -%3E %22+docSeeker.readLine());%0A%09%09%09%09%09docSeeker.close();%0A%09%09%09%09%7D%0A%09%09%09%7D%0A%09%09%7D%0A%09%09fpOut.close();%09%0A%09%7D%0A%7D%0A

Create QueryFullIndexTwoWord.java