package org.ccpit.base.utils.lucene;
import java.io.File;

import org.apache.lucene.analysis.Analyzer;
import org.apache.lucene.store.Directory;
import org.apache.lucene.store.FSDirectory;
import org.ccpit.base.utils.ReadConfigUtil;
import org.springframework.stereotype.Service;
import org.wltea.analyzer.lucene.IKAnalyzer;

@Service
public class LuceneConfig {
	
	public static Directory directory = null;
	
	public static Analyzer  analyzer = null;
	
	public static final String path = ReadConfigUtil
			.getPlatformConfig("system.IndexFilePath"); // 文件上传路径
	
	
	static {
		try{
			System.out.println(path);
			directory = FSDirectory.open(new File(path));
			analyzer = new IKAnalyzer();
		}catch(Exception e){
			throw new RuntimeException();
		}
	}
}
