For the index process I use IndexModifier class.
That happens when I try to search something into the index in the same
time that the index process still running.
the code for indexing:
          System.setProperty("org.apache.lucene.lockDir", System
                .getProperty("user.dir"));
        File folder = new File(getIndexPath());
        Directory dir = null;
        if (folder.isDirectory() && folder.exists()) {
            dir = FSDirectory.getDirectory(getIndexPath(), false);
        } else if (!folder.isFile() && !folder.exists()) {
            dir = FSDirectory.getDirectory(getIndexPath(), true);
        } else {
            System.out.println("Bad index folder");
            System.exit(1);
        }
        boolean newIndex = true;
        if (dir.fileExists("segments")) {
            newIndex = false;
        }
        // long lastindexation = dir.fileModified("segments");
        writer = new IndexModifier(dir, new SimpleAnalyzer(), newIndex);
        dir.close();
        writer.setUseCompoundFile(true);
          ...

BTW, one thing that I don't think is right is the "dir.close()" statement after you creat the IndexModifier. I think you should not call dir.close() until you are done with the IndexModifier (ie, at the same time you call IndexModifier.close()).

It sounds like it's unrelated to your NFS locking issue but still could cause other problems...

Mike

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to