private void indexFile(File file) throws IOException {
		if (file.getName().startsWith(".")) {
			return;
		}
		
		ApplicationHelper.printDebug(String.format("Indexing %s\n", file.getName()));
		BufferedReader br = new BufferedReader(new FileReader(file));
		Document doc = null;
		String docno = null;
		ArrayList<Document> docs = null;
		String nextLine = "";
		while ((nextLine = br.readLine()) != null) {
			if (nextLine.contains("<DOC>")) {
				docs = new ArrayList<Document>();
			} else if (nextLine.contains("</DOC>")) {
				iw.addDocuments(docs);
				doc = null;
				docno = null;
				docs = null;
			} else if (nextLine.contains("<DOCNO>")
					&& nextLine.contains("</DOCNO>")) {
				docno = nextLine.substring(7, nextLine.length() - 8).trim();
			} else if (nextLine.contains("<TEXT>") && docno != null) { 
				StringBuilder sb = new StringBuilder();
				do {
					nextLine = br.readLine();
					sb.append(nextLine.replace("</TEXT>", "").replace("<P>", "").replace("</P>", "").trim());
					sb.append("\n");
				} while (!nextLine.contains("</TEXT>"));

				doc = new Document();
				doc.add(new TextField("TEXT", sb.toString(), Field.Store.YES));
				doc.add(new TextField("DOCNO", docno, Field.Store.YES));
				doc.add(new StringField("FILENAME", file.getName(), Field.Store.YES));

				docs.add(doc);
			} else {
				// Do nothing
			}
		}

		br.close();

	}