public SPIndexWriterInstance GetIndexWriter(object folder, object createIndex)
        {
            var targetFolder = GetFolderFromObject(folder);

            var bCreateIndex = false;

            if (createIndex != null && createIndex != Null.Value && createIndex != Undefined.Value && createIndex is Boolean)
            {
                bCreateIndex = (bool)createIndex;
            }

            var indexWriter = LuceneHelper.GetIndexWriterSingleton(targetFolder, bCreateIndex);

            return(new SPIndexWriterInstance(this.Engine.Object.InstancePrototype, indexWriter, targetFolder));
        }