private static void index(File dataFile, File indexFile) {
		//֤ļĿ¼Ƿȷ
		if (!dataFile.exists() || !dataFile.isDirectory()) {
			System.out.println("Error message:" + dataFile + " does not exist or is not a directory.");
		}
		//һִ
		//ʹMMAnalyzerΪķִ
		Analyzer zh_cnAnalyzer = new MMAnalyzer();
		
		//
		//IndexWriterLuceneҪִ࣬дȹ
		
		try {
			//IndexWriterļ·ִǷ񴴽󳤶ȣĬϲƣ
			//˴iscreateΪtrue,Ŀ¼Ƿļɾ½
			IndexWriter writer = new IndexWriter(indexFile, zh_cnAnalyzer, true, MaxFieldLength.UNLIMITED);
			//
			indexDirectory(writer, dataFile);
			/**
			 * Ż
			 * Lucene 3.5Ժİ汾Ѿṩ
			 * ȡ֮forcemerge
			 */
			writer.optimize();
			// ر
			writer.close();
	
		} catch (CorruptIndexException e) {
			e.printStackTrace();
		} catch (LockObtainFailedException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		}
		
		
	}