return getWriter(companyId, false);
}
public static IndexWriter getWriter ( String companyId, boolean create ) throws IOException {
Directory directory = FSDirectory.open( new File( getLuceneDir( companyId ) ) );
IndexWriterConfig config = new IndexWriterConfig( Version.LUCENE_CURRENT, new SimpleAnalyzer( Version.LUCENE_CURRENT ) );
return new IndexWriter( directory, config );
}