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

This widget could not be displayed.

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
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Published yesterday in Confluence

Add-on evaluation with confluence templates

Atlassian market place contains number of Apps/Addons which improves the capability of out of the box Atlassian products. It is good to follow a plugin evaluation process before install add-ons. So t...

36 views 5 3
Read article

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