Which type of Lucene directory does Confluence use?

Lucene supports several types (MMapDirectory, NIOFSDirectory, SimpleFSDirectory) -- which one is used by Confluence 5?

I suspect that it's SimpleFSDirectory before 5.2 and whatever is autodetected by Lucene in 5.2 and newer, but a confirmation from dev team would be nice.

1 answer

1 accepted

Hi Sergey,

Short answer: You're right, it uses whatever is detected by Lucene in Confluence 5.3.

You can download the source of Confluence, as soon as you've purchased at least a $10 license. I searched in the code and I found the following snippet in DirectoryUtil (Confluence 5.3):

/**
     * get a Directory from a path and don't throw a whingy bloody IOException.
     * Upgrade the index version if incompatible with the current version.
     */
    public static Directory getDirectory(File path)
    {
        try
        {
            if (!path.exists() && !path.mkdir())
            {
                throw new IOException("Unable to create index directory '" + path.getAbsolutePath() + "'");
            }

            FSDirectory directory = FSDirectory.open(path);

            return directory;
        }
        catch (IOException e)
        {
            throw new LuceneException(e);
        }
    }

According the the JavaDoc of FSDirectory, as you wrote properly: open() will "allow Lucene to choose the best FSDirectory implementation given your environment". This snippet is then used in classes such as "DefaultEdgeQueries" and so on. I think the best solution for you is to look at the code directly. For sure, none of the 3 names you mention appear in the source of Confluence 5.3.

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Posted Monday in Confluence

Calling all marketing teams who use Confluence - we want to hear from you!

Hi Community! me again 🙂 If you’re a marketing team using Confluence, we want to hear your story! How did you start using Confluence? What are your use cases? What have been some of the benefits?...

151 views 3 3
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you