Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- IndexWriter iw = new IndexWriter(indexDir.getAbsolutePath(), analyzer, false);
- DataNode aNode = ... ;
- synchronized (LOCK) {
- try {
- indexWriter = createFulltextIndexWriter();
- ... do modifications and save node, update index
- indexWriter.close();
- } finally {
- try {
- indexWriter.close();
- } catch (Throwable e2) {
- }
- }
- }
- private static final Object LOCK = new Object();
Add Comment
Please, Sign In to add comment